aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2021-05-05 16:50:55 +0200
committerEric Botcazou <ebotcazou@adacore.com>2021-05-05 16:53:58 +0200
commitdfd2c92f3f5d204619bd218aa72b162997690796 (patch)
treee28add6a3413e829b25ba4676365a604b01bf436 /gcc
parent14cf6aab8578132ec89ccb46e69899ae6008ff63 (diff)
downloadgcc-dfd2c92f3f5d204619bd218aa72b162997690796.zip
gcc-dfd2c92f3f5d204619bd218aa72b162997690796.tar.gz
gcc-dfd2c92f3f5d204619bd218aa72b162997690796.tar.bz2
Fix PR rtl-optimization/100411
This is the bootstrap failure of GCC 11 on MinGW64 configured with --enable- tune=nocona. The bottom line is that SEH does not support CFI for epilogues but the x86 back-end nevertheless attaches it to instructions, so we have to filter it out and this is done by detecting the end of the prologue by means of the NOTE_INSN_PROLOGUE_END note. But the compiler manages to generate a second epilogue before this note in the RTL stream and this fools the aforementioned logic. The root cause is cross-jumping, which inserts a jump before the end of the prologue, in fact just before the note; the rest (CFG cleanup, BB reordering, etc) is downhill from there. gcc/ PR rtl-optimization/100411 * cfgcleanup.c (try_crossjump_to_edge): Also skip end of prologue and beginning of function markers.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cfgcleanup.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index f05cb61..17edc4f 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -2145,7 +2145,11 @@ try_crossjump_to_edge (int mode, edge e1, edge e2,
if (NOTE_INSN_BASIC_BLOCK_P (newpos1))
newpos1 = NEXT_INSN (newpos1);
- while (DEBUG_INSN_P (newpos1))
+ /* Skip also prologue and function markers. */
+ while (DEBUG_INSN_P (newpos1)
+ || (NOTE_P (newpos1)
+ && (NOTE_KIND (newpos1) == NOTE_INSN_PROLOGUE_END
+ || NOTE_KIND (newpos1) == NOTE_INSN_FUNCTION_BEG)))
newpos1 = NEXT_INSN (newpos1);
redirect_from = split_block (src1, PREV_INSN (newpos1))->src;