aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2021-10-20 10:42:56 +0200
committerEric Botcazou <ebotcazou@adacore.com>2021-10-20 10:46:37 +0200
commit972ee845f54839e9bd2e4611bb268d75440f3845 (patch)
treee9ceceb581e4026a5ccf1b447806da911667d97d /gcc/cfgexpand.c
parent8fe93cc664ded8cc1952da28b23f3fc68504a73e (diff)
downloadgcc-972ee845f54839e9bd2e4611bb268d75440f3845.zip
gcc-972ee845f54839e9bd2e4611bb268d75440f3845.tar.gz
gcc-972ee845f54839e9bd2e4611bb268d75440f3845.tar.bz2
Fix PR middle-end/102764
This is a regression present on the mainline in the form of -fcompare-debug failure at -O3 on a compiler-generated testcase. Fixed by disregarding a debug statement in the last position of a basic block to reset the current location for the outgoing edges. gcc/ PR middle-end/102764 * cfgexpand.c (expand_gimple_basic_block): Disregard a final debug statement to reset the current location for the outgoing edges. gcc/testsuite/ * gcc.dg/pr102764.c: New test.
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 03260b0..8b067f9 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -6090,7 +6090,7 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
/* Expand implicit goto and convert goto_locus. */
FOR_EACH_EDGE (e, ei, bb->succs)
{
- if (e->goto_locus != UNKNOWN_LOCATION || !stmt)
+ if (e->goto_locus != UNKNOWN_LOCATION || !stmt || is_gimple_debug (stmt))
set_curr_insn_location (e->goto_locus);
if ((e->flags & EDGE_FALLTHRU) && e->dest != bb->next_bb)
{