]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/81025 (gcc ICE while building glibc for MIPS soft-float multi...
authorJeff Law <law@redhat.com>
Wed, 3 Apr 2019 16:03:37 +0000 (10:03 -0600)
committerRichard Biener <rguenther@suse.de>
Tue, 4 May 2021 12:13:11 +0000 (14:13 +0200)
2019-04-03  Jeff Law  <law@redhat.com>

PR rtl-optimization/81025
* reorg.c (skip_consecutive_labels): Do not skip past a BARRIER.

(cherry picked from commit 9427422ddacdf1c2914adfb6e8edca87f250fdfc)

gcc/reorg.c

index f4d39b8dd6ea30f4f1803b0711a7201eec5fffcb..9ac3b891af716c81601afd6f1fd6186f39ea0563 100644 (file)
@@ -137,7 +137,20 @@ skip_consecutive_labels (rtx label_or_return)
 
   rtx_insn *label = as_a <rtx_insn *> (label_or_return);
 
-  for (insn = label; insn != 0 && !INSN_P (insn); insn = NEXT_INSN (insn))
+  /* __builtin_unreachable can create a CODE_LABEL followed by a BARRIER.
+
+     Since reaching the CODE_LABEL is undefined behavior, we can return
+     any code label and we're OK at runtime.
+
+     However, if we return a CODE_LABEL which leads to a shrinked wrapped
+     epilogue, but the path does not have a prologue, then we will trip
+     a sanity check in the dwarf2 cfi code which wants to verify that
+     the CFIs are all the same on the traces leading to the epilogue.
+
+     So we explicitly disallow looking through BARRIERS here.  */
+  for (insn = label;
+       insn != 0 && !INSN_P (insn) && !BARRIER_P (insn);
+       insn = NEXT_INSN (insn))
     if (LABEL_P (insn))
       label = insn;