diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-08 11:54:28 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-07-08 11:54:28 +0000 |
commit | 947f17448577f4a36b0d1a159d982b5edd12b2e2 (patch) | |
tree | d8886a952b213cc05d253995c2592fe7ab18d307 /gcc | |
parent | 15381b1e12bc915062065930dd95564acc857838 (diff) | |
download | gcc-947f17448577f4a36b0d1a159d982b5edd12b2e2.tar.gz |
2015-07-08 Richard Biener <rguenther@suse.de>
PR tree-optimization/66793
* gimple-ssa-isolate-paths.c (insert_trap_and_remove_trailing_statemen):
Properly split the block after stmts ending it.
* gcc.dg/torture/pr66793.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225546 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple-ssa-isolate-paths.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr66793.c | 26 |
4 files changed, 45 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d3858096dea..421705dde5b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2015-07-08 Richard Biener <rguenther@suse.de> + PR tree-optimization/66793 + * gimple-ssa-isolate-paths.c (insert_trap_and_remove_trailing_statemen): + Properly split the block after stmts ending it. + +2015-07-08 Richard Biener <rguenther@suse.de> + PR tree-optimization/66794 * passes.c (execute_function_todo): Assert that post-dominators are not computed. diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c index b437182be6d..d43b5ac5abf 100644 --- a/gcc/gimple-ssa-isolate-paths.c +++ b/gcc/gimple-ssa-isolate-paths.c @@ -103,7 +103,14 @@ insert_trap_and_remove_trailing_statements (gimple_stmt_iterator *si_p, tree op) if (walk_stmt_load_store_ops (stmt, (void *)op, check_loadstore, check_loadstore)) - gsi_insert_after (si_p, seq, GSI_NEW_STMT); + { + gsi_insert_after (si_p, seq, GSI_NEW_STMT); + if (stmt_ends_bb_p (stmt)) + { + split_block (gimple_bb (stmt), stmt); + return; + } + } else gsi_insert_before (si_p, seq, GSI_NEW_STMT); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7414562229f..f389f54cb06 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2015-07-08 Richard Biener <rguenther@suse.de> + PR tree-optimization/66793 + * gcc.dg/torture/pr66793.c: New testcase. + +2015-07-08 Richard Biener <rguenther@suse.de> + PR tree-optimization/66794 * gcc.dg/torture/pr66794.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/torture/pr66793.c b/gcc/testsuite/gcc.dg/torture/pr66793.c new file mode 100644 index 00000000000..3c9d5a2bb11 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr66793.c @@ -0,0 +1,26 @@ +/* { dg-do link } */ + +int a, b, c; + +struct S0 +{ + int f1; +} *d; + +void +fn1 (struct S0 p) +{ + for (p.f1 = 0; p.f1 < 1; p.f1++) + c = a && b ? a && b : 1; + for (; c;) + ; +} + +int +main () +{ + struct S0 **f = &d; + d = 0; + fn1 (**f); + return 0; +} |