]> gcc.gnu.org Git - gcc.git/commit
cfgcleanup: Fix -fcompare-debug issue in outgoing_edges_match [PR100254]
authorJakub Jelinek <jakub@redhat.com>
Tue, 27 Apr 2021 13:26:24 +0000 (15:26 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 4 May 2021 12:20:26 +0000 (14:20 +0200)
commit1eb90acf00a47f9ed28ff6bd7914a4ae4bf9d325
treeaf6295f36e333c15e1312a86382f65ab4bbf496a
parent4f89f7aef6a89f05bca79713eba4c05b7dacb348
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.

(cherry picked from commit e600df51a15b2ec7a72731921a2464ffe59cf5ab)
gcc/cfgcleanup.c
gcc/testsuite/g++.dg/opt/pr100254.C [new file with mode: 0644]
This page took 0.058837 seconds and 6 git commands to generate.