From 28537a45de776c6d4eb4a21447374e27acc4573d Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 23 Jul 2015 07:23:23 +0000 Subject: [PATCH] re PR middle-end/66945 (ICE in generic_simplify (generic-match.c:24790)) 2015-07-23 Richard Biener PR tree-optimization/66945 * tree-ssa-propagate.c (substitute_and_fold_dom_walker ::before_dom_children): Force the propagators idea of non-executable edges to materialize, not what the folder chooses. * gcc.dg/torture/pr66945.c: New testcase. From-SVN: r226088 --- gcc/ChangeLog | 8 ++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr66945.c | 12 ++++++++++++ gcc/tree-ssa-propagate.c | 26 +++++++++++++++++++++++--- 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr66945.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7cd07f9d7d6..e89f685cb8c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2015-07-23 Richard Biener + + PR tree-optimization/66945 + * tree-ssa-propagate.c (substitute_and_fold_dom_walker + ::before_dom_children): Force the propagators idea of + non-executable edges to materialize, not what the folder + chooses. + 2015-07-23 Richard Biener * gimple.h (gimple_cond_make_false): Use 0 != 0. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f457b27fe6a..20fad268d2d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-07-23 Richard Biener + + PR tree-optimization/66945 + * gcc.dg/torture/pr66945.c: New testcase. + 2015-07-22 Uros Bizjak PR target/66954 diff --git a/gcc/testsuite/gcc.dg/torture/pr66945.c b/gcc/testsuite/gcc.dg/torture/pr66945.c new file mode 100644 index 00000000000..53ac2302657 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr66945.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ + +unsigned b; +void f() +{ + for(;;) + if(!b?:(b=0)) + ; + else if(b%0flags & EDGE_EXECUTABLE) + ^ (EDGE_SUCC (bb, 1)->flags & EDGE_EXECUTABLE)) + { + if (((EDGE_SUCC (bb, 0)->flags & EDGE_TRUE_VALUE) != 0) + == ((EDGE_SUCC (bb, 0)->flags & EDGE_EXECUTABLE) != 0)) + gimple_cond_make_true (as_a (stmt)); + else + gimple_cond_make_false (as_a (stmt)); + did_replace = true; + } + } /* Now cleanup. */ if (did_replace) { - stmt = gsi_stmt (i); - /* If we cleaned up EH information from the statement, remove EH edges. */ if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt)) -- 2.30.2