aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-reassoc.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-08-25 11:36:35 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-08-25 11:36:35 +0200
commitca046f7f4eafcfbcdb11a714ff93c8340f6ee0f7 (patch)
tree7dc15e1ccdd513b47f3fd2d18beb61f0a3bf957d /gcc/tree-ssa-reassoc.c
parent46b57af175e889126f65a6ca667c2c4606f93f84 (diff)
downloadgcc-ca046f7f4eafcfbcdb11a714ff93c8340f6ee0f7.zip
gcc-ca046f7f4eafcfbcdb11a714ff93c8340f6ee0f7.tar.gz
gcc-ca046f7f4eafcfbcdb11a714ff93c8340f6ee0f7.tar.bz2
re PR tree-optimization/45059 (error: invalid operands in binary operation, leads to ICE: verify_stmts failed)
PR tree-optimization/45059 * tree-ssa-reassoc.c (eliminate_redundant_comparison): Strip useless type conversions from newop{1,2}. Assert t is a comparison and newop{1,2} after the stripping are gimple vals. * gcc.c-torture/compile/pr45059.c: New test. From-SVN: r163539
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r--gcc/tree-ssa-reassoc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index fd0a6d8..f2264b6 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1314,9 +1314,14 @@ eliminate_redundant_comparison (enum tree_code opcode,
enum tree_code subcode;
tree newop1;
tree newop2;
+ gcc_assert (COMPARISON_CLASS_P (t));
tmpvar = create_tmp_var (TREE_TYPE (t), NULL);
add_referenced_var (tmpvar);
extract_ops_from_tree (t, &subcode, &newop1, &newop2);
+ STRIP_USELESS_TYPE_CONVERSION (newop1);
+ STRIP_USELESS_TYPE_CONVERSION (newop2);
+ gcc_checking_assert (is_gimple_val (newop1)
+ && is_gimple_val (newop2));
sum = build_and_add_sum (tmpvar, newop1, newop2, subcode);
curr->op = gimple_get_lhs (sum);
}