diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-04-27 15:26:24 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-04-27 15:27:14 +0200 |
commit | e600df51a15b2ec7a72731921a2464ffe59cf5ab (patch) | |
tree | fb77f6cffc86abe7d9fa17a9191eeed7725cafa1 /gcc/cfgcleanup.c | |
parent | 8d4c374c4419a8751cfae18d6b58169c62dea49f (diff) | |
download | gcc-e600df51a15b2ec7a72731921a2464ffe59cf5ab.zip gcc-e600df51a15b2ec7a72731921a2464ffe59cf5ab.tar.gz gcc-e600df51a15b2ec7a72731921a2464ffe59cf5ab.tar.bz2 |
cfgcleanup: Fix -fcompare-debug issue in outgoing_edges_match [PR100254]
The following testcase fails with -fcompare-debug. The problem is that
outgoing_edges_match behaves differently between -g0 and -g, if
some load/store with REG_EH_REGION is followed by DEBUG_INSNs, the
REG_EH_REGION check is not done, while when there are no DEBUG_INSNs, it is
done.
We already compute last1 and last2 as BB_END (bb{1,2}) with skipped debug
insns and notes, so this patch just uses those.
2021-04-27 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/100254
* cfgcleanup.c (outgoing_edges_match): Check REG_EH_REGION on
last1 and last2 insns rather than BB_END (bb1) and BB_END (bb2) insns.
* g++.dg/opt/pr100254.C: New test.
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 8650fb7..260a896 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -1885,8 +1885,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2) /* Ensure the same EH region. */ { - rtx n1 = find_reg_note (BB_END (bb1), REG_EH_REGION, 0); - rtx n2 = find_reg_note (BB_END (bb2), REG_EH_REGION, 0); + rtx n1 = find_reg_note (last1, REG_EH_REGION, 0); + rtx n2 = find_reg_note (last2, REG_EH_REGION, 0); if (!n1 && n2) return false; |