From: Richard Biener Date: Fri, 10 May 2013 12:20:36 +0000 (+0000) Subject: re PR tree-optimization/57214 (ice: tree check: expected ssa_name, have integer_cst... X-Git-Tag: releases/gcc-4.9.0~5956 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ff09a22bf4323b92457f717b13fac6a85bf7745;p=thirdparty%2Fgcc.git re PR tree-optimization/57214 (ice: tree check: expected ssa_name, have integer_cst in coalesce_partitions, at tree-ssa-coalesce.c:1194) 2013-05-10 Richard Biener PR tree-optimization/57214 * tree-ssa-loop-ivcanon.c (propagate_constants_for_unrolling): Do not propagate from SSA names that occur in abnormal PHI nodes. From-SVN: r198773 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bdc8bc50e10c..8980e5e199c2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-05-10 Richard Biener + + PR tree-optimization/57214 + * tree-ssa-loop-ivcanon.c (propagate_constants_for_unrolling): Do + not propagate from SSA names that occur in abnormal PHI nodes. + 2013-05-10 Marc Glisse * stor-layout.c (element_precision): New function. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d8e13548d966..6ab94b216f7a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-05-10 Richard Biener + + PR tree-optimization/57214 + * tree-ssa-loop-ivcanon.c (propagate_constants_for_unrolling): Do + not propagate from SSA names that occur in abnormal PHI nodes. + 2013-05-10 Marc Glisse * gcc.dg/vector-shift.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/torture/pr57214.c b/gcc/testsuite/gcc.dg/torture/pr57214.c new file mode 100644 index 000000000000..d51067d95d8f --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57214.c @@ -0,0 +1,25 @@ +/* { dg-do compile } */ + +extern int baz (void); +extern int foo (void) __attribute__ ((returns_twice)); + +void +bar (_Bool b) +{ + int buf[1]; + while (1) + { + _Bool x = 1; + if (b) + baz (); + b = 1; + baz (); + x = 0; + int i; + while (buf[i] && i) + i++; + foo (); + if (!x) + b = 0; + } +} diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index c57e4f6a30d3..b5751cb7f7fc 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -1085,8 +1085,9 @@ propagate_constants_for_unrolling (basic_block bb) tree lhs; if (is_gimple_assign (stmt) + && gimple_assign_rhs_code (stmt) == INTEGER_CST && (lhs = gimple_assign_lhs (stmt), TREE_CODE (lhs) == SSA_NAME) - && gimple_assign_rhs_code (stmt) == INTEGER_CST) + && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs)) { propagate_into_all_uses (lhs, gimple_assign_rhs1 (stmt)); gsi_remove (&gsi, true);