From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3A28F1581EE for ; Wed, 09 Apr 2025 12:42:59 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 228AE343308 for ; Wed, 09 Apr 2025 12:42:59 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 20ADC1104B6; Wed, 09 Apr 2025 12:42:58 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 1678E1104B6 for ; Wed, 09 Apr 2025 12:42:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BC0E5343314 for ; Wed, 09 Apr 2025 12:42:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1A537159F for ; Wed, 09 Apr 2025 12:42:56 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1744202568.7fdeb3bbc747e8fca508703af93d3af5d7feb81e.sam@gentoo> Subject: [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/ X-VCS-Repository: proj/gcc-patches X-VCS-Files: 15.0.0/gentoo/83_all_PR119689.patch 15.0.0/gentoo/README.history X-VCS-Directories: 15.0.0/gentoo/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 7fdeb3bbc747e8fca508703af93d3af5d7feb81e X-VCS-Branch: master Date: Wed, 09 Apr 2025 12:42:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f6068648-0489-4711-b88e-b624d1b0ee00 X-Archives-Hash: ee9227b9d1bd135cd78e72ecbf1d2dff commit: 7fdeb3bbc747e8fca508703af93d3af5d7feb81e Author: Sam James gentoo org> AuthorDate: Wed Apr 9 12:42:48 2025 +0000 Commit: Sam James gentoo org> CommitDate: Wed Apr 9 12:42:48 2025 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7fdeb3bb 15.0.0: add compare-debug patch Signed-off-by: Sam James gentoo.org> 15.0.0/gentoo/83_all_PR119689.patch | 100 ++++++++++++++++++++++++++++++++++++ 15.0.0/gentoo/README.history | 1 + 2 files changed, 101 insertions(+) diff --git a/15.0.0/gentoo/83_all_PR119689.patch b/15.0.0/gentoo/83_all_PR119689.patch new file mode 100644 index 0000000..aaa1307 --- /dev/null +++ b/15.0.0/gentoo/83_all_PR119689.patch @@ -0,0 +1,100 @@ +https://inbox.sourceware.org/gcc-patches/20250409124018.R4J_6bGlxGGDb4MRmq3_nKa5BMDlxJ9RZybNrpR3J58@z/ + +From 83b08e26be60bd1fd03323643f6c75e46b5cc0fd Mon Sep 17 00:00:00 2001 +Message-ID: <83b08e26be60bd1fd03323643f6c75e46b5cc0fd.1744202504.git.sam@gentoo.org> +From: Richard Biener +Date: Wed, 9 Apr 2025 14:40:18 +0200 +Subject: [PATCH] rtl-optimization/119689 - compare-debug failure with LRA + +The previous change to fix LRA rematerialization broke compare-debug +for i586 bootstrap. Fixed by using prev_nonnote_nondebug_insn +instead of prev_nonnote_insn. + +Bootstrapped on i586-linux where the miscompare is gone with this +patch. Bootstrap and regtest running on x86_64-unknown-linux-gnu. + +OK if the latter succeeds? + +Thanks, +Richard. + + PR rtl-optimization/119689 + PR rtl-optimization/115568 + * lra-remat.cc (create_cands): Use prev_nonnote_nondebug_insn + to check whether insn2 is directly before insn. + +* g++.target/i386/pr119689.C: New testcase. +--- + gcc/lra-remat.cc | 2 +- + gcc/testsuite/g++.target/i386/pr119689.C | 44 ++++++++++++++++++++++++ + 2 files changed, 45 insertions(+), 1 deletion(-) + create mode 100644 gcc/testsuite/g++.target/i386/pr119689.C + +diff --git a/gcc/lra-remat.cc b/gcc/lra-remat.cc +index 2f3afffcf5be..5f823193aa73 100644 +--- a/gcc/lra-remat.cc ++++ b/gcc/lra-remat.cc +@@ -460,7 +460,7 @@ create_cands (void) + && dst_regno >= FIRST_PSEUDO_REGISTER + && reg_renumber[dst_regno] < 0 + && BLOCK_FOR_INSN (insn2) == BLOCK_FOR_INSN (insn) +- && insn2 == prev_nonnote_insn (insn)) ++ && insn2 == prev_nonnote_nondebug_insn (insn)) + { + create_cand (insn2, regno_potential_cand[src_regno].nop, + dst_regno, insn); +diff --git a/gcc/testsuite/g++.target/i386/pr119689.C b/gcc/testsuite/g++.target/i386/pr119689.C +new file mode 100644 +index 000000000000..cdc6d2dade53 +--- /dev/null ++++ b/gcc/testsuite/g++.target/i386/pr119689.C +@@ -0,0 +1,44 @@ ++// { dg-do compile } ++// { dg-options "-O2 -fcompare-debug" } ++// { dg-additional-options "-march=i586 -mtune=generic" { target ia32 } } ++// { dg-additional-options "-fPIC" { target { fpic } } } ++ ++enum gimple_code { GIMPLE_ASSIGN, GIMPLE_RETURN }; ++bool is_gimple_call(); ++int m_sig, m_exp, sreal_new_exp; ++struct sreal { ++ sreal(long long sig) { ++ long long __trans_tmp_6 = sig >= 0 ? sig : -(unsigned long long)sig; ++ sig = __trans_tmp_6 <<= sreal_new_exp -= m_exp = __trans_tmp_6; ++ m_sig = sig; ++ } ++ void operator/(sreal); ++}; ++struct ipa_predicate { ++ ipa_predicate(bool = true); ++ void operator&=(ipa_predicate); ++ void operator&(ipa_predicate); ++}; ++void add_condition(); ++gimple_code eliminated_by_inlining_prob_code; ++static int eliminated_by_inlining_prob() { ++ switch (eliminated_by_inlining_prob_code) { ++ case GIMPLE_RETURN: ++ return 2; ++ case GIMPLE_ASSIGN: ++ return 1; ++ } ++ return 0; ++} ++void fp_expression_p() { ++ ipa_predicate bb_predicate; ++ for (;;) { ++ int prob = eliminated_by_inlining_prob(); ++ ipa_predicate sra_predicate; ++ sra_predicate &= add_condition; ++ if (is_gimple_call()) ++ sreal(prob) / 2; ++ if (prob != 2) ++ bb_predicate & sra_predicate; ++ } ++} + +base-commit: 24d1832e0d6edce4f6f717135fcec65d6939e199 +-- +2.49.0 + diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history index c3166a6..4e68fca 100644 --- a/15.0.0/gentoo/README.history +++ b/15.0.0/gentoo/README.history @@ -6,6 +6,7 @@ - 86_all_combine-Limit-insn-searchs-for-2-2-combinations-PR11.patch - 87_all_simplify-rtx-Fix-shortcut-for-vector-eq-ne.patch - 88_all_PR119614.patch + + 83_all_PR119689.patch 53 7 April 2025