From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 7DEBD385E83D; Tue, 29 Mar 2022 05:53:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7DEBD385E83D MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-9723] cfgrtl: Fix up -g vs. -g0 code generation -flto differences in fixup_reorder_chain [PR104589] X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 1a2772a3fe41bc0c33c4620540dae0103dcf7289 X-Git-Newrev: 7737259ceaa490a1cc75415efa00f3631a7e17df Message-Id: <20220329055342.7DEBD385E83D@sourceware.org> Date: Tue, 29 Mar 2022 05:53:42 +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: Tue, 29 Mar 2022 05:53:42 -0000 https://gcc.gnu.org/g:7737259ceaa490a1cc75415efa00f3631a7e17df commit r11-9723-g7737259ceaa490a1cc75415efa00f3631a7e17df Author: Jakub Jelinek Date: Wed Mar 2 10:48:14 2022 +0100 cfgrtl: Fix up -g vs. -g0 code generation -flto differences in fixup_reorder_chain [PR104589] This is similar to PR104237 and similarly to that, no testcase included for the testsuite, as we don't have a framework to compile/link with -g -flto and -g0 -flto and compare -fdump-final-insns= results from the lto1 compilations. With -flto, whether two location_t compare equal or not and just express the same location is a lottery. 2022-03-02 Jakub Jelinek PR rtl-optimization/104589 * cfgrtl.c (fixup_reorder_chain): Use loc_equal instead of direct INSN_LOCATION comparison with goto_locus. (cherry picked from commit 2e1b00367abaf8b6dbb47fd8518d9ac69c326a06) Diff: --- gcc/cfgrtl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 418b957e050..8fd128b471c 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -4120,7 +4120,7 @@ fixup_reorder_chain (void) && (!NONDEBUG_INSN_P (insn) || !INSN_HAS_LOCATION (insn))) insn = PREV_INSN (insn); if (insn != end - && INSN_LOCATION (insn) == e->goto_locus) + && loc_equal (INSN_LOCATION (insn), e->goto_locus)) continue; if (simplejump_p (BB_END (e->src)) && !INSN_HAS_LOCATION (BB_END (e->src))) @@ -4142,7 +4142,7 @@ fixup_reorder_chain (void) while (insn != end && !NONDEBUG_INSN_P (insn)) insn = NEXT_INSN (insn); if (insn != end && INSN_HAS_LOCATION (insn) - && INSN_LOCATION (insn) == e->goto_locus) + && loc_equal (INSN_LOCATION (insn), e->goto_locus)) continue; } nb = split_edge (e);