From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 9757B3858014; Wed, 2 Mar 2022 09:49:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9757B3858014 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 r12-7447] 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/master X-Git-Oldrev: 5f2e72db8c03c960d8330305c1e92986373198ca X-Git-Newrev: 2e1b00367abaf8b6dbb47fd8518d9ac69c326a06 Message-Id: <20220302094924.9757B3858014@sourceware.org> Date: Wed, 2 Mar 2022 09:49:24 +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: Wed, 02 Mar 2022 09:49:24 -0000 https://gcc.gnu.org/g:2e1b00367abaf8b6dbb47fd8518d9ac69c326a06 commit r12-7447-g2e1b00367abaf8b6dbb47fd8518d9ac69c326a06 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.cc (fixup_reorder_chain): Use loc_equal instead of direct INSN_LOCATION comparison with goto_locus. Diff: --- gcc/cfgrtl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/cfgrtl.cc b/gcc/cfgrtl.cc index 567575176a3..74ea14efc61 100644 --- a/gcc/cfgrtl.cc +++ b/gcc/cfgrtl.cc @@ -4090,7 +4090,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))) @@ -4112,7 +4112,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);