From 9427422ddacdf1c2914adfb6e8edca87f250fdfc Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Wed, 3 Apr 2019 10:03:37 -0600 Subject: [PATCH] re PR rtl-optimization/81025 (gcc ICE while building glibc for MIPS soft-float multi-lib variant) PR rtl-optimization/81025 * reorg.c (skip_consecutive_labels): Do not skip past a BARRIER. From-SVN: r270129 --- gcc/ChangeLog | 5 +++++ gcc/reorg.c | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9149d9c9a9e..0d7c206de90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-04-03 Jeff Law + + PR rtl-optimization/81025 + * reorg.c (skip_consecutive_labels): Do not skip past a BARRIER. + 2019-04-03 Richard Biener PR tree-optimization/84101 diff --git a/gcc/reorg.c b/gcc/reorg.c index 84128a4fe9e..81349382b81 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -137,7 +137,20 @@ skip_consecutive_labels (rtx label_or_return) rtx_insn *label = as_a (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; -- 2.30.2