summaryrefslogtreecommitdiff
path: root/gcc/tree-cfgcleanup.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2014-09-17 21:05:49 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2014-09-17 21:05:49 +0200
commitc83ee180191ab19daabee8edefa3e8cf4d00b67f (patch)
tree1e2dd22893555d54a49831e0c07134a5a8858d33 /gcc/tree-cfgcleanup.c
parentf020a31c22dc488c910243336cdd9c85d9f3fc5c (diff)
downloadgcc-c83ee180191ab19daabee8edefa3e8cf4d00b67f.tar.gz
re PR debug/63284 (-fcompare-debug issue due to redirection to __builtin_unreachable ())
PR debug/63284 * tree-cfgcleanup.c (fixup_noreturn_call): Don't split block if there are only debug stmts after the noreturn call, instead remove the debug stmts. * gcc.dg/pr63284.c: New test. From-SVN: r215331
Diffstat (limited to 'gcc/tree-cfgcleanup.c')
-rw-r--r--gcc/tree-cfgcleanup.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index a66ec6e7537..451630f1563 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -565,7 +565,20 @@ fixup_noreturn_call (gimple stmt)
/* First split basic block if stmt is not last. */
if (stmt != gsi_stmt (gsi_last_bb (bb)))
- split_block (bb, stmt);
+ {
+ if (stmt == gsi_stmt (gsi_last_nondebug_bb (bb)))
+ {
+ /* Don't split if there are only debug stmts
+ after stmt, that can result in -fcompare-debug
+ failures. Remove the debug stmts instead,
+ they should be all unreachable anyway. */
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
+ for (gsi_next (&gsi); !gsi_end_p (gsi); )
+ gsi_remove (&gsi, true);
+ }
+ else
+ split_block (bb, stmt);
+ }
changed |= remove_fallthru_edge (bb->succs);