From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 53CC63950E54; Fri, 14 May 2021 14:56:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53CC63950E54 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] re PR rtl-optimization/81025 (gcc ICE while building glibc for MIPS soft-float multi-lib variant) X-Act-Checkin: gcc X-Git-Author: Jeff Law X-Git-Refname: refs/vendors/redhat/heads/gcc-8-branch X-Git-Oldrev: 9c4c6daf6403c0116d7ca2e6ce8aff3d41271db3 X-Git-Newrev: fd2e3c2029cf9cf74e2eac3791128cf664f47c33 Message-Id: <20210514145617.53CC63950E54@sourceware.org> Date: Fri, 14 May 2021 14:56:17 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2021 14:56:17 -0000 https://gcc.gnu.org/g:fd2e3c2029cf9cf74e2eac3791128cf664f47c33 commit fd2e3c2029cf9cf74e2eac3791128cf664f47c33 Author: Jeff Law Date: Wed Apr 3 10:03:37 2019 -0600 re PR rtl-optimization/81025 (gcc ICE while building glibc for MIPS soft-float multi-lib variant) 2019-04-03 Jeff Law PR rtl-optimization/81025 * reorg.c (skip_consecutive_labels): Do not skip past a BARRIER. (cherry picked from commit 9427422ddacdf1c2914adfb6e8edca87f250fdfc) Diff: --- gcc/reorg.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gcc/reorg.c b/gcc/reorg.c index f4d39b8dd6e..9ac3b891af7 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;