summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorKazu Hirata <kazu@codesourcery.com>2006-05-21 15:16:19 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2006-05-21 15:16:19 +0000
commit5104d6484ac0a63c35986266affd74c6499b7bc6 (patch)
tree42db309cbd8105eba46e1b4544b28424d9cee81a /gcc/fold-const.c
parent4d49d44d6619d257f7635ef4c449d0b036add018 (diff)
downloadgcc-5104d6484ac0a63c35986266affd74c6499b7bc6.tar.gz
re PR middle-end/26622 (ICE in extract_insn, at recog.c:2084)
gcc/ PR tree-optimization/26622. * fold-const.c (fold_ternary) <COND_EXPR>: Call fold_convert on arg1. gcc/testsuite/ PR tree-optimization/26622. * gcc.c-torture/compile/pr26622.c: New. From-SVN: r113956
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index ef06eea0811..8672e48f756 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -11072,8 +11072,10 @@ fold_ternary (enum tree_code code, tree type, tree op0, tree op1, tree op2)
&& integer_zerop (TREE_OPERAND (arg0, 1))
&& integer_zerop (op2)
&& (tem = sign_bit_p (TREE_OPERAND (arg0, 0), arg1)))
- return fold_convert (type, fold_build2 (BIT_AND_EXPR,
- TREE_TYPE (tem), tem, arg1));
+ return fold_convert (type,
+ fold_build2 (BIT_AND_EXPR,
+ TREE_TYPE (tem), tem,
+ fold_convert (TREE_TYPE (tem), arg1)));
/* (A >> N) & 1 ? (1 << N) : 0 is simply A & (1 << N). A & 1 was
already handled above. */