diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr84178-1.c | 18 | ||||
-rw-r--r-- | gcc/tree-if-conv.c | 8 |
4 files changed, 36 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 380b023..e1c40c3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-03-08 David Malcolm <dmalcolm@redhat.com> + + PR tree-optimization/84178 + * tree-if-conv.c (release_bb_predicate): Remove the + the assertion that the stmts have NULL use_ops. + Discard the statements, asserting that they haven't + yet been added to a BB. + 2018-03-08 Richard Biener <rguenther@suse.de> PR tree-optimization/84746 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3d12b6b..eb8ade6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-08 David Malcolm <dmalcolm@redhat.com> + + PR tree-optimization/84178 + * gcc.c-torture/compile/pr84178-1.c: New test. + 2018-03-08 Thomas Schwinge <thomas@codesourcery.com> * lib/target-supports.exp: Do not return zero from a ifunc diff --git a/gcc/testsuite/gcc.c-torture/compile/pr84178-1.c b/gcc/testsuite/gcc.c-torture/compile/pr84178-1.c new file mode 100644 index 0000000..49f2c89 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr84178-1.c @@ -0,0 +1,18 @@ +/* { dg-options "-fno-tree-forwprop" } */ + +int zy, h4; + +void +r8 (long int mu, int *jr, int *fi, short int dv) +{ + do + { + int tx; + + tx = !!h4 ? (zy / h4) : 1; + mu = tx; + *jr = (((unsigned char) mu > (254 >> dv)) ? 0 : (unsigned char) tx) + *fi; + } while (*jr == 0); + + r8 (mu, jr, fi, 1); +} diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c index cac3fd7..5467f3f 100644 --- a/gcc/tree-if-conv.c +++ b/gcc/tree-if-conv.c @@ -271,8 +271,7 @@ init_bb_predicate (basic_block bb) set_bb_predicate (bb, boolean_true_node); } -/* Release the SSA_NAMEs associated with the predicate of basic block BB, - but don't actually free it. */ +/* Release the SSA_NAMEs associated with the predicate of basic block BB. */ static inline void release_bb_predicate (basic_block bb) @@ -280,11 +279,14 @@ release_bb_predicate (basic_block bb) gimple_seq stmts = bb_predicate_gimplified_stmts (bb); if (stmts) { + /* Ensure that these stmts haven't yet been added to a bb. */ if (flag_checking) for (gimple_stmt_iterator i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i)) - gcc_assert (! gimple_use_ops (gsi_stmt (i))); + gcc_assert (! gimple_bb (gsi_stmt (i))); + /* Discard them. */ + gimple_seq_discard (stmts); set_bb_predicate_gimplified_stmts (bb, NULL); } } |