aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@gmail.com>2008-03-27 01:55:50 -0700
committerAndrew Pinski <pinskia@gcc.gnu.org>2008-03-27 01:55:50 -0700
commit87a72aa8f9a533b3d885b04be81b1c81d526f542 (patch)
tree9264662130bd84c064fb1f5eed83b4af113be464 /gcc/fold-const.c
parent40e43495ce35c06ac8379cc062673ac742dea592 (diff)
downloadgcc-87a72aa8f9a533b3d885b04be81b1c81d526f542.zip
gcc-87a72aa8f9a533b3d885b04be81b1c81d526f542.tar.gz
gcc-87a72aa8f9a533b3d885b04be81b1c81d526f542.tar.bz2
re PR tree-optimization/35429 (ICE with complex arithmetic)
2008-03-27 Andrew Pinski <pinskia@gmail.com> PR middle-end/35429 * fold-const.c (fold_truthop): Check for integeral types when folding a == 0 && b == 0 and a != 0 || b != 0 . 2008-03-27 Andrew Pinski <pinskia@gmail.com> PR middle-end/35429 * gcc.c-torture/compile/complex-5.c: New test. From-SVN: r133631
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 3bfe52e..896a983 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -5357,7 +5357,8 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs)
if (code == TRUTH_OR_EXPR
&& lcode == NE_EXPR && integer_zerop (lr_arg)
&& rcode == NE_EXPR && integer_zerop (rr_arg)
- && TREE_TYPE (ll_arg) == TREE_TYPE (rl_arg))
+ && TREE_TYPE (ll_arg) == TREE_TYPE (rl_arg)
+ && INTEGRAL_TYPE_P (TREE_TYPE (ll_arg)))
return build2 (NE_EXPR, truth_type,
build2 (BIT_IOR_EXPR, TREE_TYPE (ll_arg),
ll_arg, rl_arg),
@@ -5367,7 +5368,8 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs)
if (code == TRUTH_AND_EXPR
&& lcode == EQ_EXPR && integer_zerop (lr_arg)
&& rcode == EQ_EXPR && integer_zerop (rr_arg)
- && TREE_TYPE (ll_arg) == TREE_TYPE (rl_arg))
+ && TREE_TYPE (ll_arg) == TREE_TYPE (rl_arg)
+ && INTEGRAL_TYPE_P (TREE_TYPE (ll_arg)))
return build2 (EQ_EXPR, truth_type,
build2 (BIT_IOR_EXPR, TREE_TYPE (ll_arg),
ll_arg, rl_arg),