* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-08 17:03 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-08 17:03 UTC (permalink / raw
To: gentoo-commits
commit: 57f0631d613835def90f12c998feef13b5b7d629
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 8 17:02:35 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 8 17:02:35 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=57f0631d
15.0.0: drop 76_all_ppc_PR112868-no-checking-many.patch
Drop 76_all_ppc_PR112868-no-checking-many.patch because of
https://gcc.gnu.org/PR113652.
Bug: https://gcc.gnu.org/PR112868
Bug: https://gcc.gnu.org/PR113652
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../76_all_ppc_PR112868-no-checking-many.patch | 42 ----------------------
15.0.0/gentoo/README.history | 5 +++
2 files changed, 5 insertions(+), 42 deletions(-)
diff --git a/15.0.0/gentoo/76_all_ppc_PR112868-no-checking-many.patch b/15.0.0/gentoo/76_all_ppc_PR112868-no-checking-many.patch
deleted file mode 100644
index dc9f5e5..0000000
--- a/15.0.0/gentoo/76_all_ppc_PR112868-no-checking-many.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-https://gcc.gnu.org/PR112868 (specifically https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112868#c8)
-(see also https://gcc.gnu.org/PR113652)
-
---- a/gcc/config/rs6000/rs6000.h
-+++ b/gcc/config/rs6000/rs6000.h
-@@ -94,12 +94,6 @@
- "%{mdejagnu-*: %<mdejagnu-*}", \
- SUBTARGET_DRIVER_SELF_SPECS
-
--#if CHECKING_P
--#define ASM_OPT_ANY ""
--#else
--#define ASM_OPT_ANY " -many"
--#endif
--
- /* Common ASM definitions used by ASM_SPEC among the various targets for
- handling -mcpu=xxx switches. There is a parallel list in driver-rs6000.cc to
- provide the default assembler options if the user uses -mcpu=native, so if
-@@ -166,8 +160,7 @@
- mvsx: -mpower7; \
- mpowerpc64: -mppc64;: %(asm_default)}; \
- :%eMissing -mcpu option in ASM_CPU_SPEC?\n} \
--%{mvsx: -mvsx -maltivec; maltivec: -maltivec}" \
--ASM_OPT_ANY
-+%{mvsx: -mvsx -maltivec; maltivec: -maltivec}"
-
- #define CPP_DEFAULT_SPEC ""
-
---- a/gcc/testsuite/lib/target-supports.exp
-+++ b/gcc/testsuite/lib/target-supports.exp
-@@ -7285,7 +7285,7 @@ proc check_effective_target_powerpc_ppu_ok { } {
- #endif
- return 0;
- }
-- }]
-+ } "-mcpu=cell"]
- } else {
- return 0
- }
-
-
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 926ce25..15054c4 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+2 ????
+
+ - 76_all_ppc_PR112868-no-checking-many.patch
+
+
1 28 Apr 2024
+ 01_all_default-fortify-source.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-08 17:03 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-08 17:03 UTC (permalink / raw
To: gentoo-commits
commit: ab342368b9d0d2ac7f249ca2240644940c51fa78
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 8 17:03:05 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 8 17:03:19 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ab342368
15.0.0: add 76_all_ppc_PR97367-power7-cell-altivec.patch
Requested by ernsteiswuerfel.
Bug: https://gcc.gnu.org/PR97367
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch | 13 +++++++++++++
15.0.0/gentoo/README.history | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
new file mode 100644
index 0000000..154dd0f
--- /dev/null
+++ b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
@@ -0,0 +1,13 @@
+https://gcc.gnu.org/PR97367
+https://inbox.sourceware.org/gcc-patches/20240308.123342.1112119677226246836.rene@exactcode.de/
+--- a/gcc/config/rs6000/rs6000.cc
++++ b/gcc/config/rs6000/rs6000.cc
+@@ -5869,7 +5869,7 @@ rs6000_machine_from_flags (void)
+ HOST_WIDE_INT flags = rs6000_isa_flags;
+
+ /* Disable the flags that should never influence the .machine selection. */
+- flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL);
++ flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ALTIVEC | OPTION_MASK_ISEL);
+
+ if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
+ return "power10";
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 15054c4..32feb0a 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,7 +1,7 @@
2 ????
- 76_all_ppc_PR112868-no-checking-many.patch
-
+ + 76_all_ppc_PR97367-power7-cell-altivec.patch
1 28 Apr 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-10 2:08 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-10 2:08 UTC (permalink / raw
To: gentoo-commits
commit: 6fd8b4c1269795b281ede03ea1e9cd6ed3df1585
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 02:05:55 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 02:07:30 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6fd8b4c1
15.0.0: cut patchset 2
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 32feb0a..b2b3de3 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-2 ????
+2 10 June 2024
- 76_all_ppc_PR112868-no-checking-many.patch
+ 76_all_ppc_PR97367-power7-cell-altivec.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-10 17:28 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-10 17:28 UTC (permalink / raw
To: gentoo-commits
commit: 75e80ce24ee1b7a17c13e9e513cab5ba81635262
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 17:25:14 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 17:25:14 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=75e80ce2
15.0.0: backport two fixes
A severe miscompilation and a severe ICE fix.
Bug: https://gcc.gnu.org/PR115387
Bug: https://gcc.gnu.org/PR115395
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/77_all_PR115387.patch | 206 ++++++++++++++++++++++++++++++++++++
15.0.0/gentoo/78_all_PR115395.patch | 107 +++++++++++++++++++
15.0.0/gentoo/README.history | 5 +
3 files changed, 318 insertions(+)
diff --git a/15.0.0/gentoo/77_all_PR115387.patch b/15.0.0/gentoo/77_all_PR115387.patch
new file mode 100644
index 0000000..bf143e7
--- /dev/null
+++ b/15.0.0/gentoo/77_all_PR115387.patch
@@ -0,0 +1,206 @@
+https://gcc.gnu.org/PR115387
+https://inbox.sourceware.org/gcc-patches/430da3ad-59a6-4f16-b35f-8bef724a7ed7@gmail.com/T/#t
+
+From mboxrd@z Thu Jan 1 00:00:00 1970
+Return-Path: <SRS0=SYw7=NM=intel.com=pan2.li@sourceware.org>
+Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14])
+ by sourceware.org (Postfix) with ESMTPS id 48A883858CDB
+ for <gcc-patches@gcc.gnu.org>; Mon, 10 Jun 2024 14:49:07 +0000 (GMT)
+DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48A883858CDB
+Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com
+Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com
+ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 48A883858CDB
+Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.14
+ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718030949; cv=none;
+ b=sYMAFxaXXHzkHsYoFI0HFGXWzujiQRXs1KA4PpQKerabnFz185hAazNZgv5HRn33NHy30a6CaFSGdNqMzI5rJ/uWP0t/IVSZPws+DkO9GCBPkgQLIHvRRf5J+uf7usxHf+quk0tjfzrDkHctT7riGqQjzSEAkBTwrKXd7X9aQ9k=
+ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
+ t=1718030949; c=relaxed/simple;
+ bh=p/hDLfesLAxds7UkloKeUvZGINWc0ydc/cnr4ptMBSU=;
+ h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=GtE3ODQcVtLdsf2+edm43ZWyfgTSrruAj3RQ1zIcTMeifKot7fY59t2YIAFrSyx/vKLMuPwocIQ8p3VmYLj4DB2f8ybXvEhBcx2pxlh5GNVmPxjGtJsnrv6p7oMG9CA6X/bns8vlMhr2CgwzHRba7bItkwFWjKkI8gbJz3v9zeo=
+ARC-Authentication-Results: i=1; server2.sourceware.org
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
+ d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
+ t=1718030948; x=1749566948;
+ h=from:to:cc:subject:date:message-id:mime-version:
+ content-transfer-encoding;
+ bh=p/hDLfesLAxds7UkloKeUvZGINWc0ydc/cnr4ptMBSU=;
+ b=biitKQIpbkCUKRo31CQVWz5tQ3QP6AsTulnDi3LB7cDTMJflku4VDWDx
+ Dnu97Pvn/2HzgfrZyN+1kVfGvLnehrErvG2qw3kZ2PGu0AiKrtnTRj0ED
+ UdyWa4+MQF5nj34UK92MRcA1Ovou3O89YdQ11EmVuL1KynSTtKgwo/d/9
+ JsYn3MkWZP6NjVgZteOu5xBZF+J3NxK61azjaUgP8LIxo1bmEKUMBgo0f
+ p0gXtZXjZkxtpcqzr++CtB6e4fKUHQK8z/FjOzaHvwIzmxdoEcptRGtl9
+ v+2kXKMcvMQGZZlsBfFIewmNKjK6qUYGrDKl1wltMZMkeijuudmObyhaq
+ A==;
+X-CSE-ConnectionGUID: JaJ1NR5jSimBRrZvjuM+Lw==
+X-CSE-MsgGUID: Q6rSZfGaQfOHvXT9LPs02g==
+X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="18526139"
+X-IronPort-AV: E=Sophos;i="6.08,227,1712646000";
+ d="scan'208";a="18526139"
+Received: from orviesa002.jf.intel.com ([10.64.159.142])
+ by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 07:49:07 -0700
+X-CSE-ConnectionGUID: +SJ6B8QPQfWwhjgjPJujEw==
+X-CSE-MsgGUID: eHhYmO22SKyPWaJe7LW77Q==
+X-ExtLoop1: 1
+X-IronPort-AV: E=Sophos;i="6.08,227,1712646000";
+ d="scan'208";a="69872329"
+Received: from shvmail03.sh.intel.com ([10.239.245.20])
+ by orviesa002.jf.intel.com with ESMTP; 10 Jun 2024 07:49:04 -0700
+Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47])
+ by shvmail03.sh.intel.com (Postfix) with ESMTP id E43A71007C1D;
+ Mon, 10 Jun 2024 22:49:02 +0800 (CST)
+From: pan2.li@intel.com
+To: gcc-patches@gcc.gnu.org
+Cc: juzhe.zhong@rivai.ai,
+ kito.cheng@gmail.com,
+ richard.guenther@gmail.com,
+ Pan Li <pan2.li@intel.com>
+Subject: [PATCH v1] Widening-Mul: Fix one ICE of gcall insertion for PHI match
+Date: Mon, 10 Jun 2024 22:49:01 +0800
+Message-Id: <20240610144901.3723532-1-pan2.li@intel.com>
+X-Mailer: git-send-email 2.34.1
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
+X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org
+List-Id: <gcc-patches.gcc.gnu.org>
+
+From: Pan Li <pan2.li@intel.com>
+
+When enabled the PHI handing for COND_EXPR, we need to insert the gcall
+to replace the PHI node. Unfortunately, I made a mistake that insert
+the gcall to before the last stmt of the bb. See below gimple, the PHI
+is located at no.1 but we insert the gcall (aka no.9) to the end of
+the bb. Then the use of _9 in no.2 will have no def and will trigger
+ICE when verify_ssa.
+
+ 1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
+ 2. prephitmp_36 = (char *) _9;
+ 3. buf.write_base = string_13(D);
+ 4. buf.write_ptr = string_13(D);
+ 5. buf.write_end = prephitmp_36;
+ 6. buf.written = 0;
+ 7. buf.mode = 3;
+ 8. _7 = buf.write_end;
+ 9. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to last bb by mistake
+
+This patch would like to insert the gcall to before the start of the bb
+stmt. To ensure the possible use of PHI_result will have a def exists.
+After this patch the above gimple will be:
+
+ 0. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to start bb by mistake
+ 1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
+ 2. prephitmp_36 = (char *) _9;
+ 3. buf.write_base = string_13(D);
+ 4. buf.write_ptr = string_13(D);
+ 5. buf.write_end = prephitmp_36;
+ 6. buf.written = 0;
+ 7. buf.mode = 3;
+ 8. _7 = buf.write_end;
+
+The below test suites are passed for this patch:
+* The rv64gcv fully regression test with newlib.
+* The rv64gcv build with glibc.
+* The x86 regression test with newlib.
+* The x86 bootstrap test with newlib.
+
+ PR target/115387
+
+gcc/ChangeLog:
+
+ * tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children): Take
+ the gsi of start_bb instead of last_bb.
+
+gcc/testsuite/ChangeLog:
+
+ * gcc.target/riscv/pr115387-1.c: New test.
+ * gcc.target/riscv/pr115387-2.c: New test.
+
+Signed-off-by: Pan Li <pan2.li@intel.com>
+---
+ gcc/testsuite/gcc.target/riscv/pr115387-1.c | 35 +++++++++++++++++++++
+ gcc/testsuite/gcc.target/riscv/pr115387-2.c | 18 +++++++++++
+ gcc/tree-ssa-math-opts.cc | 2 +-
+ 3 files changed, 54 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/gcc.target/riscv/pr115387-1.c
+ create mode 100644 gcc/testsuite/gcc.target/riscv/pr115387-2.c
+
+diff --git a/gcc/testsuite/gcc.target/riscv/pr115387-1.c b/gcc/testsuite/gcc.target/riscv/pr115387-1.c
+new file mode 100644
+index 00000000000..a1c926977c4
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/riscv/pr115387-1.c
+@@ -0,0 +1,35 @@
++/* Test there is no ICE when compile. */
++/* { dg-do compile } */
++/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
++
++#define PRINTF_CHK 0x34
++
++typedef unsigned long uintptr_t;
++
++struct __printf_buffer {
++ char *write_ptr;
++ int status;
++};
++
++extern void __printf_buffer_init_end (struct __printf_buffer *, char *, char *);
++
++void
++test (char *string, unsigned long maxlen, unsigned mode_flags)
++{
++ struct __printf_buffer buf;
++
++ if ((mode_flags & PRINTF_CHK) != 0)
++ {
++ string[0] = '\0';
++ uintptr_t end;
++
++ if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
++ end = -1;
++
++ __printf_buffer_init_end (&buf, string, (char *) end);
++ }
++ else
++ __printf_buffer_init_end (&buf, string, (char *) ~(uintptr_t) 0);
++
++ *buf.write_ptr = '\0';
++}
+diff --git a/gcc/testsuite/gcc.target/riscv/pr115387-2.c b/gcc/testsuite/gcc.target/riscv/pr115387-2.c
+new file mode 100644
+index 00000000000..7183bf18dfd
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/riscv/pr115387-2.c
+@@ -0,0 +1,18 @@
++/* Test there is no ICE when compile. */
++/* { dg-do compile } */
++/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
++
++#include <stddef.h>
++#include <stdint-gcc.h>
++
++char *
++test (char *string, size_t maxlen)
++{
++ string[0] = '\0';
++ uintptr_t end;
++
++ if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
++ end = -1;
++
++ return (char *) end;
++}
+diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
+index 173b0366f5e..fbb8e0ea306 100644
+--- a/gcc/tree-ssa-math-opts.cc
++++ b/gcc/tree-ssa-math-opts.cc
+@@ -6102,7 +6102,7 @@ math_opts_dom_walker::after_dom_children (basic_block bb)
+ for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
+ gsi_next (&psi))
+ {
+- gimple_stmt_iterator gsi = gsi_last_bb (bb);
++ gimple_stmt_iterator gsi = gsi_start_bb (bb);
+ match_unsigned_saturation_add (&gsi, psi.phi ());
+ }
+
+--
+2.34.1
diff --git a/15.0.0/gentoo/78_all_PR115395.patch b/15.0.0/gentoo/78_all_PR115395.patch
new file mode 100644
index 0000000..d98c043
--- /dev/null
+++ b/15.0.0/gentoo/78_all_PR115395.patch
@@ -0,0 +1,107 @@
+https://gcc.gnu.org/PR115395
+
+From 4ed9c5df7efeb98e190573cca42a4fd40666c45f Mon Sep 17 00:00:00 2001
+From: Richard Biener <rguenther@suse.de>
+Date: Mon, 10 Jun 2024 10:12:52 +0200
+Subject: [PATCH] tree-optimization/115395 - wrong-code with SLP reduction in
+ epilog
+
+When we continue a non-SLP reduction from the main loop in the
+epilog with a SLP reduction we currently fail to handle an
+adjustment by the initial value because that's not a thing with SLP.
+As long as we have the possibility to mix SLP and non-SLP we have
+to handle it though.
+
+ PR tree-optimization/115395
+ * tree-vect-loop.cc (vect_create_epilog_for_reduction):
+ Handle STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT also for SLP
+ reductions of group_size one.
+
+ * gcc.dg/vect/pr115395.c: New testcase.
+---
+ gcc/testsuite/gcc.dg/vect/pr115395.c | 27 +++++++++++++++++++++++++++
+ gcc/tree-vect-loop.cc | 27 ++++++++-------------------
+ 2 files changed, 35 insertions(+), 19 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/vect/pr115395.c
+
+diff --git a/gcc/testsuite/gcc.dg/vect/pr115395.c b/gcc/testsuite/gcc.dg/vect/pr115395.c
+new file mode 100644
+index 00000000000..cd1cee9f3df
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/vect/pr115395.c
+@@ -0,0 +1,27 @@
++/* { dg-additional-options "-mavx2" { target avx2_runtime } } */
++
++#include "tree-vect.h"
++
++struct {
++ long header_size;
++ long start_offset;
++ long end_offset;
++} myrar_dbo[5] = {{0, 87, 6980}, {0, 7087, 13980}, {0, 14087, 0}};
++
++int i;
++long offset;
++
++int main()
++{
++ check_vect ();
++
++ offset += myrar_dbo[0].start_offset;
++ while (i < 2) {
++ i++;
++ offset += myrar_dbo[i].start_offset - myrar_dbo[i - 1].end_offset;
++ }
++ if (offset != 301)
++ abort();
++
++ return 0;
++}
+diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
+index 028692614bb..c471f1564a7 100644
+--- a/gcc/tree-vect-loop.cc
++++ b/gcc/tree-vect-loop.cc
+@@ -6030,25 +6030,14 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
+
+ tree induc_val = NULL_TREE;
+ tree adjustment_def = NULL;
+- if (slp_node)
+- {
+- /* Optimize: for induction condition reduction, if we can't use zero
+- for induc_val, use initial_def. */
+- if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
+- induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
+- /* ??? Coverage for 'else' isn't clear. */
+- }
++ /* Optimize: for induction condition reduction, if we can't use zero
++ for induc_val, use initial_def. */
++ if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
++ induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
++ else if (double_reduc)
++ ;
+ else
+- {
+- /* Optimize: for induction condition reduction, if we can't use zero
+- for induc_val, use initial_def. */
+- if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
+- induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
+- else if (double_reduc)
+- ;
+- else
+- adjustment_def = STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info);
+- }
++ adjustment_def = STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info);
+
+ stmt_vec_info single_live_out_stmt[] = { stmt_info };
+ array_slice<const stmt_vec_info> live_out_stmts = single_live_out_stmt;
+@@ -6873,7 +6862,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
+
+ if (adjustment_def)
+ {
+- gcc_assert (!slp_reduc);
++ gcc_assert (!slp_reduc || group_size == 1);
+ gimple_seq stmts = NULL;
+ if (double_reduc)
+ {
+--
+2.43.0
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index b2b3de3..1573b55 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+3 10 June 2024
+
+ + 77_all_PR115387.patch
+ + 78_all_PR115395.patch
+
2 10 June 2024
- 76_all_ppc_PR112868-no-checking-many.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-10 17:28 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-10 17:28 UTC (permalink / raw
To: gentoo-commits
commit: 98503e61e8b723a012ccef2eed6a8387e43535e7
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 17:28:02 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 17:28:02 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=98503e61
15.0.0: drop upstreamed patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/78_all_PR115395.patch | 107 ------------------------------------
15.0.0/gentoo/README.history | 4 ++
2 files changed, 4 insertions(+), 107 deletions(-)
diff --git a/15.0.0/gentoo/78_all_PR115395.patch b/15.0.0/gentoo/78_all_PR115395.patch
deleted file mode 100644
index d98c043..0000000
--- a/15.0.0/gentoo/78_all_PR115395.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-https://gcc.gnu.org/PR115395
-
-From 4ed9c5df7efeb98e190573cca42a4fd40666c45f Mon Sep 17 00:00:00 2001
-From: Richard Biener <rguenther@suse.de>
-Date: Mon, 10 Jun 2024 10:12:52 +0200
-Subject: [PATCH] tree-optimization/115395 - wrong-code with SLP reduction in
- epilog
-
-When we continue a non-SLP reduction from the main loop in the
-epilog with a SLP reduction we currently fail to handle an
-adjustment by the initial value because that's not a thing with SLP.
-As long as we have the possibility to mix SLP and non-SLP we have
-to handle it though.
-
- PR tree-optimization/115395
- * tree-vect-loop.cc (vect_create_epilog_for_reduction):
- Handle STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT also for SLP
- reductions of group_size one.
-
- * gcc.dg/vect/pr115395.c: New testcase.
----
- gcc/testsuite/gcc.dg/vect/pr115395.c | 27 +++++++++++++++++++++++++++
- gcc/tree-vect-loop.cc | 27 ++++++++-------------------
- 2 files changed, 35 insertions(+), 19 deletions(-)
- create mode 100644 gcc/testsuite/gcc.dg/vect/pr115395.c
-
-diff --git a/gcc/testsuite/gcc.dg/vect/pr115395.c b/gcc/testsuite/gcc.dg/vect/pr115395.c
-new file mode 100644
-index 00000000000..cd1cee9f3df
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/vect/pr115395.c
-@@ -0,0 +1,27 @@
-+/* { dg-additional-options "-mavx2" { target avx2_runtime } } */
-+
-+#include "tree-vect.h"
-+
-+struct {
-+ long header_size;
-+ long start_offset;
-+ long end_offset;
-+} myrar_dbo[5] = {{0, 87, 6980}, {0, 7087, 13980}, {0, 14087, 0}};
-+
-+int i;
-+long offset;
-+
-+int main()
-+{
-+ check_vect ();
-+
-+ offset += myrar_dbo[0].start_offset;
-+ while (i < 2) {
-+ i++;
-+ offset += myrar_dbo[i].start_offset - myrar_dbo[i - 1].end_offset;
-+ }
-+ if (offset != 301)
-+ abort();
-+
-+ return 0;
-+}
-diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
-index 028692614bb..c471f1564a7 100644
---- a/gcc/tree-vect-loop.cc
-+++ b/gcc/tree-vect-loop.cc
-@@ -6030,25 +6030,14 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
-
- tree induc_val = NULL_TREE;
- tree adjustment_def = NULL;
-- if (slp_node)
-- {
-- /* Optimize: for induction condition reduction, if we can't use zero
-- for induc_val, use initial_def. */
-- if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
-- induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
-- /* ??? Coverage for 'else' isn't clear. */
-- }
-+ /* Optimize: for induction condition reduction, if we can't use zero
-+ for induc_val, use initial_def. */
-+ if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
-+ induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
-+ else if (double_reduc)
-+ ;
- else
-- {
-- /* Optimize: for induction condition reduction, if we can't use zero
-- for induc_val, use initial_def. */
-- if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
-- induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
-- else if (double_reduc)
-- ;
-- else
-- adjustment_def = STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info);
-- }
-+ adjustment_def = STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info);
-
- stmt_vec_info single_live_out_stmt[] = { stmt_info };
- array_slice<const stmt_vec_info> live_out_stmts = single_live_out_stmt;
-@@ -6873,7 +6862,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
-
- if (adjustment_def)
- {
-- gcc_assert (!slp_reduc);
-+ gcc_assert (!slp_reduc || group_size == 1);
- gimple_seq stmts = NULL;
- if (double_reduc)
- {
---
-2.43.0
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 1573b55..81ca552 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+4 ????
+
+ - 78_all_PR115395.patch
+
3 10 June 2024
+ 77_all_PR115387.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-10 20:18 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-10 20:18 UTC (permalink / raw
To: gentoo-commits
commit: c8bf41759fe849050fcb5c5105483c9db6b15da2
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 20:18:07 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 20:18:07 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c8bf4175
15.0.0: drop upstream 77_all_PR115387.patch
It got merged.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/77_all_PR115387.patch | 206 ------------------------------------
15.0.0/gentoo/README.history | 1 +
2 files changed, 1 insertion(+), 206 deletions(-)
diff --git a/15.0.0/gentoo/77_all_PR115387.patch b/15.0.0/gentoo/77_all_PR115387.patch
deleted file mode 100644
index bf143e7..0000000
--- a/15.0.0/gentoo/77_all_PR115387.patch
+++ /dev/null
@@ -1,206 +0,0 @@
-https://gcc.gnu.org/PR115387
-https://inbox.sourceware.org/gcc-patches/430da3ad-59a6-4f16-b35f-8bef724a7ed7@gmail.com/T/#t
-
-From mboxrd@z Thu Jan 1 00:00:00 1970
-Return-Path: <SRS0=SYw7=NM=intel.com=pan2.li@sourceware.org>
-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14])
- by sourceware.org (Postfix) with ESMTPS id 48A883858CDB
- for <gcc-patches@gcc.gnu.org>; Mon, 10 Jun 2024 14:49:07 +0000 (GMT)
-DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48A883858CDB
-Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com
-Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com
-ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 48A883858CDB
-Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.14
-ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718030949; cv=none;
- b=sYMAFxaXXHzkHsYoFI0HFGXWzujiQRXs1KA4PpQKerabnFz185hAazNZgv5HRn33NHy30a6CaFSGdNqMzI5rJ/uWP0t/IVSZPws+DkO9GCBPkgQLIHvRRf5J+uf7usxHf+quk0tjfzrDkHctT7riGqQjzSEAkBTwrKXd7X9aQ9k=
-ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
- t=1718030949; c=relaxed/simple;
- bh=p/hDLfesLAxds7UkloKeUvZGINWc0ydc/cnr4ptMBSU=;
- h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=GtE3ODQcVtLdsf2+edm43ZWyfgTSrruAj3RQ1zIcTMeifKot7fY59t2YIAFrSyx/vKLMuPwocIQ8p3VmYLj4DB2f8ybXvEhBcx2pxlh5GNVmPxjGtJsnrv6p7oMG9CA6X/bns8vlMhr2CgwzHRba7bItkwFWjKkI8gbJz3v9zeo=
-ARC-Authentication-Results: i=1; server2.sourceware.org
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
- d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
- t=1718030948; x=1749566948;
- h=from:to:cc:subject:date:message-id:mime-version:
- content-transfer-encoding;
- bh=p/hDLfesLAxds7UkloKeUvZGINWc0ydc/cnr4ptMBSU=;
- b=biitKQIpbkCUKRo31CQVWz5tQ3QP6AsTulnDi3LB7cDTMJflku4VDWDx
- Dnu97Pvn/2HzgfrZyN+1kVfGvLnehrErvG2qw3kZ2PGu0AiKrtnTRj0ED
- UdyWa4+MQF5nj34UK92MRcA1Ovou3O89YdQ11EmVuL1KynSTtKgwo/d/9
- JsYn3MkWZP6NjVgZteOu5xBZF+J3NxK61azjaUgP8LIxo1bmEKUMBgo0f
- p0gXtZXjZkxtpcqzr++CtB6e4fKUHQK8z/FjOzaHvwIzmxdoEcptRGtl9
- v+2kXKMcvMQGZZlsBfFIewmNKjK6qUYGrDKl1wltMZMkeijuudmObyhaq
- A==;
-X-CSE-ConnectionGUID: JaJ1NR5jSimBRrZvjuM+Lw==
-X-CSE-MsgGUID: Q6rSZfGaQfOHvXT9LPs02g==
-X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="18526139"
-X-IronPort-AV: E=Sophos;i="6.08,227,1712646000";
- d="scan'208";a="18526139"
-Received: from orviesa002.jf.intel.com ([10.64.159.142])
- by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 07:49:07 -0700
-X-CSE-ConnectionGUID: +SJ6B8QPQfWwhjgjPJujEw==
-X-CSE-MsgGUID: eHhYmO22SKyPWaJe7LW77Q==
-X-ExtLoop1: 1
-X-IronPort-AV: E=Sophos;i="6.08,227,1712646000";
- d="scan'208";a="69872329"
-Received: from shvmail03.sh.intel.com ([10.239.245.20])
- by orviesa002.jf.intel.com with ESMTP; 10 Jun 2024 07:49:04 -0700
-Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47])
- by shvmail03.sh.intel.com (Postfix) with ESMTP id E43A71007C1D;
- Mon, 10 Jun 2024 22:49:02 +0800 (CST)
-From: pan2.li@intel.com
-To: gcc-patches@gcc.gnu.org
-Cc: juzhe.zhong@rivai.ai,
- kito.cheng@gmail.com,
- richard.guenther@gmail.com,
- Pan Li <pan2.li@intel.com>
-Subject: [PATCH v1] Widening-Mul: Fix one ICE of gcall insertion for PHI match
-Date: Mon, 10 Jun 2024 22:49:01 +0800
-Message-Id: <20240610144901.3723532-1-pan2.li@intel.com>
-X-Mailer: git-send-email 2.34.1
-MIME-Version: 1.0
-Content-Transfer-Encoding: 8bit
-X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
-X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org
-List-Id: <gcc-patches.gcc.gnu.org>
-
-From: Pan Li <pan2.li@intel.com>
-
-When enabled the PHI handing for COND_EXPR, we need to insert the gcall
-to replace the PHI node. Unfortunately, I made a mistake that insert
-the gcall to before the last stmt of the bb. See below gimple, the PHI
-is located at no.1 but we insert the gcall (aka no.9) to the end of
-the bb. Then the use of _9 in no.2 will have no def and will trigger
-ICE when verify_ssa.
-
- 1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
- 2. prephitmp_36 = (char *) _9;
- 3. buf.write_base = string_13(D);
- 4. buf.write_ptr = string_13(D);
- 5. buf.write_end = prephitmp_36;
- 6. buf.written = 0;
- 7. buf.mode = 3;
- 8. _7 = buf.write_end;
- 9. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to last bb by mistake
-
-This patch would like to insert the gcall to before the start of the bb
-stmt. To ensure the possible use of PHI_result will have a def exists.
-After this patch the above gimple will be:
-
- 0. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to start bb by mistake
- 1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
- 2. prephitmp_36 = (char *) _9;
- 3. buf.write_base = string_13(D);
- 4. buf.write_ptr = string_13(D);
- 5. buf.write_end = prephitmp_36;
- 6. buf.written = 0;
- 7. buf.mode = 3;
- 8. _7 = buf.write_end;
-
-The below test suites are passed for this patch:
-* The rv64gcv fully regression test with newlib.
-* The rv64gcv build with glibc.
-* The x86 regression test with newlib.
-* The x86 bootstrap test with newlib.
-
- PR target/115387
-
-gcc/ChangeLog:
-
- * tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children): Take
- the gsi of start_bb instead of last_bb.
-
-gcc/testsuite/ChangeLog:
-
- * gcc.target/riscv/pr115387-1.c: New test.
- * gcc.target/riscv/pr115387-2.c: New test.
-
-Signed-off-by: Pan Li <pan2.li@intel.com>
----
- gcc/testsuite/gcc.target/riscv/pr115387-1.c | 35 +++++++++++++++++++++
- gcc/testsuite/gcc.target/riscv/pr115387-2.c | 18 +++++++++++
- gcc/tree-ssa-math-opts.cc | 2 +-
- 3 files changed, 54 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/gcc.target/riscv/pr115387-1.c
- create mode 100644 gcc/testsuite/gcc.target/riscv/pr115387-2.c
-
-diff --git a/gcc/testsuite/gcc.target/riscv/pr115387-1.c b/gcc/testsuite/gcc.target/riscv/pr115387-1.c
-new file mode 100644
-index 00000000000..a1c926977c4
---- /dev/null
-+++ b/gcc/testsuite/gcc.target/riscv/pr115387-1.c
-@@ -0,0 +1,35 @@
-+/* Test there is no ICE when compile. */
-+/* { dg-do compile } */
-+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
-+
-+#define PRINTF_CHK 0x34
-+
-+typedef unsigned long uintptr_t;
-+
-+struct __printf_buffer {
-+ char *write_ptr;
-+ int status;
-+};
-+
-+extern void __printf_buffer_init_end (struct __printf_buffer *, char *, char *);
-+
-+void
-+test (char *string, unsigned long maxlen, unsigned mode_flags)
-+{
-+ struct __printf_buffer buf;
-+
-+ if ((mode_flags & PRINTF_CHK) != 0)
-+ {
-+ string[0] = '\0';
-+ uintptr_t end;
-+
-+ if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
-+ end = -1;
-+
-+ __printf_buffer_init_end (&buf, string, (char *) end);
-+ }
-+ else
-+ __printf_buffer_init_end (&buf, string, (char *) ~(uintptr_t) 0);
-+
-+ *buf.write_ptr = '\0';
-+}
-diff --git a/gcc/testsuite/gcc.target/riscv/pr115387-2.c b/gcc/testsuite/gcc.target/riscv/pr115387-2.c
-new file mode 100644
-index 00000000000..7183bf18dfd
---- /dev/null
-+++ b/gcc/testsuite/gcc.target/riscv/pr115387-2.c
-@@ -0,0 +1,18 @@
-+/* Test there is no ICE when compile. */
-+/* { dg-do compile } */
-+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
-+
-+#include <stddef.h>
-+#include <stdint-gcc.h>
-+
-+char *
-+test (char *string, size_t maxlen)
-+{
-+ string[0] = '\0';
-+ uintptr_t end;
-+
-+ if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
-+ end = -1;
-+
-+ return (char *) end;
-+}
-diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
-index 173b0366f5e..fbb8e0ea306 100644
---- a/gcc/tree-ssa-math-opts.cc
-+++ b/gcc/tree-ssa-math-opts.cc
-@@ -6102,7 +6102,7 @@ math_opts_dom_walker::after_dom_children (basic_block bb)
- for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
- gsi_next (&psi))
- {
-- gimple_stmt_iterator gsi = gsi_last_bb (bb);
-+ gimple_stmt_iterator gsi = gsi_start_bb (bb);
- match_unsigned_saturation_add (&gsi, psi.phi ());
- }
-
---
-2.34.1
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 81ca552..6c43a46 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,5 +1,6 @@
4 ????
+ - 77_all_PR115387.patch
- 78_all_PR115395.patch
3 10 June 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-16 22:45 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-16 22:45 UTC (permalink / raw
To: gentoo-commits
commit: 9b921e3a315f6c478a72c39a444ed694438fdcb2
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 16 22:45:05 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 16 22:45:05 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9b921e3a
15.0.0: cut patchset 4
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 6c43a46..efe48af 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-4 ????
+4 16 June 2024
- 77_all_PR115387.patch
- 78_all_PR115395.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-26 23:57 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-26 23:57 UTC (permalink / raw
To: gentoo-commits
commit: e35c53788a928179ef26b76833bcbe297f84fe6a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 26 23:57:28 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 23:57:52 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e35c5378
15.0.0: workaround recent x86 changes
Bug: https://gcc.gnu.org/PR115635
Bug: https://gcc.gnu.org/PR115661
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gentoo/77_all_i386-fix-ix86_expand_move.patch | 45 ++++++++++
.../78_all_i386-fix-recent-alias-set-change.patch | 95 ++++++++++++++++++++++
2 files changed, 140 insertions(+)
diff --git a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
new file mode 100644
index 0000000..4b42ea9
--- /dev/null
+++ b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
@@ -0,0 +1,45 @@
+From ec0ead755e65ba51813aa8b66f4eb5574dd8437c Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 26 Jun 2024 13:19:42 +0100
+Subject: [PATCH 1/2] i386: fix ix86_expand_move
+
+Before r15-1599-g63512c72df09b4, legitimize_pe_coff_symbol would return NULL_RTX
+for non-PECOFF targets, so the else branch would get taken.
+
+(This is a hack which doesn't work for PECOFF targets but fixes miscompilations
+on ELF.)
+
+Bug: https://gcc.gnu.org/PR115635
+Bug: https://gcc.gnu.org/PR115661
+---
+ gcc/config/i386/i386-expand.cc | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
+index 5dfa7d49f58c..5e0173bc7a84 100644
+--- a/gcc/config/i386/i386-expand.cc
++++ b/gcc/config/i386/i386-expand.cc
+@@ -412,20 +412,10 @@ ix86_expand_move (machine_mode mode, rtx operands[])
+ }
+ else
+ {
+-#if TARGET_PECOFF
+- tmp = legitimize_pe_coff_symbol (op1, addend != NULL_RTX);
+- if (tmp)
+- {
+- op1 = tmp;
+- if (!addend)
+- break;
+- }
+- else
+ {
+ op1 = operands[1];
+ break;
+ }
+-#endif
+ }
+
+ if (addend)
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
new file mode 100644
index 0000000..6776fdd
--- /dev/null
+++ b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
@@ -0,0 +1,95 @@
+From 72a4d2d437782afa975f9b29c3ab4a1826ad0cd6 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 26 Jun 2024 12:54:55 +0100
+Subject: [PATCH 2/2] i386: fix recent alias set change
+
+Before r15-1599-g63512c72df09b4, we would create a new alias set, but now
+we use -1. Go back to using ix86_GOT_alias_set.
+
+(This is a hack which isn't the cleanest way of fixing it.)
+
+Bug: https://gcc.gnu.org/PR115635
+Bug: https://gcc.gnu.org/PR115661
+---
+ gcc/config/i386/i386-expand.cc | 2 +-
+ gcc/config/i386/i386-expand.h | 1 +
+ gcc/config/i386/i386.cc | 17 ++++++++++++++---
+ 3 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
+index 5e0173bc7a84..3345f40ad85d 100644
+--- a/gcc/config/i386/i386-expand.cc
++++ b/gcc/config/i386/i386-expand.cc
+@@ -408,7 +408,7 @@ ix86_expand_move (machine_mode mode, rtx operands[])
+ : UNSPEC_GOT));
+ op1 = gen_rtx_CONST (Pmode, op1);
+ op1 = gen_const_mem (Pmode, op1);
+- set_mem_alias_set (op1, GOT_ALIAS_SET);
++ set_mem_alias_set (op1, ix86_GOT_alias_set ());
+ }
+ else
+ {
+diff --git a/gcc/config/i386/i386-expand.h b/gcc/config/i386/i386-expand.h
+index 5e02df1706df..56bee29253ba 100644
+--- a/gcc/config/i386/i386-expand.h
++++ b/gcc/config/i386/i386-expand.h
+@@ -34,6 +34,7 @@ struct expand_vec_perm_d
+ };
+
+ rtx legitimize_tls_address (rtx x, enum tls_model model, bool for_mov);
++alias_set_type ix86_GOT_alias_set (void);
+ rtx legitimize_pic_address (rtx orig, rtx reg);
+
+ bool insn_defines_reg (unsigned int regno1, unsigned int regno2,
+diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
+index 1f71ed04be67..62fca080f2f5 100644
+--- a/gcc/config/i386/i386.cc
++++ b/gcc/config/i386/i386.cc
+@@ -11823,6 +11823,17 @@ constant_address_p (rtx x)
+ }
+ \f
+
++/* Return a unique alias set for the GOT. */
++
++alias_set_type
++ix86_GOT_alias_set (void)
++{
++ static alias_set_type set = -1;
++ if (set == -1)
++ set = new_alias_set ();
++ return set;
++}
++
+ /* Return a legitimate reference for ORIG (an address) using the
+ register REG. If REG is 0, a new pseudo is generated.
+
+@@ -11925,7 +11936,7 @@ legitimize_pic_address (rtx orig, rtx reg)
+ UNSPEC_GOTPCREL);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ new_rtx = gen_const_mem (Pmode, new_rtx);
+- set_mem_alias_set (new_rtx, GOT_ALIAS_SET);
++ set_mem_alias_set (new_rtx, ix86_GOT_alias_set ());
+ }
+ else
+ {
+@@ -11947,7 +11958,7 @@ legitimize_pic_address (rtx orig, rtx reg)
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx);
+
+ new_rtx = gen_const_mem (Pmode, new_rtx);
+- set_mem_alias_set (new_rtx, GOT_ALIAS_SET);
++ set_mem_alias_set (new_rtx, ix86_GOT_alias_set ());
+ }
+
+ new_rtx = copy_to_suggested_reg (new_rtx, reg, Pmode);
+@@ -12324,7 +12335,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
+ if (pic)
+ off = gen_rtx_PLUS (tp_mode, pic, off);
+ off = gen_const_mem (tp_mode, off);
+- set_mem_alias_set (off, GOT_ALIAS_SET);
++ set_mem_alias_set (off, ix86_GOT_alias_set ());
+
+ if (TARGET_64BIT || TARGET_ANY_GNU_TLS)
+ {
+--
+2.45.2
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-27 0:02 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-27 0:02 UTC (permalink / raw
To: gentoo-commits
commit: 7760ff0bf2fd5fa05385fc11158cb7efd7a05cc5
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 27 00:02:16 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 27 00:02:16 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7760ff0b
15.0.0: add revert annotation
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch | 2 ++
15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch | 2 ++
2 files changed, 4 insertions(+)
diff --git a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
index 4b42ea9..2b5b8d4 100644
--- a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
+++ b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
@@ -9,6 +9,8 @@ for non-PECOFF targets, so the else branch would get taken.
(This is a hack which doesn't work for PECOFF targets but fixes miscompilations
on ELF.)
+This partially reverts commit r15-1599-g63512c72df09b4.
+
Bug: https://gcc.gnu.org/PR115635
Bug: https://gcc.gnu.org/PR115661
---
diff --git a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
index 6776fdd..eb8f5bd 100644
--- a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
+++ b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
@@ -8,6 +8,8 @@ we use -1. Go back to using ix86_GOT_alias_set.
(This is a hack which isn't the cleanest way of fixing it.)
+This partially reverts commit r15-1599-g63512c72df09b4.
+
Bug: https://gcc.gnu.org/PR115635
Bug: https://gcc.gnu.org/PR115661
---
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-28 12:49 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-06-28 12:49 UTC (permalink / raw
To: gentoo-commits
commit: b97a75814a0b8969a5669c761dde86dc0d9ee2a1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 28 12:49:23 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 28 12:49:23 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b97a7581
15.0.0: drop x86 backend fixes
Now fixed upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gentoo/77_all_i386-fix-ix86_expand_move.patch | 47 -----------
.../78_all_i386-fix-recent-alias-set-change.patch | 97 ----------------------
2 files changed, 144 deletions(-)
diff --git a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
deleted file mode 100644
index 2b5b8d4..0000000
--- a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From ec0ead755e65ba51813aa8b66f4eb5574dd8437c Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Wed, 26 Jun 2024 13:19:42 +0100
-Subject: [PATCH 1/2] i386: fix ix86_expand_move
-
-Before r15-1599-g63512c72df09b4, legitimize_pe_coff_symbol would return NULL_RTX
-for non-PECOFF targets, so the else branch would get taken.
-
-(This is a hack which doesn't work for PECOFF targets but fixes miscompilations
-on ELF.)
-
-This partially reverts commit r15-1599-g63512c72df09b4.
-
-Bug: https://gcc.gnu.org/PR115635
-Bug: https://gcc.gnu.org/PR115661
----
- gcc/config/i386/i386-expand.cc | 10 ----------
- 1 file changed, 10 deletions(-)
-
-diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
-index 5dfa7d49f58c..5e0173bc7a84 100644
---- a/gcc/config/i386/i386-expand.cc
-+++ b/gcc/config/i386/i386-expand.cc
-@@ -412,20 +412,10 @@ ix86_expand_move (machine_mode mode, rtx operands[])
- }
- else
- {
--#if TARGET_PECOFF
-- tmp = legitimize_pe_coff_symbol (op1, addend != NULL_RTX);
-- if (tmp)
-- {
-- op1 = tmp;
-- if (!addend)
-- break;
-- }
-- else
- {
- op1 = operands[1];
- break;
- }
--#endif
- }
-
- if (addend)
---
-2.45.2
-
diff --git a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
deleted file mode 100644
index eb8f5bd..0000000
--- a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 72a4d2d437782afa975f9b29c3ab4a1826ad0cd6 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Wed, 26 Jun 2024 12:54:55 +0100
-Subject: [PATCH 2/2] i386: fix recent alias set change
-
-Before r15-1599-g63512c72df09b4, we would create a new alias set, but now
-we use -1. Go back to using ix86_GOT_alias_set.
-
-(This is a hack which isn't the cleanest way of fixing it.)
-
-This partially reverts commit r15-1599-g63512c72df09b4.
-
-Bug: https://gcc.gnu.org/PR115635
-Bug: https://gcc.gnu.org/PR115661
----
- gcc/config/i386/i386-expand.cc | 2 +-
- gcc/config/i386/i386-expand.h | 1 +
- gcc/config/i386/i386.cc | 17 ++++++++++++++---
- 3 files changed, 16 insertions(+), 4 deletions(-)
-
-diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
-index 5e0173bc7a84..3345f40ad85d 100644
---- a/gcc/config/i386/i386-expand.cc
-+++ b/gcc/config/i386/i386-expand.cc
-@@ -408,7 +408,7 @@ ix86_expand_move (machine_mode mode, rtx operands[])
- : UNSPEC_GOT));
- op1 = gen_rtx_CONST (Pmode, op1);
- op1 = gen_const_mem (Pmode, op1);
-- set_mem_alias_set (op1, GOT_ALIAS_SET);
-+ set_mem_alias_set (op1, ix86_GOT_alias_set ());
- }
- else
- {
-diff --git a/gcc/config/i386/i386-expand.h b/gcc/config/i386/i386-expand.h
-index 5e02df1706df..56bee29253ba 100644
---- a/gcc/config/i386/i386-expand.h
-+++ b/gcc/config/i386/i386-expand.h
-@@ -34,6 +34,7 @@ struct expand_vec_perm_d
- };
-
- rtx legitimize_tls_address (rtx x, enum tls_model model, bool for_mov);
-+alias_set_type ix86_GOT_alias_set (void);
- rtx legitimize_pic_address (rtx orig, rtx reg);
-
- bool insn_defines_reg (unsigned int regno1, unsigned int regno2,
-diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
-index 1f71ed04be67..62fca080f2f5 100644
---- a/gcc/config/i386/i386.cc
-+++ b/gcc/config/i386/i386.cc
-@@ -11823,6 +11823,17 @@ constant_address_p (rtx x)
- }
- \f
-
-+/* Return a unique alias set for the GOT. */
-+
-+alias_set_type
-+ix86_GOT_alias_set (void)
-+{
-+ static alias_set_type set = -1;
-+ if (set == -1)
-+ set = new_alias_set ();
-+ return set;
-+}
-+
- /* Return a legitimate reference for ORIG (an address) using the
- register REG. If REG is 0, a new pseudo is generated.
-
-@@ -11925,7 +11936,7 @@ legitimize_pic_address (rtx orig, rtx reg)
- UNSPEC_GOTPCREL);
- new_rtx = gen_rtx_CONST (Pmode, new_rtx);
- new_rtx = gen_const_mem (Pmode, new_rtx);
-- set_mem_alias_set (new_rtx, GOT_ALIAS_SET);
-+ set_mem_alias_set (new_rtx, ix86_GOT_alias_set ());
- }
- else
- {
-@@ -11947,7 +11958,7 @@ legitimize_pic_address (rtx orig, rtx reg)
- new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx);
-
- new_rtx = gen_const_mem (Pmode, new_rtx);
-- set_mem_alias_set (new_rtx, GOT_ALIAS_SET);
-+ set_mem_alias_set (new_rtx, ix86_GOT_alias_set ());
- }
-
- new_rtx = copy_to_suggested_reg (new_rtx, reg, Pmode);
-@@ -12324,7 +12335,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
- if (pic)
- off = gen_rtx_PLUS (tp_mode, pic, off);
- off = gen_const_mem (tp_mode, off);
-- set_mem_alias_set (off, GOT_ALIAS_SET);
-+ set_mem_alias_set (off, ix86_GOT_alias_set ());
-
- if (TARGET_64BIT || TARGET_ANY_GNU_TLS)
- {
---
-2.45.2
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-14 23:36 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-07-14 23:36 UTC (permalink / raw
To: gentoo-commits
commit: f3f27691478a0b256a3b52348bae96f5a6b5f089
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 14 23:35:47 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 14 23:35:47 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=f3f27691
15.0.0: don't enable -fext-dce with -O2
Bug: https://gcc.gnu.org/PR115876
Bug: https://gcc.gnu.org/PR115877
Bug: https://gcc.gnu.org/PR115912
Bug: https://gcc.gnu.org/PR115916
Bug: https://gcc.gnu.org/PR115927
Signed-off-by: Sam James <sam <AT> gentoo.org>
...gcc_don-t-enable-fext-dce-with-O2-for-now.patch | 34 ++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +++
2 files changed, 38 insertions(+)
diff --git a/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch b/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
new file mode 100644
index 0000000..82c5535
--- /dev/null
+++ b/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
@@ -0,0 +1,34 @@
+From 86de2fd7550f75a318aa9819b115487cd850b4fc Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 15 Jul 2024 00:32:18 +0100
+Subject: [PATCH] gcc: don't enable -fext-dce with -O2 for now
+
+There's too many bugs involving it for now.
+
+ gcc/
+ * opts.cc (default_options_table): Don't enable ext-dce at -O2
+
+Bug: https://gcc.gnu.org/PR115876
+Bug: https://gcc.gnu.org/PR115877
+Bug: https://gcc.gnu.org/PR115912
+Bug: https://gcc.gnu.org/PR115916
+Bug: https://gcc.gnu.org/PR115927
+---
+ gcc/opts.cc | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/gcc/opts.cc b/gcc/opts.cc
+index be90a632338f..e1a1bdf15822 100644
+--- a/gcc/opts.cc
++++ b/gcc/opts.cc
+@@ -634,7 +634,6 @@ static const struct default_options default_options_table[] =
+ { OPT_LEVELS_2_PLUS, OPT_fdevirtualize, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fdevirtualize_speculatively, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fexpensive_optimizations, NULL, 1 },
+- { OPT_LEVELS_2_PLUS, OPT_fext_dce, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fgcse, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_findirect_inlining, NULL, 1 },
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index efe48af..eddda8f 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+5 15 July 2024
+
+ + 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
+
4 16 June 2024
- 77_all_PR115387.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-18 0:45 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-07-18 0:45 UTC (permalink / raw
To: gentoo-commits
commit: 3caa1b3eb3879d24c604ffa282b1c4b2c17fc391
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 18 00:44:35 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul 18 00:44:35 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3caa1b3e
15.0.0: update power7 .feature patch
Switch to Peter's version. Can update older branches once it's merged.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../76_all_ppc_PR97367-power7-cell-altivec.patch | 102 ++++++++++++++++++++-
1 file changed, 99 insertions(+), 3 deletions(-)
diff --git a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
index 154dd0f..d4ca6c2 100644
--- a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
+++ b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
@@ -1,13 +1,109 @@
https://gcc.gnu.org/PR97367
-https://inbox.sourceware.org/gcc-patches/20240308.123342.1112119677226246836.rene@exactcode.de/
+https://inbox.sourceware.org/gcc-patches/5f2b5d5e-a682-4084-b70e-89929f4cc6dc@bergner.org/T/#u
+
+From git@z Thu Jan 1 00:00:00 1970
+Subject: [PATCH v2] rs6000: Fix .machine cpu selection w/ altivec [PR97367]
+From: Peter Bergner <pshop@bergner.org>
+Date: Fri, 12 Jul 2024 16:48:29 -0500
+Message-Id: <5f2b5d5e-a682-4084-b70e-89929f4cc6dc@bergner.org>
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+René's patch seems to have stalled, so here is an updated version of the
+patch with the requested changes to his patch.
+
+I'll note I have added an additional code change, which is to also emit a
+".machine altivec" if Altivec is enabled. The problem this fixes is for
+cpus like the G5, which is basically a power4 plus an Altivec unit, its
+".machine power4" doesn't enable the assembler to recognize Altivec insns.
+That isn't a problem if you use gcc -mcpu=G5 to assemble the assembler file,
+since gcc passes -maltivec to the assembler. However, if you try to assemble
+the assembler file with as by hand, you'll get "unrecognized opcode" errors.
+I did not do the same for VSX, since all ".machine <cpu>" for cpus that
+support VSX already enable VSX insn recognition, so it's not needed.
+
+
+rs6000: Fix .machine cpu selection w/ altivec [PR97367]
+
+There are various non-IBM CPUs with altivec, so we cannot use that
+flag to determine which .machine cpu to use, so ignore it.
+Emit an additional ".machine altivec" if Altivec is enabled so
+that the assembler doesn't require an explicit -maltivec option
+to assemble any Altivec instructions for those targets where
+the ".machine cpu" is insufficient to enable Altivec. For example,
+-mcpu=G5 emits a ".machine power4".
+
+This passed bootstrap and regtesting on powrpc64-linux (running the testsuite
+in both 32-bit and 64-bit modes) with no regressions.
+
+Ok for trunk and the release branches after some trunk burn-in time?
+
+Peter
+
+
+2024-07-12 René Rebe <rene@exactcode.de>
+ Peter Bergner <bergner@linux.ibm.com>
+
+gcc/
+ PR target/97367
+ * config/rs6000/rs6000.c (rs6000_machine_from_flags): Do not consider
+ OPTION_MASK_ALTIVEC.
+ (emit_asm_machine): For Altivec compiles, emit a ".machine altivec".
+
+gcc/testsuite/
+ PR target/97367
+ * gcc.target/powerpc/pr97367.c: New test.
+
+Signed-of-by: René Rebe <rene@exactcode.de>
+---
+ gcc/config/rs6000/rs6000.cc | 5 ++++-
+ gcc/testsuite/gcc.target/powerpc/pr97367.c | 13 +++++++++++++
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/gcc.target/powerpc/pr97367.c
+
+diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
+index 2cbea6ea2d7..2cb8f35739b 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
-@@ -5869,7 +5869,7 @@ rs6000_machine_from_flags (void)
+@@ -5888,7 +5888,8 @@ rs6000_machine_from_flags (void)
HOST_WIDE_INT flags = rs6000_isa_flags;
/* Disable the flags that should never influence the .machine selection. */
- flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL);
-+ flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ALTIVEC | OPTION_MASK_ISEL);
++ flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL
++ | OPTION_MASK_ALTIVEC);
if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
return "power10";
+@@ -5913,6 +5914,8 @@ void
+ emit_asm_machine (void)
+ {
+ fprintf (asm_out_file, "\t.machine %s\n", rs6000_machine);
++ if (TARGET_ALTIVEC)
++ fprintf (asm_out_file, "\t.machine altivec\n");
+ }
+ #endif
+
+diff --git a/gcc/testsuite/gcc.target/powerpc/pr97367.c b/gcc/testsuite/gcc.target/powerpc/pr97367.c
+new file mode 100644
+index 00000000000..f9118dbcdec
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/powerpc/pr97367.c
+@@ -0,0 +1,13 @@
++/* PR target/97367 */
++/* { dg-options "-mdejagnu-cpu=G5" } */
++
++/* Verify we emit a ".machine power4" and ".machine altivec" rather
++ than a ".machine power7". */
++
++int dummy (void)
++{
++ return 0;
++}
++
++/* { dg-final { scan-assembler {\.\mmachine power4\M} } } */
++/* { dg-final { scan-assembler {\.\mmachine altivec\M} } } */
+--
+2.45.2
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-19 11:14 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-07-19 11:14 UTC (permalink / raw
To: gentoo-commits
commit: 3147d1f67ddd03e579d1ff19aea8b9cfeb490564
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 19 11:14:06 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 19 11:14:06 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3147d1f6
15.0.0: drop upstream power7 patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../76_all_ppc_PR97367-power7-cell-altivec.patch | 109 ---------------------
15.0.0/gentoo/README.history | 4 +
2 files changed, 4 insertions(+), 109 deletions(-)
diff --git a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
deleted file mode 100644
index d4ca6c2..0000000
--- a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-https://gcc.gnu.org/PR97367
-https://inbox.sourceware.org/gcc-patches/5f2b5d5e-a682-4084-b70e-89929f4cc6dc@bergner.org/T/#u
-
-From git@z Thu Jan 1 00:00:00 1970
-Subject: [PATCH v2] rs6000: Fix .machine cpu selection w/ altivec [PR97367]
-From: Peter Bergner <pshop@bergner.org>
-Date: Fri, 12 Jul 2024 16:48:29 -0500
-Message-Id: <5f2b5d5e-a682-4084-b70e-89929f4cc6dc@bergner.org>
-MIME-Version: 1.0
-Content-Type: text/plain; charset="utf-8"
-Content-Transfer-Encoding: 8bit
-
-René's patch seems to have stalled, so here is an updated version of the
-patch with the requested changes to his patch.
-
-I'll note I have added an additional code change, which is to also emit a
-".machine altivec" if Altivec is enabled. The problem this fixes is for
-cpus like the G5, which is basically a power4 plus an Altivec unit, its
-".machine power4" doesn't enable the assembler to recognize Altivec insns.
-That isn't a problem if you use gcc -mcpu=G5 to assemble the assembler file,
-since gcc passes -maltivec to the assembler. However, if you try to assemble
-the assembler file with as by hand, you'll get "unrecognized opcode" errors.
-I did not do the same for VSX, since all ".machine <cpu>" for cpus that
-support VSX already enable VSX insn recognition, so it's not needed.
-
-
-rs6000: Fix .machine cpu selection w/ altivec [PR97367]
-
-There are various non-IBM CPUs with altivec, so we cannot use that
-flag to determine which .machine cpu to use, so ignore it.
-Emit an additional ".machine altivec" if Altivec is enabled so
-that the assembler doesn't require an explicit -maltivec option
-to assemble any Altivec instructions for those targets where
-the ".machine cpu" is insufficient to enable Altivec. For example,
--mcpu=G5 emits a ".machine power4".
-
-This passed bootstrap and regtesting on powrpc64-linux (running the testsuite
-in both 32-bit and 64-bit modes) with no regressions.
-
-Ok for trunk and the release branches after some trunk burn-in time?
-
-Peter
-
-
-2024-07-12 René Rebe <rene@exactcode.de>
- Peter Bergner <bergner@linux.ibm.com>
-
-gcc/
- PR target/97367
- * config/rs6000/rs6000.c (rs6000_machine_from_flags): Do not consider
- OPTION_MASK_ALTIVEC.
- (emit_asm_machine): For Altivec compiles, emit a ".machine altivec".
-
-gcc/testsuite/
- PR target/97367
- * gcc.target/powerpc/pr97367.c: New test.
-
-Signed-of-by: René Rebe <rene@exactcode.de>
----
- gcc/config/rs6000/rs6000.cc | 5 ++++-
- gcc/testsuite/gcc.target/powerpc/pr97367.c | 13 +++++++++++++
- 2 files changed, 17 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/gcc.target/powerpc/pr97367.c
-
-diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
-index 2cbea6ea2d7..2cb8f35739b 100644
---- a/gcc/config/rs6000/rs6000.cc
-+++ b/gcc/config/rs6000/rs6000.cc
-@@ -5888,7 +5888,8 @@ rs6000_machine_from_flags (void)
- HOST_WIDE_INT flags = rs6000_isa_flags;
-
- /* Disable the flags that should never influence the .machine selection. */
-- flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL);
-+ flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL
-+ | OPTION_MASK_ALTIVEC);
-
- if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
- return "power10";
-@@ -5913,6 +5914,8 @@ void
- emit_asm_machine (void)
- {
- fprintf (asm_out_file, "\t.machine %s\n", rs6000_machine);
-+ if (TARGET_ALTIVEC)
-+ fprintf (asm_out_file, "\t.machine altivec\n");
- }
- #endif
-
-diff --git a/gcc/testsuite/gcc.target/powerpc/pr97367.c b/gcc/testsuite/gcc.target/powerpc/pr97367.c
-new file mode 100644
-index 00000000000..f9118dbcdec
---- /dev/null
-+++ b/gcc/testsuite/gcc.target/powerpc/pr97367.c
-@@ -0,0 +1,13 @@
-+/* PR target/97367 */
-+/* { dg-options "-mdejagnu-cpu=G5" } */
-+
-+/* Verify we emit a ".machine power4" and ".machine altivec" rather
-+ than a ".machine power7". */
-+
-+int dummy (void)
-+{
-+ return 0;
-+}
-+
-+/* { dg-final { scan-assembler {\.\mmachine power4\M} } } */
-+/* { dg-final { scan-assembler {\.\mmachine altivec\M} } } */
---
-2.45.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index eddda8f..e7d8bf0 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+6 ?? ???? ????
+
+ - 76_all_ppc_PR97367-power7-cell-altivec.patch
+
5 15 July 2024
+ 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-22 1:11 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-07-22 1:11 UTC (permalink / raw
To: gentoo-commits
commit: 7203178939395f9d01a60a68073ec175ed0236c8
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 22 01:11:43 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 22 01:11:43 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=72031789
15.0.0: cut patchset 6
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index e7d8bf0..81978cb 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-6 ?? ???? ????
+6 22 July 2024
- 76_all_ppc_PR97367-power7-cell-altivec.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-28 23:34 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-07-28 23:34 UTC (permalink / raw
To: gentoo-commits
commit: 4145ebad1e8382c5ec5ca26dadf21437aa37d172
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 28 23:34:10 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 28 23:34:10 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4145ebad
15.0.0: add 79_all_PR116120-revert-match-pattern.patch
Bug: https://gcc.gnu.org/PR116120
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../79_all_PR116120-revert-match-pattern.patch | 199 +++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +
2 files changed, 203 insertions(+)
diff --git a/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch b/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch
new file mode 100644
index 0000000..6d5b542
--- /dev/null
+++ b/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch
@@ -0,0 +1,199 @@
+From fd07aecb306c682e1d7255fc01c6c02f3ca4f6f8 Mon Sep 17 00:00:00 2001
+Message-ID: <fd07aecb306c682e1d7255fc01c6c02f3ca4f6f8.1722209590.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Mon, 29 Jul 2024 00:32:52 +0100
+Subject: [PATCH] Revert "MATCH: Simplify (a ? x : y) eq/ne (b ? x : y)
+ [PR111150]"
+
+This reverts commit 44fcc1ca11e7ea35dc9fb25a5317346bc1eaf7b2.
+
+Avoid a reported & debugged miscompilation until it gets fixed.
+
+Bug: https://gcc.gnu.org/PR116120
+---
+ gcc/match.pd | 15 -----
+ gcc/testsuite/g++.dg/tree-ssa/pr111150.C | 34 ----------
+ gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c | 72 ----------------------
+ gcc/testsuite/gcc.dg/tree-ssa/pr111150.c | 22 -------
+ 4 files changed, 143 deletions(-)
+ delete mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr111150.C
+ delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
+ delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
+
+diff --git a/gcc/match.pd b/gcc/match.pd
+index 1c8601229e3d..b8d0ebee08db 100644
+--- a/gcc/match.pd
++++ b/gcc/match.pd
+@@ -5632,21 +5632,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
+ (vec_cond (bit_and (bit_not @0) @1) @2 @3)))
+ #endif
+
+-/* (a ? x : y) != (b ? x : y) --> (a^b) ? TRUE : FALSE */
+-/* (a ? x : y) == (b ? x : y) --> (a^b) ? FALSE : TRUE */
+-/* (a ? x : y) != (b ? y : x) --> (a^b) ? FALSE : TRUE */
+-/* (a ? x : y) == (b ? y : x) --> (a^b) ? TRUE : FALSE */
+-(for cnd (cond vec_cond)
+- (for eqne (eq ne)
+- (simplify
+- (eqne:c (cnd @0 @1 @2) (cnd @3 @1 @2))
+- (cnd (bit_xor @0 @3) { constant_boolean_node (eqne == NE_EXPR, type); }
+- { constant_boolean_node (eqne != NE_EXPR, type); }))
+- (simplify
+- (eqne:c (cnd @0 @1 @2) (cnd @3 @2 @1))
+- (cnd (bit_xor @0 @3) { constant_boolean_node (eqne != NE_EXPR, type); }
+- { constant_boolean_node (eqne == NE_EXPR, type); }))))
+-
+ /* Canonicalize mask ? { 0, ... } : { -1, ...} to ~mask if the mask
+ types are compatible. */
+ (simplify
+diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr111150.C b/gcc/testsuite/g++.dg/tree-ssa/pr111150.C
+deleted file mode 100644
+index ac5d3ef15d83..000000000000
+--- a/gcc/testsuite/g++.dg/tree-ssa/pr111150.C
++++ /dev/null
+@@ -1,34 +0,0 @@
+-/* PR tree-optimization/111150 */
+-/* { dg-do compile } */
+-/* { dg-options "-O1 -fdump-tree-forwprop1 -Wno-psabi" } */
+-
+-typedef int v4si __attribute((__vector_size__(4 * sizeof(int))));
+-
+-/* Before the patch, VEC_COND_EXPR was generated for each statement in the
+- function. This resulted in 3 VEC_COND_EXPR. */
+-v4si f1_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
+- v4si X = a == b ? e : f;
+- v4si Y = c == d ? e : f;
+- return (X != Y);
+-}
+-
+-v4si f2_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
+- v4si X = a == b ? e : f;
+- v4si Y = c == d ? e : f;
+- return (X == Y);
+-}
+-
+-v4si f3_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
+- v4si X = a == b ? e : f;
+- v4si Y = c == d ? f : e;
+- return (X != Y);
+-}
+-
+-v4si f4_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
+- v4si X = a == b ? e : f;
+- v4si Y = c == d ? f : e;
+- return (X == Y);
+-}
+-
+-/* For each testcase, should produce only one VEC_COND_EXPR for X^Y. */
+-/* { dg-final { scan-tree-dump-times " VEC_COND_EXPR " 4 "forwprop1" } } */
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
+deleted file mode 100644
+index 6f4b21ac6bcb..000000000000
+--- a/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
++++ /dev/null
+@@ -1,72 +0,0 @@
+-/* PR tree-optimization/111150 */
+-/* { dg-do compile } */
+-/* { dg-options "-O1 -fgimple -fdump-tree-forwprop1-raw" } */
+-
+-/* Checks if pattern (X ? e : f) == (Y ? e : f) gets optimized. */
+-__GIMPLE()
+-_Bool f1_(int a, int b, int c, int d, int e, int f) {
+- _Bool X;
+- _Bool Y;
+- _Bool t;
+- int t1;
+- int t2;
+- X = a == b;
+- Y = c == d;
+- /* Before the patch cond_expr was generated for these 2 statements. */
+- t1 = X ? e : f;
+- t2 = Y ? e : f;
+- t = t1 == t2;
+- return t;
+-}
+-
+-/* Checks if pattern (X ? e : f) != (Y ? e : f) gets optimized. */
+-__GIMPLE()
+-_Bool f2_(int a, int b, int c, int d, int e, int f) {
+- _Bool X;
+- _Bool Y;
+- _Bool t;
+- int t1;
+- int t2;
+- X = a == b;
+- Y = c == d;
+- t1 = X ? e : f;
+- t2 = Y ? e : f;
+- t = t1 != t2;
+- return t;
+-}
+-
+-/* Checks if pattern (X ? e : f) == (Y ? f : e) gets optimized. */
+-__GIMPLE()
+-_Bool f3_(int a, int b, int c, int d, int e, int f) {
+- _Bool X;
+- _Bool Y;
+- _Bool t;
+- int t1;
+- int t2;
+- X = a == b;
+- Y = c == d;
+- t1 = X ? e : f;
+- t2 = Y ? f : e;
+- t = t1 == t2;
+- return t;
+-}
+-
+-/* Checks if pattern (X ? e : f) != (Y ? f : e) gets optimized. */
+-__GIMPLE()
+-_Bool f4_(int a, int b, int c, int d, int e, int f) {
+- _Bool X;
+- _Bool Y;
+- _Bool t;
+- int t1;
+- int t2;
+- X = a == b;
+- Y = c == d;
+- t1 = X ? e : f;
+- t2 = Y ? f : e;
+- t = t1 != t2;
+- return t;
+-}
+-
+-/* Should generate one bit_xor_expr for each testcase. */
+-/* { dg-final { scan-tree-dump-not "cond_expr, " "forwprop1" } } */
+-/* { dg-final { scan-tree-dump-times "bit_xor_expr, " 4 "forwprop1" } } */
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
+deleted file mode 100644
+index 568ae9e44b3d..000000000000
+--- a/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
++++ /dev/null
+@@ -1,22 +0,0 @@
+-/* PR tree-optimization/111150 */
+-/* { dg-do compile } */
+-/* { dg-options "-O1 -fdump-tree-forwprop1 -Wno-psabi" } */
+-
+-typedef int v4si __attribute((__vector_size__(4 * sizeof(int))));
+-
+-/* Before the patch, VEC_COND_EXPR was generated for each statement in the
+- function. This resulted in 3 VEC_COND_EXPR. */
+-v4si f1_(v4si a, v4si b, v4si c, v4si d) {
+- v4si X = a == b;
+- v4si Y = c == d;
+- return (X != Y);
+-}
+-
+-v4si f2_(v4si a, v4si b, v4si c, v4si d) {
+- v4si X = a == b;
+- v4si Y = c == d;
+- return (X == Y);
+-}
+-
+-/* For each testcase, should produce only one VEC_COND_EXPR for X^Y. */
+-/* { dg-final { scan-tree-dump-times " VEC_COND_EXPR " 2 "forwprop1" } } */
+
+base-commit: d5f1948640815a554d106542c2e91e4e117aa3bc
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 81978cb..93de595 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+7 29 July 2024
+
+ + 79_all_PR116120-revert-match-pattern.patch
+
6 22 July 2024
- 76_all_ppc_PR97367-power7-cell-altivec.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-01 14:40 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-01 14:40 UTC (permalink / raw
To: gentoo-commits
commit: 26118e917fcb919778bc5634c6cd8072ff23c4f6
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 1 14:39:41 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 1 14:39:41 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=26118e91
15.0.0: drop 79_all_PR116120-revert-match-pattern.patch
Part of it is fixed and the other part should be committed soon.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../79_all_PR116120-revert-match-pattern.patch | 199 ---------------------
15.0.0/gentoo/README.history | 4 +
2 files changed, 4 insertions(+), 199 deletions(-)
diff --git a/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch b/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch
deleted file mode 100644
index 6d5b542..0000000
--- a/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-From fd07aecb306c682e1d7255fc01c6c02f3ca4f6f8 Mon Sep 17 00:00:00 2001
-Message-ID: <fd07aecb306c682e1d7255fc01c6c02f3ca4f6f8.1722209590.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Mon, 29 Jul 2024 00:32:52 +0100
-Subject: [PATCH] Revert "MATCH: Simplify (a ? x : y) eq/ne (b ? x : y)
- [PR111150]"
-
-This reverts commit 44fcc1ca11e7ea35dc9fb25a5317346bc1eaf7b2.
-
-Avoid a reported & debugged miscompilation until it gets fixed.
-
-Bug: https://gcc.gnu.org/PR116120
----
- gcc/match.pd | 15 -----
- gcc/testsuite/g++.dg/tree-ssa/pr111150.C | 34 ----------
- gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c | 72 ----------------------
- gcc/testsuite/gcc.dg/tree-ssa/pr111150.c | 22 -------
- 4 files changed, 143 deletions(-)
- delete mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr111150.C
- delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
- delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
-
-diff --git a/gcc/match.pd b/gcc/match.pd
-index 1c8601229e3d..b8d0ebee08db 100644
---- a/gcc/match.pd
-+++ b/gcc/match.pd
-@@ -5632,21 +5632,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
- (vec_cond (bit_and (bit_not @0) @1) @2 @3)))
- #endif
-
--/* (a ? x : y) != (b ? x : y) --> (a^b) ? TRUE : FALSE */
--/* (a ? x : y) == (b ? x : y) --> (a^b) ? FALSE : TRUE */
--/* (a ? x : y) != (b ? y : x) --> (a^b) ? FALSE : TRUE */
--/* (a ? x : y) == (b ? y : x) --> (a^b) ? TRUE : FALSE */
--(for cnd (cond vec_cond)
-- (for eqne (eq ne)
-- (simplify
-- (eqne:c (cnd @0 @1 @2) (cnd @3 @1 @2))
-- (cnd (bit_xor @0 @3) { constant_boolean_node (eqne == NE_EXPR, type); }
-- { constant_boolean_node (eqne != NE_EXPR, type); }))
-- (simplify
-- (eqne:c (cnd @0 @1 @2) (cnd @3 @2 @1))
-- (cnd (bit_xor @0 @3) { constant_boolean_node (eqne != NE_EXPR, type); }
-- { constant_boolean_node (eqne == NE_EXPR, type); }))))
--
- /* Canonicalize mask ? { 0, ... } : { -1, ...} to ~mask if the mask
- types are compatible. */
- (simplify
-diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr111150.C b/gcc/testsuite/g++.dg/tree-ssa/pr111150.C
-deleted file mode 100644
-index ac5d3ef15d83..000000000000
---- a/gcc/testsuite/g++.dg/tree-ssa/pr111150.C
-+++ /dev/null
-@@ -1,34 +0,0 @@
--/* PR tree-optimization/111150 */
--/* { dg-do compile } */
--/* { dg-options "-O1 -fdump-tree-forwprop1 -Wno-psabi" } */
--
--typedef int v4si __attribute((__vector_size__(4 * sizeof(int))));
--
--/* Before the patch, VEC_COND_EXPR was generated for each statement in the
-- function. This resulted in 3 VEC_COND_EXPR. */
--v4si f1_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
-- v4si X = a == b ? e : f;
-- v4si Y = c == d ? e : f;
-- return (X != Y);
--}
--
--v4si f2_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
-- v4si X = a == b ? e : f;
-- v4si Y = c == d ? e : f;
-- return (X == Y);
--}
--
--v4si f3_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
-- v4si X = a == b ? e : f;
-- v4si Y = c == d ? f : e;
-- return (X != Y);
--}
--
--v4si f4_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
-- v4si X = a == b ? e : f;
-- v4si Y = c == d ? f : e;
-- return (X == Y);
--}
--
--/* For each testcase, should produce only one VEC_COND_EXPR for X^Y. */
--/* { dg-final { scan-tree-dump-times " VEC_COND_EXPR " 4 "forwprop1" } } */
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
-deleted file mode 100644
-index 6f4b21ac6bcb..000000000000
---- a/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
-+++ /dev/null
-@@ -1,72 +0,0 @@
--/* PR tree-optimization/111150 */
--/* { dg-do compile } */
--/* { dg-options "-O1 -fgimple -fdump-tree-forwprop1-raw" } */
--
--/* Checks if pattern (X ? e : f) == (Y ? e : f) gets optimized. */
--__GIMPLE()
--_Bool f1_(int a, int b, int c, int d, int e, int f) {
-- _Bool X;
-- _Bool Y;
-- _Bool t;
-- int t1;
-- int t2;
-- X = a == b;
-- Y = c == d;
-- /* Before the patch cond_expr was generated for these 2 statements. */
-- t1 = X ? e : f;
-- t2 = Y ? e : f;
-- t = t1 == t2;
-- return t;
--}
--
--/* Checks if pattern (X ? e : f) != (Y ? e : f) gets optimized. */
--__GIMPLE()
--_Bool f2_(int a, int b, int c, int d, int e, int f) {
-- _Bool X;
-- _Bool Y;
-- _Bool t;
-- int t1;
-- int t2;
-- X = a == b;
-- Y = c == d;
-- t1 = X ? e : f;
-- t2 = Y ? e : f;
-- t = t1 != t2;
-- return t;
--}
--
--/* Checks if pattern (X ? e : f) == (Y ? f : e) gets optimized. */
--__GIMPLE()
--_Bool f3_(int a, int b, int c, int d, int e, int f) {
-- _Bool X;
-- _Bool Y;
-- _Bool t;
-- int t1;
-- int t2;
-- X = a == b;
-- Y = c == d;
-- t1 = X ? e : f;
-- t2 = Y ? f : e;
-- t = t1 == t2;
-- return t;
--}
--
--/* Checks if pattern (X ? e : f) != (Y ? f : e) gets optimized. */
--__GIMPLE()
--_Bool f4_(int a, int b, int c, int d, int e, int f) {
-- _Bool X;
-- _Bool Y;
-- _Bool t;
-- int t1;
-- int t2;
-- X = a == b;
-- Y = c == d;
-- t1 = X ? e : f;
-- t2 = Y ? f : e;
-- t = t1 != t2;
-- return t;
--}
--
--/* Should generate one bit_xor_expr for each testcase. */
--/* { dg-final { scan-tree-dump-not "cond_expr, " "forwprop1" } } */
--/* { dg-final { scan-tree-dump-times "bit_xor_expr, " 4 "forwprop1" } } */
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
-deleted file mode 100644
-index 568ae9e44b3d..000000000000
---- a/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
-+++ /dev/null
-@@ -1,22 +0,0 @@
--/* PR tree-optimization/111150 */
--/* { dg-do compile } */
--/* { dg-options "-O1 -fdump-tree-forwprop1 -Wno-psabi" } */
--
--typedef int v4si __attribute((__vector_size__(4 * sizeof(int))));
--
--/* Before the patch, VEC_COND_EXPR was generated for each statement in the
-- function. This resulted in 3 VEC_COND_EXPR. */
--v4si f1_(v4si a, v4si b, v4si c, v4si d) {
-- v4si X = a == b;
-- v4si Y = c == d;
-- return (X != Y);
--}
--
--v4si f2_(v4si a, v4si b, v4si c, v4si d) {
-- v4si X = a == b;
-- v4si Y = c == d;
-- return (X == Y);
--}
--
--/* For each testcase, should produce only one VEC_COND_EXPR for X^Y. */
--/* { dg-final { scan-tree-dump-times " VEC_COND_EXPR " 2 "forwprop1" } } */
-
-base-commit: d5f1948640815a554d106542c2e91e4e117aa3bc
---
-2.45.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 93de595..793fd45 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+8 ????
+
+ - 79_all_PR116120-revert-match-pattern.patch
+
7 29 July 2024
+ 79_all_PR116120-revert-match-pattern.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-02 20:39 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-02 20:39 UTC (permalink / raw
To: gentoo-commits
commit: 831195db0373e4954ff47452375844caf997e34b
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 2 20:39:09 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 2 20:39:09 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=831195db
15.0.0: add 79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
Bug: https://gcc.gnu.org/PR116200
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-may_trap_p_1-return-false-for-constant-p.patch | 98 ++++++++++++++++++++++
1 file changed, 98 insertions(+)
diff --git a/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch b/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
new file mode 100644
index 0000000..c65b792
--- /dev/null
+++ b/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
@@ -0,0 +1,98 @@
+From 4def9ea5a1511d6adbbd15e59f2542326484454a Mon Sep 17 00:00:00 2001
+Message-ID: <4def9ea5a1511d6adbbd15e59f2542326484454a.1722631128.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Fri, 2 Aug 2024 21:38:28 +0100
+Subject: [PATCH] Revert "Make may_trap_p_1 return false for constant pool
+ references [PR116145]"
+
+This reverts commit ba730fd10934e4ca004251aa3748bf9da4d35e62.
+
+Bug: https://gcc.gnu.org/PR116200
+---
+ gcc/rtlanal.cc | 14 ++----
+ .../aarch64/sve/acle/general/pr116145.c | 46 -------------------
+ 2 files changed, 4 insertions(+), 56 deletions(-)
+ delete mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
+
+diff --git a/gcc/rtlanal.cc b/gcc/rtlanal.cc
+index 893a6afbbc53..4158a531bdd7 100644
+--- a/gcc/rtlanal.cc
++++ b/gcc/rtlanal.cc
+@@ -3152,16 +3152,10 @@ may_trap_p_1 (const_rtx x, unsigned flags)
+ && MEM_VOLATILE_P (x)
+ && XEXP (x, 0) == stack_pointer_rtx)
+ return true;
+- if (/* MEM_READONLY_P means that the memory is both statically
+- allocated and readonly, so MEM_NOTRAP_P should remain true
+- even if the memory reference is moved. This is certainly
+- true for the important case of force_const_mem.
+-
+- Otherwise, MEM_NOTRAP_P only relates to the actual position
+- of the memory reference; moving it out of context such as
+- when moving code when optimizing, might cause its address
+- to become invalid. */
+- (code_changed && !MEM_READONLY_P (x))
++ if (/* MEM_NOTRAP_P only relates to the actual position of the memory
++ reference; moving it out of context such as when moving code
++ when optimizing, might cause its address to become invalid. */
++ code_changed
+ || !MEM_NOTRAP_P (x))
+ {
+ poly_int64 size = MEM_SIZE_KNOWN_P (x) ? MEM_SIZE (x) : -1;
+diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
+deleted file mode 100644
+index a3d93d3e1c84..000000000000
+--- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
++++ /dev/null
+@@ -1,46 +0,0 @@
+-// { dg-options "-O2" }
+-
+-#include <stdlib.h>
+-#include <arm_sve.h>
+-
+-#pragma GCC target "+sve2"
+-
+-typedef unsigned char uchar;
+-
+-const uchar *
+-search_line_fast (const uchar *s, const uchar *end)
+-{
+- size_t VL = svcntb();
+- svuint8_t arr1, arr2;
+- svbool_t pc, pg = svptrue_b8();
+-
+- // This should not be loaded inside the loop every time.
+- arr2 = svreinterpret_u8(svdup_u32(0x0a0d5c3f));
+-
+- for (; s+VL <= end; s += VL) {
+- arr1 = svld1_u8(pg, s);
+- pc = svmatch_u8(pg, arr1, arr2);
+-
+- if (svptest_any(pg, pc)) {
+- pc = svbrkb_z(pg, pc);
+- return s+svcntp_b8(pg, pc);
+- }
+- }
+-
+- // Handle remainder.
+- if (s < end) {
+- pg = svwhilelt_b8((size_t)s, (size_t)end);
+-
+- arr1 = svld1_u8(pg, s);
+- pc = svmatch_u8(pg, arr1, arr2);
+-
+- if (svptest_any(pg, pc)) {
+- pc = svbrkb_z(pg, pc);
+- return s+svcntp_b8(pg, pc);
+- }
+- }
+-
+- return end;
+-}
+-
+-// { dg-final { scan-assembler {:\n\tld1b\t[^\n]*\n\tmatch\t[^\n]*\n\tb\.} } }
+
+base-commit: 5ebfaf2d4994c124ce81aa0abd7eaa1529644749
+--
+2.45.2
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-05 1:51 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-05 1:51 UTC (permalink / raw
To: gentoo-commits
commit: 2723607b796c54089f8004568fa060c476dc829d
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 01:47:39 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 5 01:47:39 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=2723607b
15.0.0: cut patchset 8
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 793fd45..2188207 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,6 +1,7 @@
-8 ????
+8 5 August 2024
- 79_all_PR116120-revert-match-pattern.patch
+ + 79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
7 29 July 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-05 1:54 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-05 1:54 UTC (permalink / raw
To: gentoo-commits
commit: 01af1e42d008b379d7046adce4733b4d67acdcf0
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 01:54:07 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 5 01:54:07 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=01af1e42
15.0.0: re-enable -fext-dce at -O2
All known issues are fixed, let's get testing it again.
I have let Jeff know I spotted a test is failing on s390x at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115912#c21.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...gcc_don-t-enable-fext-dce-with-O2-for-now.patch | 34 ----------------------
15.0.0/gentoo/README.history | 4 +++
2 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch b/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
deleted file mode 100644
index 82c5535..0000000
--- a/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 86de2fd7550f75a318aa9819b115487cd850b4fc Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Mon, 15 Jul 2024 00:32:18 +0100
-Subject: [PATCH] gcc: don't enable -fext-dce with -O2 for now
-
-There's too many bugs involving it for now.
-
- gcc/
- * opts.cc (default_options_table): Don't enable ext-dce at -O2
-
-Bug: https://gcc.gnu.org/PR115876
-Bug: https://gcc.gnu.org/PR115877
-Bug: https://gcc.gnu.org/PR115912
-Bug: https://gcc.gnu.org/PR115916
-Bug: https://gcc.gnu.org/PR115927
----
- gcc/opts.cc | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/gcc/opts.cc b/gcc/opts.cc
-index be90a632338f..e1a1bdf15822 100644
---- a/gcc/opts.cc
-+++ b/gcc/opts.cc
-@@ -634,7 +634,6 @@ static const struct default_options default_options_table[] =
- { OPT_LEVELS_2_PLUS, OPT_fdevirtualize, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fdevirtualize_speculatively, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fexpensive_optimizations, NULL, 1 },
-- { OPT_LEVELS_2_PLUS, OPT_fext_dce, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fgcse, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_findirect_inlining, NULL, 1 },
---
-2.45.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 2188207..a872a71 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+? ????
+
+ - 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
+
8 5 August 2024
- 79_all_PR116120-revert-match-pattern.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-05 9:09 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-05 9:09 UTC (permalink / raw
To: gentoo-commits
commit: 767d91209f8983d23caae12e2337eca6c2b5dbdb
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 09:09:04 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 5 09:09:04 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=767d9120
15.0.0: drop 79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
It's been reverted upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-may_trap_p_1-return-false-for-constant-p.patch | 98 ----------------------
1 file changed, 98 deletions(-)
diff --git a/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch b/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
deleted file mode 100644
index c65b792..0000000
--- a/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 4def9ea5a1511d6adbbd15e59f2542326484454a Mon Sep 17 00:00:00 2001
-Message-ID: <4def9ea5a1511d6adbbd15e59f2542326484454a.1722631128.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Fri, 2 Aug 2024 21:38:28 +0100
-Subject: [PATCH] Revert "Make may_trap_p_1 return false for constant pool
- references [PR116145]"
-
-This reverts commit ba730fd10934e4ca004251aa3748bf9da4d35e62.
-
-Bug: https://gcc.gnu.org/PR116200
----
- gcc/rtlanal.cc | 14 ++----
- .../aarch64/sve/acle/general/pr116145.c | 46 -------------------
- 2 files changed, 4 insertions(+), 56 deletions(-)
- delete mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
-
-diff --git a/gcc/rtlanal.cc b/gcc/rtlanal.cc
-index 893a6afbbc53..4158a531bdd7 100644
---- a/gcc/rtlanal.cc
-+++ b/gcc/rtlanal.cc
-@@ -3152,16 +3152,10 @@ may_trap_p_1 (const_rtx x, unsigned flags)
- && MEM_VOLATILE_P (x)
- && XEXP (x, 0) == stack_pointer_rtx)
- return true;
-- if (/* MEM_READONLY_P means that the memory is both statically
-- allocated and readonly, so MEM_NOTRAP_P should remain true
-- even if the memory reference is moved. This is certainly
-- true for the important case of force_const_mem.
--
-- Otherwise, MEM_NOTRAP_P only relates to the actual position
-- of the memory reference; moving it out of context such as
-- when moving code when optimizing, might cause its address
-- to become invalid. */
-- (code_changed && !MEM_READONLY_P (x))
-+ if (/* MEM_NOTRAP_P only relates to the actual position of the memory
-+ reference; moving it out of context such as when moving code
-+ when optimizing, might cause its address to become invalid. */
-+ code_changed
- || !MEM_NOTRAP_P (x))
- {
- poly_int64 size = MEM_SIZE_KNOWN_P (x) ? MEM_SIZE (x) : -1;
-diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
-deleted file mode 100644
-index a3d93d3e1c84..000000000000
---- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
-+++ /dev/null
-@@ -1,46 +0,0 @@
--// { dg-options "-O2" }
--
--#include <stdlib.h>
--#include <arm_sve.h>
--
--#pragma GCC target "+sve2"
--
--typedef unsigned char uchar;
--
--const uchar *
--search_line_fast (const uchar *s, const uchar *end)
--{
-- size_t VL = svcntb();
-- svuint8_t arr1, arr2;
-- svbool_t pc, pg = svptrue_b8();
--
-- // This should not be loaded inside the loop every time.
-- arr2 = svreinterpret_u8(svdup_u32(0x0a0d5c3f));
--
-- for (; s+VL <= end; s += VL) {
-- arr1 = svld1_u8(pg, s);
-- pc = svmatch_u8(pg, arr1, arr2);
--
-- if (svptest_any(pg, pc)) {
-- pc = svbrkb_z(pg, pc);
-- return s+svcntp_b8(pg, pc);
-- }
-- }
--
-- // Handle remainder.
-- if (s < end) {
-- pg = svwhilelt_b8((size_t)s, (size_t)end);
--
-- arr1 = svld1_u8(pg, s);
-- pc = svmatch_u8(pg, arr1, arr2);
--
-- if (svptest_any(pg, pc)) {
-- pc = svbrkb_z(pg, pc);
-- return s+svcntp_b8(pg, pc);
-- }
-- }
--
-- return end;
--}
--
--// { dg-final { scan-assembler {:\n\tld1b\t[^\n]*\n\tmatch\t[^\n]*\n\tb\.} } }
-
-base-commit: 5ebfaf2d4994c124ce81aa0abd7eaa1529644749
---
-2.45.2
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-08 11:03 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-08 11:03 UTC (permalink / raw
To: gentoo-commits
commit: 66b7838fff9640206291c609dd07b2bc95c9f128
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 8 11:03:19 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 8 11:03:19 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=66b7838f
15.0.0: add 31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
...ortran-pass-Wcomplain-wrong-lang-where-ap.patch | 104 +++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
new file mode 100644
index 0000000..0bf9812
--- /dev/null
+++ b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
@@ -0,0 +1,104 @@
+From 1e216be94b87d607cafd6f35fd2ece5ba5004a76 Mon Sep 17 00:00:00 2001
+Message-ID: <1e216be94b87d607cafd6f35fd2ece5ba5004a76.1723114981.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Thu, 8 Aug 2024 12:00:41 +0100
+Subject: [PATCH] testsuite: fortran: pass -Wcomplain-wrong-lang where
+ appropriate
+
+These tests expect the diagnostic from -Wcomplain-wrong-lang but
+don't explicitly enable it. This causes issues if running the testsuite
+with -Wno-complain-wrong-lang.
+
+gcc/testsuite/ChangeLog:
+ * gfortran.dg/ISO_Fortran_binding_17.f90: Pass -Wcomplain-wrong-lang.
+ * gfortran.dg/c-interop/allocate-errors.f90: Likewise.
+ * gfortran.dg/c-interop/establish-errors.f90: Likewise.
+ * gfortran.dg/c-interop/section-errors.f90: Likewise.
+ * gfortran.dg/c-interop/select-errors.f90: Likewise.
+ * gfortran.dg/c-interop/setpointer-errors.f90: Likewise.
+---
+ gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/section-errors.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/select-errors.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90 | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90
+index c399e710ce97..c321c7a61f54 100644
+--- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90
++++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-additional-sources ISO_Fortran_binding_17.c }
+-! { dg-options "-fcheck=all" }
++! { dg-options "-Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! PR fortran/92470
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90
+index a58d05a33681..1cf3fbd9fdd7 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-additional-sources "allocate-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_allocate and CFI_deallocate functions
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90
+index 307a2664b743..c505c1904c75 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90
+@@ -1,7 +1,7 @@
+ ! PR101317
+ ! { dg-do run }
+ ! { dg-additional-sources "establish-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_establish function properly detects
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90
+index 28328b799b30..699fa8940849 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-additional-sources "section-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_section function properly detects
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90
+index b719c9e68679..199f314ed359 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-additional-sources "select-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_select_part function properly detects
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90
+index 84a01ce16b12..3af7cc7f0e0f 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90
+@@ -1,7 +1,7 @@
+ ! PR 101317
+ ! { dg-do run }
+ ! { dg-additional-sources "setpointer-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_setpointer function properly detects
+--
+2.45.2
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-08 11:06 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-08 11:06 UTC (permalink / raw
To: gentoo-commits
commit: bf4ef4b5f40ababd682716570dd5683d154844ca
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 8 11:06:47 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 8 11:06:47 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=bf4ef4b5
15.0.0: add link to upstream discussion/question wrt tests
https://inbox.sourceware.org/gcc-patches/87v80cn24t.fsf <AT> gentoo.org/
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch | 2 ++
1 file changed, 2 insertions(+)
diff --git a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
index 0bf9812..89e5a8b 100644
--- a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
+++ b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
@@ -1,3 +1,5 @@
+https://inbox.sourceware.org/gcc-patches/87v80cn24t.fsf@gentoo.org/
+
From 1e216be94b87d607cafd6f35fd2ece5ba5004a76 Mon Sep 17 00:00:00 2001
Message-ID: <1e216be94b87d607cafd6f35fd2ece5ba5004a76.1723114981.git.sam@gentoo.org>
From: Sam James <sam@gentoo.org>
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-08 11:10 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-08 11:10 UTC (permalink / raw
To: gentoo-commits
commit: a8f25dda00d49c9a43b19d64fface4a570d6af07
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 8 11:09:50 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 8 11:09:50 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a8f25dda
15.0.0: add commit ref to eclass change too to patch
See d4c98533530d9478391b0593fd84cf37ac9c97cb.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch | 2 ++
1 file changed, 2 insertions(+)
diff --git a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
index 89e5a8b..ba6d67f 100644
--- a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
+++ b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
@@ -1,5 +1,7 @@
https://inbox.sourceware.org/gcc-patches/87v80cn24t.fsf@gentoo.org/
+See also d4c98533530d9478391b0593fd84cf37ac9c97cb in ::gentoo.
+
From 1e216be94b87d607cafd6f35fd2ece5ba5004a76 Mon Sep 17 00:00:00 2001
Message-ID: <1e216be94b87d607cafd6f35fd2ece5ba5004a76.1723114981.git.sam@gentoo.org>
From: Sam James <sam@gentoo.org>
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-09 19:25 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-09 19:25 UTC (permalink / raw
To: gentoo-commits
commit: 3dcc61086076d7c86d43dbad5961fadf1b944d72
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 19:24:37 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 19:24:37 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3dcc6108
15.0.0: add revert of LRA patch
See https://inbox.sourceware.org/gcc-patches/CA+=Sn1=_jL5P1Nbx4b7O-wYttpMsP4N545nk49rXntKnoJ7G-Q <AT> mail.gmail.com/.
It breaks arm64 bootstrap at least.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...emit-caller-save-register-spills-before-c.patch | 101 +++++++++++++++++++++
15.0.0/gentoo/README.history | 1 +
2 files changed, 102 insertions(+)
diff --git a/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch b/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
new file mode 100644
index 0000000..6cd1b43
--- /dev/null
+++ b/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
@@ -0,0 +1,101 @@
+From c67cc1d712f488a93d03dcfcda70e82250e13ab9 Mon Sep 17 00:00:00 2001
+Message-ID: <c67cc1d712f488a93d03dcfcda70e82250e13ab9.1723231445.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Fri, 9 Aug 2024 20:24:00 +0100
+Subject: [PATCH] Revert "lra: emit caller-save register spills before call
+ insn [PR116028]"
+
+This reverts commit 3c67a0fa1dd39a3378deb854a7fef0ff7fe38004.
+
+See https://inbox.sourceware.org/gcc-patches/CA+=Sn1=_jL5P1Nbx4b7O-wYttpMsP4N545nk49rXntKnoJ7G-Q@mail.gmail.com/.
+---
+ gcc/lra-constraints.cc | 28 +++-----------------
+ gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c | 2 +-
+ gcc/testsuite/gcc.dg/pr10474.c | 2 +-
+ 3 files changed, 6 insertions(+), 26 deletions(-)
+
+diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
+index 28c1a877c003..92b343fa99a0 100644
+--- a/gcc/lra-constraints.cc
++++ b/gcc/lra-constraints.cc
+@@ -152,9 +152,6 @@ static machine_mode curr_operand_mode[MAX_RECOG_OPERANDS];
+ (e.g. constant) and whose subreg is given operand of the current
+ insn. VOIDmode in all other cases. */
+ static machine_mode original_subreg_reg_mode[MAX_RECOG_OPERANDS];
+-/* The nearest call insn for an insn on which split transformation
+- will be done. The call insn is in the same EBB as the insn. */
+-static rtx_insn *latest_call_insn;
+
+ \f
+
+@@ -6289,25 +6286,10 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn,
+ after_p ? restore : NULL,
+ call_save_p
+ ? "Add reg<-save" : "Add reg<-split");
+- if (call_save_p && latest_call_insn != NULL)
+- /* PR116028: If original_regno is a pseudo that has been assigned a
+- call-save hard register, then emit the spill insn before the call
+- insn 'latest_call_insn' instead of adjacent to 'insn'. If 'insn'
+- and 'latest_call_insn' belong to the same EBB but to two separate
+- BBs, and if 'insn' is present in the entry BB, then generating the
+- spill insn in the entry BB can prevent shrink wrap from happening.
+- This is because the spill insn references the stack pointer and
+- hence the prolog gets generated in the entry BB itself. It is
+- also more efficient to generate the spill before
+- 'latest_call_insn' as the spill now occurs only in the path
+- containing the call. */
+- lra_process_new_insns (PREV_INSN (latest_call_insn), NULL, save,
+- "Add save<-reg");
+- else
+- lra_process_new_insns (insn, before_p ? save : NULL,
+- before_p ? NULL : save,
+- call_save_p
+- ? "Add save<-reg" : "Add split<-reg");
++ lra_process_new_insns (insn, before_p ? save : NULL,
++ before_p ? NULL : save,
++ call_save_p
++ ? "Add save<-reg" : "Add split<-reg");
+ if (nregs > 1 || original_regno < FIRST_PSEUDO_REGISTER)
+ /* If we are trying to split multi-register. We should check
+ conflicts on the next assignment sub-pass. IRA can allocate on
+@@ -6791,7 +6773,6 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
+ last_processed_bb = NULL;
+ CLEAR_HARD_REG_SET (potential_reload_hard_regs);
+ live_hard_regs = eliminable_regset | lra_no_alloc_regs;
+- latest_call_insn = NULL;
+ /* We don't process new insns generated in the loop. */
+ for (curr_insn = tail; curr_insn != PREV_INSN (head); curr_insn = prev_insn)
+ {
+@@ -7004,7 +6985,6 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
+ last_call_for_abi[callee_abi.id ()] = calls_num;
+ full_and_partial_call_clobbers
+ |= callee_abi.full_and_partial_reg_clobbers ();
+- latest_call_insn = curr_insn;
+ if ((cheap = find_reg_note (curr_insn,
+ REG_RETURNED, NULL_RTX)) != NULL_RTX
+ && ((cheap = XEXP (cheap, 0)), true)
+diff --git a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
+index 8c150972f952..a95637abbe54 100644
+--- a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
++++ b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
+@@ -26,4 +26,4 @@ bar (long a)
+
+ /* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
+ /* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! aarch64*-*-* } } } } */
+-/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
++/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail powerpc*-*-* } } } */
+diff --git a/gcc/testsuite/gcc.dg/pr10474.c b/gcc/testsuite/gcc.dg/pr10474.c
+index b5393d5b6e3e..a4af536ec284 100644
+--- a/gcc/testsuite/gcc.dg/pr10474.c
++++ b/gcc/testsuite/gcc.dg/pr10474.c
+@@ -13,4 +13,4 @@ void f(int *i)
+ }
+
+ /* XFAIL due to PR70681. */
+-/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* } } } */
++/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* powerpc*-*-* } } } */
+
+base-commit: 9e4da946c4263a4c89d5fc365b3c97ae244c5018
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index a872a71..3c55551 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,6 +1,7 @@
? ????
- 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
+ + 32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
8 5 August 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-09 19:47 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-09 19:47 UTC (permalink / raw
To: gentoo-commits
commit: b1db6e989802fb46fb5d242f68e3edbc0f0b2cd0
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 19:46:45 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 19:46:45 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b1db6e98
15.0.0: drop LRA revert
It's now reverted upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...emit-caller-save-register-spills-before-c.patch | 101 ---------------------
1 file changed, 101 deletions(-)
diff --git a/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch b/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
deleted file mode 100644
index 6cd1b43..0000000
--- a/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From c67cc1d712f488a93d03dcfcda70e82250e13ab9 Mon Sep 17 00:00:00 2001
-Message-ID: <c67cc1d712f488a93d03dcfcda70e82250e13ab9.1723231445.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Fri, 9 Aug 2024 20:24:00 +0100
-Subject: [PATCH] Revert "lra: emit caller-save register spills before call
- insn [PR116028]"
-
-This reverts commit 3c67a0fa1dd39a3378deb854a7fef0ff7fe38004.
-
-See https://inbox.sourceware.org/gcc-patches/CA+=Sn1=_jL5P1Nbx4b7O-wYttpMsP4N545nk49rXntKnoJ7G-Q@mail.gmail.com/.
----
- gcc/lra-constraints.cc | 28 +++-----------------
- gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c | 2 +-
- gcc/testsuite/gcc.dg/pr10474.c | 2 +-
- 3 files changed, 6 insertions(+), 26 deletions(-)
-
-diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
-index 28c1a877c003..92b343fa99a0 100644
---- a/gcc/lra-constraints.cc
-+++ b/gcc/lra-constraints.cc
-@@ -152,9 +152,6 @@ static machine_mode curr_operand_mode[MAX_RECOG_OPERANDS];
- (e.g. constant) and whose subreg is given operand of the current
- insn. VOIDmode in all other cases. */
- static machine_mode original_subreg_reg_mode[MAX_RECOG_OPERANDS];
--/* The nearest call insn for an insn on which split transformation
-- will be done. The call insn is in the same EBB as the insn. */
--static rtx_insn *latest_call_insn;
-
- \f
-
-@@ -6289,25 +6286,10 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn,
- after_p ? restore : NULL,
- call_save_p
- ? "Add reg<-save" : "Add reg<-split");
-- if (call_save_p && latest_call_insn != NULL)
-- /* PR116028: If original_regno is a pseudo that has been assigned a
-- call-save hard register, then emit the spill insn before the call
-- insn 'latest_call_insn' instead of adjacent to 'insn'. If 'insn'
-- and 'latest_call_insn' belong to the same EBB but to two separate
-- BBs, and if 'insn' is present in the entry BB, then generating the
-- spill insn in the entry BB can prevent shrink wrap from happening.
-- This is because the spill insn references the stack pointer and
-- hence the prolog gets generated in the entry BB itself. It is
-- also more efficient to generate the spill before
-- 'latest_call_insn' as the spill now occurs only in the path
-- containing the call. */
-- lra_process_new_insns (PREV_INSN (latest_call_insn), NULL, save,
-- "Add save<-reg");
-- else
-- lra_process_new_insns (insn, before_p ? save : NULL,
-- before_p ? NULL : save,
-- call_save_p
-- ? "Add save<-reg" : "Add split<-reg");
-+ lra_process_new_insns (insn, before_p ? save : NULL,
-+ before_p ? NULL : save,
-+ call_save_p
-+ ? "Add save<-reg" : "Add split<-reg");
- if (nregs > 1 || original_regno < FIRST_PSEUDO_REGISTER)
- /* If we are trying to split multi-register. We should check
- conflicts on the next assignment sub-pass. IRA can allocate on
-@@ -6791,7 +6773,6 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
- last_processed_bb = NULL;
- CLEAR_HARD_REG_SET (potential_reload_hard_regs);
- live_hard_regs = eliminable_regset | lra_no_alloc_regs;
-- latest_call_insn = NULL;
- /* We don't process new insns generated in the loop. */
- for (curr_insn = tail; curr_insn != PREV_INSN (head); curr_insn = prev_insn)
- {
-@@ -7004,7 +6985,6 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
- last_call_for_abi[callee_abi.id ()] = calls_num;
- full_and_partial_call_clobbers
- |= callee_abi.full_and_partial_reg_clobbers ();
-- latest_call_insn = curr_insn;
- if ((cheap = find_reg_note (curr_insn,
- REG_RETURNED, NULL_RTX)) != NULL_RTX
- && ((cheap = XEXP (cheap, 0)), true)
-diff --git a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
-index 8c150972f952..a95637abbe54 100644
---- a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
-+++ b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
-@@ -26,4 +26,4 @@ bar (long a)
-
- /* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
- /* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! aarch64*-*-* } } } } */
--/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
-+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail powerpc*-*-* } } } */
-diff --git a/gcc/testsuite/gcc.dg/pr10474.c b/gcc/testsuite/gcc.dg/pr10474.c
-index b5393d5b6e3e..a4af536ec284 100644
---- a/gcc/testsuite/gcc.dg/pr10474.c
-+++ b/gcc/testsuite/gcc.dg/pr10474.c
-@@ -13,4 +13,4 @@ void f(int *i)
- }
-
- /* XFAIL due to PR70681. */
--/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* } } } */
-+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* powerpc*-*-* } } } */
-
-base-commit: 9e4da946c4263a4c89d5fc365b3c97ae244c5018
---
-2.45.2
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-09 19:54 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-09 19:54 UTC (permalink / raw
To: gentoo-commits
commit: 5a1f790fc4c95258c646243a30ba7adcecebcdcc
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 19:52:56 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 19:52:56 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5a1f790f
15.0.0: drop obsolete asprintf patch
Fixed upstream by r10-14-g6b3a5e8a3d18c8 and r6-1038-gf50f17e6707da0.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/07_all_libiberty-asprintf.patch | 18 ------------------
15.0.0/gentoo/README.history | 2 +-
2 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/15.0.0/gentoo/07_all_libiberty-asprintf.patch b/15.0.0/gentoo/07_all_libiberty-asprintf.patch
deleted file mode 100644
index 1ed2ba3..0000000
--- a/15.0.0/gentoo/07_all_libiberty-asprintf.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-2008-07-25 Magnus Granberg <zorry@ume.nu>
-
- * include/libiberty.h (asprintf): Don't declare if defined as a macro
-
---- a/include/libiberty.h
-+++ b/include/libiberty.h
-@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
- /* Like sprintf but provides a pointer to malloc'd storage, which must
- be freed by the caller. */
-
-+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
-+#ifndef asprintf
- extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
- #endif
-+#endif
-
- /* Like asprintf but allocates memory without fail. This works like
- xmalloc. */
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 3c55551..3d561ee 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,7 +1,7 @@
? ????
+ - 07_all_libiberty-asprintf.patch
- 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
- + 32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
8 5 August 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-09 19:54 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-09 19:54 UTC (permalink / raw
To: gentoo-commits
commit: ecc3ba06c22edee6b22d2e8e5e05031d18fa372a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 19:54:09 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 19:54:22 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ecc3ba06
15.0.0: fix comment in 04_all_nossp-on-nostdlib.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/04_all_nossp-on-nostdlib.patch | 3 ++-
15.0.0/gentoo/README.history | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/04_all_nossp-on-nostdlib.patch b/15.0.0/gentoo/04_all_nossp-on-nostdlib.patch
index 30c5825..e17b6a3 100644
--- a/15.0.0/gentoo/04_all_nossp-on-nostdlib.patch
+++ b/15.0.0/gentoo/04_all_nossp-on-nostdlib.patch
@@ -1,4 +1,5 @@
-│Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
+Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
+
https://bugs.gentoo.org/484714
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 3d561ee..4b1d9e8 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,5 +1,6 @@
? ????
+ U 04_all_nossp-on-nostdlib.patch
- 07_all_libiberty-asprintf.patch
- 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-11 22:40 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-11 22:40 UTC (permalink / raw
To: gentoo-commits
commit: 743578d0de067c87f590c9886f14961bb429c1f4
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 11 22:40:21 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 11 22:40:21 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=743578d0
15.0.0: cut patchset 9
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 4b1d9e8..468a873 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-? ????
+9 11 August 2024
U 04_all_nossp-on-nostdlib.patch
- 07_all_libiberty-asprintf.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-14 2:57 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-14 2:57 UTC (permalink / raw
To: gentoo-commits
commit: 70f5adef33e0620d934fc7fb0822e592e3ff04a1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 14 02:57:02 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 14 02:57:02 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=70f5adef
15.0.0: add 32_all_genoutput-speedup.patch
Link: https://inbox.sourceware.org/gcc-patches/20240814021909.37082-1-cooper.qu <AT> linux.alibaba.com/
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/32_all_genoutput-speedup.patch | 247 +++++++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +
2 files changed, 251 insertions(+)
diff --git a/15.0.0/gentoo/32_all_genoutput-speedup.patch b/15.0.0/gentoo/32_all_genoutput-speedup.patch
new file mode 100644
index 0000000..a379bf8
--- /dev/null
+++ b/15.0.0/gentoo/32_all_genoutput-speedup.patch
@@ -0,0 +1,247 @@
+https://inbox.sourceware.org/gcc-patches/20240814021909.37082-1-cooper.qu@linux.alibaba.com/
+
+From 23ea354ab6c1faf858120b65a0114c5d0bbeaf6e Mon Sep 17 00:00:00 2001
+Message-ID: <23ea354ab6c1faf858120b65a0114c5d0bbeaf6e.1723604026.git.sam@gentoo.org>
+From: Xianmiao Qu <cooper.qu@linux.alibaba.com>
+Date: Wed, 14 Aug 2024 10:19:09 +0800
+Subject: [PATCH] genoutput: Accelerate the place_operands function.
+
+With the increase in the number of modes and patterns for some
+backend architectures, the place_operands function becomes a
+bottleneck int the speed of genoutput, and may even become a
+bottleneck int the overall speed of building the GCC project.
+This patch aims to accelerate the place_operands function,
+the optimizations it includes are:
+1. Use a hash table to store operand information,
+ improving the lookup time for the first operand.
+2. Move mode comparison to the beginning to avoid the scenarios of most strcmp.
+
+I tested the speed improvements for the following backends,
+ Improvement Ratio
+x86_64 197.9%
+aarch64 954.5%
+riscv 2578.6%
+If the build machine is slow, then this improvement can save a lot of time.
+
+I tested the genoutput output for x86_64/aarch64/riscv backends,
+and there was no difference compared to before the optimization,
+so this shouldn't introduce any functional issues.
+
+gcc/
+ * genoutput.cc (struct operand_data): Add member 'eq_next' to
+ point to the next member with the same hash value in the
+ hash table.
+ (compare_operands): Move the comparison of the mode to the very
+ beginning to accelerate the comparison of the two operands.
+ (struct operand_data_hasher): New, a class that takes into account
+ the necessary elements for comparing the equality of two operands
+ in its hash value.
+ (operand_data_hasher::hash): New.
+ (operand_data_hasher::equal): New.
+ (operand_datas): New, hash table of konwn pattern operands.
+ (place_operands): Use a hash table instead of traversing the array
+ to find the same operand.
+ (main): Add initialization of the hash table 'operand_datas'.
+---
+ gcc/genoutput.cc | 111 +++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 88 insertions(+), 23 deletions(-)
+
+diff --git a/gcc/genoutput.cc b/gcc/genoutput.cc
+index efd81766bb5b..16fd811b5dd5 100644
+--- a/gcc/genoutput.cc
++++ b/gcc/genoutput.cc
+@@ -91,6 +91,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "errors.h"
+ #include "read-md.h"
+ #include "gensupport.h"
++#include "hash-table.h"
+
+ /* No instruction can have more operands than this. Sorry for this
+ arbitrary limit, but what machine will have an instruction with
+@@ -112,6 +113,8 @@ static int next_operand_number = 1;
+ struct operand_data
+ {
+ struct operand_data *next;
++ /* Point to the next member with the same hash value in the hash table. */
++ struct operand_data *eq_next;
+ int index;
+ const char *predicate;
+ const char *constraint;
+@@ -127,7 +130,7 @@ struct operand_data
+
+ static struct operand_data null_operand =
+ {
+- 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
++ 0, 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
+ };
+
+ static struct operand_data *odata = &null_operand;
+@@ -174,8 +177,8 @@ static void output_operand_data (void);
+ static void output_insn_data (void);
+ static void output_get_insn_name (void);
+ static void scan_operands (class data *, rtx, int, int);
+-static int compare_operands (struct operand_data *,
+- struct operand_data *);
++static int compare_operands (const struct operand_data *,
++ const struct operand_data *);
+ static void place_operands (class data *);
+ static void process_template (class data *, const char *);
+ static void validate_insn_alternatives (class data *);
+@@ -528,10 +531,18 @@ scan_operands (class data *d, rtx part, int this_address_p,
+ /* Compare two operands for content equality. */
+
+ static int
+-compare_operands (struct operand_data *d0, struct operand_data *d1)
++compare_operands (const struct operand_data *d0,
++ const struct operand_data *d1)
+ {
+ const char *p0, *p1;
+
++ /* On one hand, comparing strings for predicate and constraint
++ is time-consuming, and on the other hand, the probability of
++ different modes is relatively high. Therefore, checking the mode
++ first can speed up the execution of the program. */
++ if (d0->mode != d1->mode)
++ return 0;
++
+ p0 = d0->predicate;
+ if (!p0)
+ p0 = "";
+@@ -550,9 +561,6 @@ compare_operands (struct operand_data *d0, struct operand_data *d1)
+ if (strcmp (p0, p1) != 0)
+ return 0;
+
+- if (d0->mode != d1->mode)
+- return 0;
+-
+ if (d0->strict_low != d1->strict_low)
+ return 0;
+
+@@ -562,6 +570,46 @@ compare_operands (struct operand_data *d0, struct operand_data *d1)
+ return 1;
+ }
+
++/* This is a class that takes into account the necessary elements for
++ comparing the equality of two operands in its hash value. */
++struct operand_data_hasher : nofree_ptr_hash <operand_data>
++{
++ static inline hashval_t hash (const operand_data *);
++ static inline bool equal (const operand_data *, const operand_data *);
++};
++
++hashval_t
++operand_data_hasher::hash (const operand_data * op_info)
++{
++ inchash::hash h;
++ const char *pred, *cons;
++
++ pred = op_info->predicate;
++ if (!pred)
++ pred = "";
++ h.add (pred, strlen (pred) + 1);
++
++ cons = op_info->constraint;
++ if (!cons)
++ cons = "";
++ h.add (cons, strlen (cons) + 1);
++
++ h.add_object (op_info->mode);
++ h.add_object (op_info->strict_low);
++ h.add_object (op_info->eliminable);
++ return h.end ();
++}
++
++bool
++operand_data_hasher::equal (const operand_data * op_info1,
++ const operand_data * op_info2)
++{
++ return compare_operands (op_info1, op_info2);
++}
++
++/* Hashtable of konwn pattern operands. */
++static hash_table<operand_data_hasher> *operand_datas;
++
+ /* Scan the list of operands we've already committed to output and either
+ find a subsequence that is the same, or allocate a new one at the end. */
+
+@@ -569,6 +617,7 @@ static void
+ place_operands (class data *d)
+ {
+ struct operand_data *od, *od2;
++ struct operand_data **slot;
+ int i;
+
+ if (d->n_operands == 0)
+@@ -577,23 +626,24 @@ place_operands (class data *d)
+ return;
+ }
+
++ od = operand_datas->find (&d->operand[0]);
+ /* Brute force substring search. */
+- for (od = odata, i = 0; od; od = od->next, i = 0)
+- if (compare_operands (od, &d->operand[0]))
+- {
+- od2 = od->next;
+- i = 1;
+- while (1)
+- {
+- if (i == d->n_operands)
+- goto full_match;
+- if (od2 == NULL)
+- goto partial_match;
+- if (! compare_operands (od2, &d->operand[i]))
+- break;
+- ++i, od2 = od2->next;
+- }
+- }
++ for (; od; od = od->eq_next)
++ {
++ od2 = od->next;
++ i = 1;
++ while (1)
++ {
++ if (i == d->n_operands)
++ goto full_match;
++ if (od2 == NULL)
++ goto partial_match;
++ if (! compare_operands (od2, &d->operand[i]))
++ break;
++ ++i, od2 = od2->next;
++ }
++ }
++ i = 0;
+
+ /* Either partial match at the end of the list, or no match. In either
+ case, we tack on what operands are remaining to the end of the list. */
+@@ -605,6 +655,20 @@ place_operands (class data *d)
+ *odata_end = od2;
+ odata_end = &od2->next;
+ od2->index = next_operand_number++;
++ /* Insert the operand_data variable OD2 into the hash table.
++ If a variable with the same hash value already exists in
++ the hash table, insert the element at the end of the
++ linked list connected through the eq_next member. */
++ slot = operand_datas->find_slot (od2, INSERT);
++ if (*slot)
++ {
++ struct operand_data *last = (struct operand_data *) *slot;
++ while (last->eq_next)
++ last = last->eq_next;
++ last->eq_next = od2;
++ }
++ else
++ *slot = od2;
+ }
+ *odata_end = NULL;
+ return;
+@@ -1049,6 +1113,7 @@ main (int argc, const char **argv)
+ progname = "genoutput";
+
+ init_insn_for_nothing ();
++ operand_datas = new hash_table<operand_data_hasher> (1024);
+
+ if (!init_rtx_reader_args (argc, argv))
+ return (FATAL_EXIT_CODE);
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 468a873..1849089 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+10 ????
+
+ + 32_all_genoutput-speedup.patch
+
9 11 August 2024
U 04_all_nossp-on-nostdlib.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-14 9:48 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-14 9:48 UTC (permalink / raw
To: gentoo-commits
commit: b16c59c4a4df5f65d486023aedc4c5c7deef4f15
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 14 09:48:15 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 14 09:48:15 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b16c59c4
15.0.0: drop now-upstream 32_all_genoutput-speedup.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/32_all_genoutput-speedup.patch | 247 ---------------------------
1 file changed, 247 deletions(-)
diff --git a/15.0.0/gentoo/32_all_genoutput-speedup.patch b/15.0.0/gentoo/32_all_genoutput-speedup.patch
deleted file mode 100644
index a379bf8..0000000
--- a/15.0.0/gentoo/32_all_genoutput-speedup.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-https://inbox.sourceware.org/gcc-patches/20240814021909.37082-1-cooper.qu@linux.alibaba.com/
-
-From 23ea354ab6c1faf858120b65a0114c5d0bbeaf6e Mon Sep 17 00:00:00 2001
-Message-ID: <23ea354ab6c1faf858120b65a0114c5d0bbeaf6e.1723604026.git.sam@gentoo.org>
-From: Xianmiao Qu <cooper.qu@linux.alibaba.com>
-Date: Wed, 14 Aug 2024 10:19:09 +0800
-Subject: [PATCH] genoutput: Accelerate the place_operands function.
-
-With the increase in the number of modes and patterns for some
-backend architectures, the place_operands function becomes a
-bottleneck int the speed of genoutput, and may even become a
-bottleneck int the overall speed of building the GCC project.
-This patch aims to accelerate the place_operands function,
-the optimizations it includes are:
-1. Use a hash table to store operand information,
- improving the lookup time for the first operand.
-2. Move mode comparison to the beginning to avoid the scenarios of most strcmp.
-
-I tested the speed improvements for the following backends,
- Improvement Ratio
-x86_64 197.9%
-aarch64 954.5%
-riscv 2578.6%
-If the build machine is slow, then this improvement can save a lot of time.
-
-I tested the genoutput output for x86_64/aarch64/riscv backends,
-and there was no difference compared to before the optimization,
-so this shouldn't introduce any functional issues.
-
-gcc/
- * genoutput.cc (struct operand_data): Add member 'eq_next' to
- point to the next member with the same hash value in the
- hash table.
- (compare_operands): Move the comparison of the mode to the very
- beginning to accelerate the comparison of the two operands.
- (struct operand_data_hasher): New, a class that takes into account
- the necessary elements for comparing the equality of two operands
- in its hash value.
- (operand_data_hasher::hash): New.
- (operand_data_hasher::equal): New.
- (operand_datas): New, hash table of konwn pattern operands.
- (place_operands): Use a hash table instead of traversing the array
- to find the same operand.
- (main): Add initialization of the hash table 'operand_datas'.
----
- gcc/genoutput.cc | 111 +++++++++++++++++++++++++++++++++++++----------
- 1 file changed, 88 insertions(+), 23 deletions(-)
-
-diff --git a/gcc/genoutput.cc b/gcc/genoutput.cc
-index efd81766bb5b..16fd811b5dd5 100644
---- a/gcc/genoutput.cc
-+++ b/gcc/genoutput.cc
-@@ -91,6 +91,7 @@ along with GCC; see the file COPYING3. If not see
- #include "errors.h"
- #include "read-md.h"
- #include "gensupport.h"
-+#include "hash-table.h"
-
- /* No instruction can have more operands than this. Sorry for this
- arbitrary limit, but what machine will have an instruction with
-@@ -112,6 +113,8 @@ static int next_operand_number = 1;
- struct operand_data
- {
- struct operand_data *next;
-+ /* Point to the next member with the same hash value in the hash table. */
-+ struct operand_data *eq_next;
- int index;
- const char *predicate;
- const char *constraint;
-@@ -127,7 +130,7 @@ struct operand_data
-
- static struct operand_data null_operand =
- {
-- 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
-+ 0, 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
- };
-
- static struct operand_data *odata = &null_operand;
-@@ -174,8 +177,8 @@ static void output_operand_data (void);
- static void output_insn_data (void);
- static void output_get_insn_name (void);
- static void scan_operands (class data *, rtx, int, int);
--static int compare_operands (struct operand_data *,
-- struct operand_data *);
-+static int compare_operands (const struct operand_data *,
-+ const struct operand_data *);
- static void place_operands (class data *);
- static void process_template (class data *, const char *);
- static void validate_insn_alternatives (class data *);
-@@ -528,10 +531,18 @@ scan_operands (class data *d, rtx part, int this_address_p,
- /* Compare two operands for content equality. */
-
- static int
--compare_operands (struct operand_data *d0, struct operand_data *d1)
-+compare_operands (const struct operand_data *d0,
-+ const struct operand_data *d1)
- {
- const char *p0, *p1;
-
-+ /* On one hand, comparing strings for predicate and constraint
-+ is time-consuming, and on the other hand, the probability of
-+ different modes is relatively high. Therefore, checking the mode
-+ first can speed up the execution of the program. */
-+ if (d0->mode != d1->mode)
-+ return 0;
-+
- p0 = d0->predicate;
- if (!p0)
- p0 = "";
-@@ -550,9 +561,6 @@ compare_operands (struct operand_data *d0, struct operand_data *d1)
- if (strcmp (p0, p1) != 0)
- return 0;
-
-- if (d0->mode != d1->mode)
-- return 0;
--
- if (d0->strict_low != d1->strict_low)
- return 0;
-
-@@ -562,6 +570,46 @@ compare_operands (struct operand_data *d0, struct operand_data *d1)
- return 1;
- }
-
-+/* This is a class that takes into account the necessary elements for
-+ comparing the equality of two operands in its hash value. */
-+struct operand_data_hasher : nofree_ptr_hash <operand_data>
-+{
-+ static inline hashval_t hash (const operand_data *);
-+ static inline bool equal (const operand_data *, const operand_data *);
-+};
-+
-+hashval_t
-+operand_data_hasher::hash (const operand_data * op_info)
-+{
-+ inchash::hash h;
-+ const char *pred, *cons;
-+
-+ pred = op_info->predicate;
-+ if (!pred)
-+ pred = "";
-+ h.add (pred, strlen (pred) + 1);
-+
-+ cons = op_info->constraint;
-+ if (!cons)
-+ cons = "";
-+ h.add (cons, strlen (cons) + 1);
-+
-+ h.add_object (op_info->mode);
-+ h.add_object (op_info->strict_low);
-+ h.add_object (op_info->eliminable);
-+ return h.end ();
-+}
-+
-+bool
-+operand_data_hasher::equal (const operand_data * op_info1,
-+ const operand_data * op_info2)
-+{
-+ return compare_operands (op_info1, op_info2);
-+}
-+
-+/* Hashtable of konwn pattern operands. */
-+static hash_table<operand_data_hasher> *operand_datas;
-+
- /* Scan the list of operands we've already committed to output and either
- find a subsequence that is the same, or allocate a new one at the end. */
-
-@@ -569,6 +617,7 @@ static void
- place_operands (class data *d)
- {
- struct operand_data *od, *od2;
-+ struct operand_data **slot;
- int i;
-
- if (d->n_operands == 0)
-@@ -577,23 +626,24 @@ place_operands (class data *d)
- return;
- }
-
-+ od = operand_datas->find (&d->operand[0]);
- /* Brute force substring search. */
-- for (od = odata, i = 0; od; od = od->next, i = 0)
-- if (compare_operands (od, &d->operand[0]))
-- {
-- od2 = od->next;
-- i = 1;
-- while (1)
-- {
-- if (i == d->n_operands)
-- goto full_match;
-- if (od2 == NULL)
-- goto partial_match;
-- if (! compare_operands (od2, &d->operand[i]))
-- break;
-- ++i, od2 = od2->next;
-- }
-- }
-+ for (; od; od = od->eq_next)
-+ {
-+ od2 = od->next;
-+ i = 1;
-+ while (1)
-+ {
-+ if (i == d->n_operands)
-+ goto full_match;
-+ if (od2 == NULL)
-+ goto partial_match;
-+ if (! compare_operands (od2, &d->operand[i]))
-+ break;
-+ ++i, od2 = od2->next;
-+ }
-+ }
-+ i = 0;
-
- /* Either partial match at the end of the list, or no match. In either
- case, we tack on what operands are remaining to the end of the list. */
-@@ -605,6 +655,20 @@ place_operands (class data *d)
- *odata_end = od2;
- odata_end = &od2->next;
- od2->index = next_operand_number++;
-+ /* Insert the operand_data variable OD2 into the hash table.
-+ If a variable with the same hash value already exists in
-+ the hash table, insert the element at the end of the
-+ linked list connected through the eq_next member. */
-+ slot = operand_datas->find_slot (od2, INSERT);
-+ if (*slot)
-+ {
-+ struct operand_data *last = (struct operand_data *) *slot;
-+ while (last->eq_next)
-+ last = last->eq_next;
-+ last->eq_next = od2;
-+ }
-+ else
-+ *slot = od2;
- }
- *odata_end = NULL;
- return;
-@@ -1049,6 +1113,7 @@ main (int argc, const char **argv)
- progname = "genoutput";
-
- init_insn_for_nothing ();
-+ operand_datas = new hash_table<operand_data_hasher> (1024);
-
- if (!init_rtx_reader_args (argc, argv))
- return (FATAL_EXIT_CODE);
---
-2.45.2
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-19 18:43 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-19 18:43 UTC (permalink / raw
To: gentoo-commits
commit: b151680d1549ca7429f970c87b7c11987a351527
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 19 18:42:11 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 19 18:42:11 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b151680d
15.0.0: pull in phiopt fixes
Bug: https://bugs.gentoo.org/938203
Bug: https://bugs.gentoo.org/938200
Bug: https://bugs.gentoo.org/938199
Bug: https://bugs.gentoo.org/938198
Bug: https://bugs.gentoo.org/938196
Bug: https://bugs.gentoo.org/938194
Bug: https://bugs.gentoo.org/938193
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-for-non-const-functions-for-factor_out_c.patch | 100 +++++++++++++++++++++
...ct-non-gimple-val-inside-factor_out_condi.patch | 64 +++++++++++++
15.0.0/gentoo/README.history | 5 +-
3 files changed, 167 insertions(+), 2 deletions(-)
diff --git a/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch b/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
new file mode 100644
index 0000000..1920001
--- /dev/null
+++ b/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
@@ -0,0 +1,100 @@
+From 8d5c584e088109e39402221f59c2330b24bed142 Mon Sep 17 00:00:00 2001
+Message-ID: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
+From: Andrew Pinski <quic_apinski@quicinc.com>
+Date: Mon, 19 Aug 2024 11:37:13 -0700
+Subject: [PATCH 1/2] phi-opt: Fix for non-const functions for
+ factor_out_conditional_operation [PR 116409]
+
+Currently maybe_push_res_to_seq does not handle non-const builtins (it does handle internal
+functions though). So we need to disable factoring out non-const builtins. This will be fixed in
+a better way later but this fixes the regression at hand and does not change what was goal on
+moving factor_out_conditional_operation over to use gimple_match_op.
+
+Bootstrapped and tested on x86_64-linux-gnu with no regressions.
+
+ PR tree-optimization/116409
+
+gcc/ChangeLog:
+
+ * tree-ssa-phiopt.cc (factor_out_conditional_operation): Reject
+ non const builtins (except for internal functions).
+
+gcc/testsuite/ChangeLog:
+
+ * gcc.dg/torture/pr116409-1.c: New test.
+ * gcc.dg/torture/pr116409-2.c: New test.
+
+Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
+---
+ gcc/testsuite/gcc.dg/torture/pr116409-1.c | 7 +++++++
+ gcc/testsuite/gcc.dg/torture/pr116409-2.c | 7 +++++++
+ gcc/tree-ssa-phiopt.cc | 18 ++++++++++++++++++
+ 3 files changed, 32 insertions(+)
+ create mode 100644 gcc/testsuite/gcc.dg/torture/pr116409-1.c
+ create mode 100644 gcc/testsuite/gcc.dg/torture/pr116409-2.c
+
+diff --git a/gcc/testsuite/gcc.dg/torture/pr116409-1.c b/gcc/testsuite/gcc.dg/torture/pr116409-1.c
+new file mode 100644
+index 000000000000..7bf8d49c9a01
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr116409-1.c
+@@ -0,0 +1,7 @@
++/* { dg-do compile } */
++/* { dg-additional-options "-frounding-math -fno-math-errno" } */
++double f(int c, double a, double b) {
++ if (c)
++ return __builtin_sqrt(a);
++ return __builtin_sqrt(b);
++}
+diff --git a/gcc/testsuite/gcc.dg/torture/pr116409-2.c b/gcc/testsuite/gcc.dg/torture/pr116409-2.c
+new file mode 100644
+index 000000000000..c27f11312d98
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr116409-2.c
+@@ -0,0 +1,7 @@
++/* { dg-do compile } */
++
++int f (int t, char *a, char *b) {
++ if (t)
++ return __builtin_strlen (a);
++ return __builtin_strlen (b);
++}
+diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
+index 2d4aba5b0872..770f3629fe1d 100644
+--- a/gcc/tree-ssa-phiopt.cc
++++ b/gcc/tree-ssa-phiopt.cc
+@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "dbgcnt.h"
+ #include "tree-ssa-propagate.h"
+ #include "tree-ssa-dce.h"
++#include "calls.h"
+
+ /* Return the singleton PHI in the SEQ of PHIs for edges E0 and E1. */
+
+@@ -367,6 +368,23 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi,
+ if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
+ return NULL;
+
++ /* Function calls can only be const or an internal function
++ as maybe_push_res_to_seq only handles those currently. */
++ if (!arg0_op.code.is_tree_code ())
++ {
++ auto fn = combined_fn (arg0_op.code);
++ if (!internal_fn_p (fn))
++ {
++ tree decl = builtin_decl_implicit (as_builtin_fn (fn));
++ if (!decl)
++ return NULL;
++
++ /* Non-const functions are not supported currently. */
++ if (!(flags_from_decl_or_type (decl) & ECF_CONST))
++ return NULL;
++ }
++ }
++
+ /* Create a new PHI stmt. */
+ result = PHI_RESULT (phi);
+ temp = make_ssa_name (TREE_TYPE (new_arg0), NULL);
+--
+2.46.0
+
diff --git a/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch b/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
new file mode 100644
index 0000000..b3f96ae
--- /dev/null
+++ b/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
@@ -0,0 +1,64 @@
+From 555a5e896480884c3fe2c6c117654a798b8ffd3f Mon Sep 17 00:00:00 2001
+Message-ID: <555a5e896480884c3fe2c6c117654a798b8ffd3f.1724092858.git.sam@gentoo.org>
+In-Reply-To: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
+References: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
+From: Andrew Pinski <quic_apinski@quicinc.com>
+Date: Mon, 19 Aug 2024 11:37:14 -0700
+Subject: [PATCH 2/2] phiopt: Reject non gimple val inside
+ factor_out_conditional_operation [PR116412]
+
+After the conversion to use maybe_push_res_to_seq, sometimes (REALPART_EXPR
+and IMAGPART_EXPR and VCE) the argument will not be a gimple value and
+then phiopt here would create an invalid PHI.
+Just add a check for gimple val is the way to fix this.
+
+Bootstrapped and tested on x86_64-linux-gnu.
+
+ PR tree-optimization/116412
+
+gcc/ChangeLog:
+
+ * tree-ssa-phiopt.cc (factor_out_conditional_operation): Make sure new_arg0
+ and new_arg1 are both gimple values.
+
+gcc/testsuite/ChangeLog:
+
+ * gcc.dg/torture/pr116412-1.c: New test.
+
+Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
+---
+ gcc/testsuite/gcc.dg/torture/pr116412-1.c | 6 ++++++
+ gcc/tree-ssa-phiopt.cc | 4 ++++
+ 2 files changed, 10 insertions(+)
+ create mode 100644 gcc/testsuite/gcc.dg/torture/pr116412-1.c
+
+diff --git a/gcc/testsuite/gcc.dg/torture/pr116412-1.c b/gcc/testsuite/gcc.dg/torture/pr116412-1.c
+new file mode 100644
+index 000000000000..3bc26ecd8b83
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr116412-1.c
+@@ -0,0 +1,6 @@
++/* { dg-do compile } */
++double f(_Complex double a, _Complex double *b, int c)
++{
++ if (c) return __real__ a;
++ return __real__ *b;
++}
+diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
+index 770f3629fe1d..be95798a065b 100644
+--- a/gcc/tree-ssa-phiopt.cc
++++ b/gcc/tree-ssa-phiopt.cc
+@@ -368,6 +368,10 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi,
+ if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
+ return NULL;
+
++ /* The new args need to be both gimple values. */
++ if (!is_gimple_val (new_arg0) || !is_gimple_val (new_arg1))
++ return NULL;
++
+ /* Function calls can only be const or an internal function
+ as maybe_push_res_to_seq only handles those currently. */
+ if (!arg0_op.code.is_tree_code ())
+--
+2.46.0
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 1849089..0c430eb 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,6 +1,7 @@
-10 ????
+10 19 August 2024
- + 32_all_genoutput-speedup.patch
+ + 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
+ + 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
9 11 August 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-20 20:31 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-20 20:31 UTC (permalink / raw
To: gentoo-commits
commit: c9cf4331e4dfb52d6752adf48c161060fe6ef00a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 20 20:30:42 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Aug 20 20:30:42 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c9cf4331
15.0.0: drop now-upstream phiopt patches
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-for-non-const-functions-for-factor_out_c.patch | 100 ---------------------
...ct-non-gimple-val-inside-factor_out_condi.patch | 64 -------------
15.0.0/gentoo/README.history | 5 ++
3 files changed, 5 insertions(+), 164 deletions(-)
diff --git a/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch b/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
deleted file mode 100644
index 1920001..0000000
--- a/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 8d5c584e088109e39402221f59c2330b24bed142 Mon Sep 17 00:00:00 2001
-Message-ID: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
-From: Andrew Pinski <quic_apinski@quicinc.com>
-Date: Mon, 19 Aug 2024 11:37:13 -0700
-Subject: [PATCH 1/2] phi-opt: Fix for non-const functions for
- factor_out_conditional_operation [PR 116409]
-
-Currently maybe_push_res_to_seq does not handle non-const builtins (it does handle internal
-functions though). So we need to disable factoring out non-const builtins. This will be fixed in
-a better way later but this fixes the regression at hand and does not change what was goal on
-moving factor_out_conditional_operation over to use gimple_match_op.
-
-Bootstrapped and tested on x86_64-linux-gnu with no regressions.
-
- PR tree-optimization/116409
-
-gcc/ChangeLog:
-
- * tree-ssa-phiopt.cc (factor_out_conditional_operation): Reject
- non const builtins (except for internal functions).
-
-gcc/testsuite/ChangeLog:
-
- * gcc.dg/torture/pr116409-1.c: New test.
- * gcc.dg/torture/pr116409-2.c: New test.
-
-Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
----
- gcc/testsuite/gcc.dg/torture/pr116409-1.c | 7 +++++++
- gcc/testsuite/gcc.dg/torture/pr116409-2.c | 7 +++++++
- gcc/tree-ssa-phiopt.cc | 18 ++++++++++++++++++
- 3 files changed, 32 insertions(+)
- create mode 100644 gcc/testsuite/gcc.dg/torture/pr116409-1.c
- create mode 100644 gcc/testsuite/gcc.dg/torture/pr116409-2.c
-
-diff --git a/gcc/testsuite/gcc.dg/torture/pr116409-1.c b/gcc/testsuite/gcc.dg/torture/pr116409-1.c
-new file mode 100644
-index 000000000000..7bf8d49c9a01
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr116409-1.c
-@@ -0,0 +1,7 @@
-+/* { dg-do compile } */
-+/* { dg-additional-options "-frounding-math -fno-math-errno" } */
-+double f(int c, double a, double b) {
-+ if (c)
-+ return __builtin_sqrt(a);
-+ return __builtin_sqrt(b);
-+}
-diff --git a/gcc/testsuite/gcc.dg/torture/pr116409-2.c b/gcc/testsuite/gcc.dg/torture/pr116409-2.c
-new file mode 100644
-index 000000000000..c27f11312d98
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr116409-2.c
-@@ -0,0 +1,7 @@
-+/* { dg-do compile } */
-+
-+int f (int t, char *a, char *b) {
-+ if (t)
-+ return __builtin_strlen (a);
-+ return __builtin_strlen (b);
-+}
-diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
-index 2d4aba5b0872..770f3629fe1d 100644
---- a/gcc/tree-ssa-phiopt.cc
-+++ b/gcc/tree-ssa-phiopt.cc
-@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
- #include "dbgcnt.h"
- #include "tree-ssa-propagate.h"
- #include "tree-ssa-dce.h"
-+#include "calls.h"
-
- /* Return the singleton PHI in the SEQ of PHIs for edges E0 and E1. */
-
-@@ -367,6 +368,23 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi,
- if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
- return NULL;
-
-+ /* Function calls can only be const or an internal function
-+ as maybe_push_res_to_seq only handles those currently. */
-+ if (!arg0_op.code.is_tree_code ())
-+ {
-+ auto fn = combined_fn (arg0_op.code);
-+ if (!internal_fn_p (fn))
-+ {
-+ tree decl = builtin_decl_implicit (as_builtin_fn (fn));
-+ if (!decl)
-+ return NULL;
-+
-+ /* Non-const functions are not supported currently. */
-+ if (!(flags_from_decl_or_type (decl) & ECF_CONST))
-+ return NULL;
-+ }
-+ }
-+
- /* Create a new PHI stmt. */
- result = PHI_RESULT (phi);
- temp = make_ssa_name (TREE_TYPE (new_arg0), NULL);
---
-2.46.0
-
diff --git a/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch b/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
deleted file mode 100644
index b3f96ae..0000000
--- a/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 555a5e896480884c3fe2c6c117654a798b8ffd3f Mon Sep 17 00:00:00 2001
-Message-ID: <555a5e896480884c3fe2c6c117654a798b8ffd3f.1724092858.git.sam@gentoo.org>
-In-Reply-To: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
-References: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
-From: Andrew Pinski <quic_apinski@quicinc.com>
-Date: Mon, 19 Aug 2024 11:37:14 -0700
-Subject: [PATCH 2/2] phiopt: Reject non gimple val inside
- factor_out_conditional_operation [PR116412]
-
-After the conversion to use maybe_push_res_to_seq, sometimes (REALPART_EXPR
-and IMAGPART_EXPR and VCE) the argument will not be a gimple value and
-then phiopt here would create an invalid PHI.
-Just add a check for gimple val is the way to fix this.
-
-Bootstrapped and tested on x86_64-linux-gnu.
-
- PR tree-optimization/116412
-
-gcc/ChangeLog:
-
- * tree-ssa-phiopt.cc (factor_out_conditional_operation): Make sure new_arg0
- and new_arg1 are both gimple values.
-
-gcc/testsuite/ChangeLog:
-
- * gcc.dg/torture/pr116412-1.c: New test.
-
-Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
----
- gcc/testsuite/gcc.dg/torture/pr116412-1.c | 6 ++++++
- gcc/tree-ssa-phiopt.cc | 4 ++++
- 2 files changed, 10 insertions(+)
- create mode 100644 gcc/testsuite/gcc.dg/torture/pr116412-1.c
-
-diff --git a/gcc/testsuite/gcc.dg/torture/pr116412-1.c b/gcc/testsuite/gcc.dg/torture/pr116412-1.c
-new file mode 100644
-index 000000000000..3bc26ecd8b83
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr116412-1.c
-@@ -0,0 +1,6 @@
-+/* { dg-do compile } */
-+double f(_Complex double a, _Complex double *b, int c)
-+{
-+ if (c) return __real__ a;
-+ return __real__ *b;
-+}
-diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
-index 770f3629fe1d..be95798a065b 100644
---- a/gcc/tree-ssa-phiopt.cc
-+++ b/gcc/tree-ssa-phiopt.cc
-@@ -368,6 +368,10 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi,
- if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
- return NULL;
-
-+ /* The new args need to be both gimple values. */
-+ if (!is_gimple_val (new_arg0) || !is_gimple_val (new_arg1))
-+ return NULL;
-+
- /* Function calls can only be const or an internal function
- as maybe_push_res_to_seq only handles those currently. */
- if (!arg0_op.code.is_tree_code ())
---
-2.46.0
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 0c430eb..82e55aa 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+11 ????
+
+ - 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
+ - 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
+
10 19 August 2024
+ 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-23 13:51 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-23 13:51 UTC (permalink / raw
To: gentoo-commits
commit: fec800d970afa89845479d5d6ad58140eaae5035
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 07:57:11 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 23 13:51:19 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=fec800d9
15.0.0: add 09_all_esysroot.patch
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/09_all_esysroot.patch | 67 +++++++++++++++++++++++++++++++++++++
15.0.0/gentoo/README.history | 1 +
2 files changed, 68 insertions(+)
diff --git a/15.0.0/gentoo/09_all_esysroot.patch b/15.0.0/gentoo/09_all_esysroot.patch
new file mode 100644
index 0000000..80e0561
--- /dev/null
+++ b/15.0.0/gentoo/09_all_esysroot.patch
@@ -0,0 +1,67 @@
+From 71e048084d32811f6e17e73b6ebadfe550ef1193 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sun, 4 Aug 2024 17:02:06 +0100
+Subject: [PATCH] Allow setting target sysroot with ESYSROOT env var for
+ cross-compilers
+
+The variable is ignored for native compilers. The --sysroot command line
+option takes precedence.
+
+Signed-off-by: James Le Cuirot <chewi@gentoo.org>
+---
+ gcc/doc/invoke.texi | 10 ++++++++++
+ gcc/gcc.cc | 10 ++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index 0fe99ca8e..434cf30e2 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -19230,6 +19230,10 @@ for this option. If your linker does not support this option, the
+ header file aspect of @option{--sysroot} still works, but the
+ library aspect does not.
+
++On Gentoo Linux, this option can also be set for cross-compilers using the
++@env{ESYSROOT} environmnent variable. The variable is ignored for native
++compilers. The command line option takes precedence.
++
+ @opindex no-sysroot-suffix
+ @item --no-sysroot-suffix
+ For some targets, a suffix is added to the root directory specified
+@@ -37657,6 +37661,12 @@ using GCC also uses these directories when searching for ordinary
+ libraries for the @option{-l} option (but directories specified with
+ @option{-L} come first).
+
++@vindex ESYSROOT
++@item ESYSROOT
++On Gentoo Linux, this variable sets the logical root directory for headers and
++libraries for cross-compilers. It is ignored for native compilers. The
++@option{--sysroot} option takes precedence.
++
+ @vindex LANG
+ @cindex locale definition
+ @item LANG
+diff --git a/gcc/gcc.cc b/gcc/gcc.cc
+index abdb40bfe..956363ddb 100644
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -5516,6 +5516,16 @@ process_command (unsigned int decoded_options_count,
+ "BINUTILS", PREFIX_PRIORITY_LAST, 0, 1);
+ free (tooldir_prefix);
+
++ if (*cross_compile == '1' && !target_system_root_changed)
++ {
++ const char *esysroot = env.get("ESYSROOT");
++ if (esysroot && esysroot[0] != '\0' && strcmp(esysroot, "/") != 0 && (!target_system_root || strcmp(esysroot, target_system_root) != 0))
++ {
++ target_system_root = esysroot;
++ target_system_root_changed = 1;
++ }
++ }
++
+ #if defined(TARGET_SYSTEM_ROOT_RELOCATABLE) && !defined(VMS)
+ /* If the normal TARGET_SYSTEM_ROOT is inside of $exec_prefix,
+ then consider it to relocate with the rest of the GCC installation
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 82e55aa..76096c4 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -2,6 +2,7 @@
- 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
- 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
+ + 09_all_esysroot.patch
10 19 August 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-26 6:24 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-26 6:24 UTC (permalink / raw
To: gentoo-commits
commit: b6fdeaf382dd20760fc3baf1ca9ff3db9f58c14d
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 26 06:23:04 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 06:23:13 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b6fdeaf3
15.0.0: cut 11 patchset, add two patches
* Add an ICE fix for vectorization (PR116348)
* Fix bootstrap on x86 w/ debug info (PR116470)
Bug: https://gcc.gnu.org/PR116348
Bug: https://gcc.gnu.org/PR116470
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gentoo/32_all_PR116470-debug-bootstrap.patch | 78 ++++++++++++++++++++++
15.0.0/gentoo/33_all_PR116348-vect.patch | 78 ++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +-
3 files changed, 159 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch b/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch
new file mode 100644
index 0000000..613cf4c
--- /dev/null
+++ b/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch
@@ -0,0 +1,78 @@
+https://gcc.gnu.org/PR116470
+https://inbox.sourceware.org/gcc-patches/AS1PR01MB946587924CF9EFA4950ECBAFE48B2@AS1PR01MB9465.eurprd01.prod.exchangelabs.com/
+
+From 9c7050effd98d868d59fbd5ec7eeff1160eb05b8 Mon Sep 17 00:00:00 2001
+Message-ID: <9c7050effd98d868d59fbd5ec7eeff1160eb05b8.1724653254.git.sam@gentoo.org>
+From: Bernd Edlinger <bernd.edlinger@hotmail.de>
+Date: Mon, 26 Aug 2024 05:46:16 +0200
+Subject: [PATCH] Fix bootstap-errors due to enabling -gvariable-location-views
+
+This recent change triggered various bootsteap-errors, mostly on
+x86 targets because line info advance address entries were output
+in the wrong section table.
+The switch to the wrong line table happened in dwarfout_set_ignored_loc.
+It must use the same section as the earlier called
+dwarf2out_switch_text_section.
+
+But also ft32-elf was affected, because the assembler choked on
+something simple as ".2byte .LM2-.LM1", but fortunately it is
+able to use native location views, the configure test was just
+not executed because the ft32 "nop" instruction was missing.
+
+gcc/ChangeLog:
+
+PR debug/116470
+ * configure.ac: Add the "nop" instruction for cpu type ft32.
+ * configure: Regenerate.
+ * dwarf2out.cc (dwarf2out_set_ignored_loc): Use the correct
+ line info section.
+---
+ gcc/configure | 2 +-
+ gcc/configure.ac | 2 +-
+ gcc/dwarf2out.cc | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 557ea5fa3ac9..3d301b6ecd3d 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -31398,7 +31398,7 @@ esac
+ case "$cpu_type" in
+ aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
+ | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
+- | visium | xstormy16 | xtensa)
++ | visium | xstormy16 | xtensa | ft32)
+ insn="nop"
+ ;;
+ ia64 | s390)
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index eaa01d0d7e56..8a2d2b0438e7 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5610,7 +5610,7 @@ esac
+ case "$cpu_type" in
+ aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
+ | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
+- | visium | xstormy16 | xtensa)
++ | visium | xstormy16 | xtensa | ft32)
+ insn="nop"
+ ;;
+ ia64 | s390)
+diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
+index 633900b035fe..3f040da33a63 100644
+--- a/gcc/dwarf2out.cc
++++ b/gcc/dwarf2out.cc
+@@ -28939,7 +28939,7 @@ dwarf2out_set_ignored_loc (unsigned int line, unsigned int column,
+ dw_fde_ref fde = cfun->fde;
+
+ fde->ignored_debug = false;
+- set_cur_line_info_table (function_section (fde->decl));
++ set_cur_line_info_table (current_function_section ());
+
+ dwarf2out_source_line (line, column, filename, 0, true);
+ }
+
+base-commit: b4ac2c23d8745d98984954e88f02aa73f1c3594b
+--
+2.46.0
+
diff --git a/15.0.0/gentoo/33_all_PR116348-vect.patch b/15.0.0/gentoo/33_all_PR116348-vect.patch
new file mode 100644
index 0000000..623ce34
--- /dev/null
+++ b/15.0.0/gentoo/33_all_PR116348-vect.patch
@@ -0,0 +1,78 @@
+https://gcc.gnu.org/PR116348
+https://inbox.sourceware.org/gcc-patches/20240825185348.37025-1-xry111@xry111.site/T/#u
+
+From cc68092ef1bb1134f6d8ddf0281323658a4358ae Mon Sep 17 00:00:00 2001
+Message-ID: <cc68092ef1bb1134f6d8ddf0281323658a4358ae.1724653336.git.sam@gentoo.org>
+From: Xi Ruoyao <xry111@xry111.site>
+Date: Mon, 26 Aug 2024 02:53:13 +0800
+Subject: [PATCH] vect: Fix STMT_VINFO_DEF_TYPE check for odd/even widen mult
+ [PR116348]
+
+After fixing PR116142 some code started to trigger an ICE with -O3
+-march=znver4. Per Richard Biener who actually made this fix:
+
+"supportable_widening_operation fails at transform time - that's likely
+because vectorizable_reduction "puns" defs to internal_def"
+
+so the check should use STMT_VINFO_REDUC_DEF instead of checking if
+STMT_VINFO_DEF_TYPE is vect_reduction_def.
+
+gcc/ChangeLog:
+
+ PR tree-optimization/PR116348
+ * tree-vect-stmts.cc (supportable_widening_operation): Use
+ STMT_VINFO_REDUC_DEF (x) instead of
+ STMT_VINFO_DEF_TYPE (x) == vect_reduction_def.
+
+gcc/testsuite/ChangeLog:
+
+ PR tree-optimization/PR116348
+ * gcc.c-torture/compile/pr116438.c: New test.
+
+Co-authored-by: Richard Biener <rguenther@suse.de>
+---
+ gcc/testsuite/gcc.c-torture/compile/pr116438.c | 14 ++++++++++++++
+ gcc/tree-vect-stmts.cc | 3 +--
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr116438.c
+
+diff --git a/gcc/testsuite/gcc.c-torture/compile/pr116438.c b/gcc/testsuite/gcc.c-torture/compile/pr116438.c
+new file mode 100644
+index 000000000000..97ab0181ab8b
+--- /dev/null
++++ b/gcc/testsuite/gcc.c-torture/compile/pr116438.c
+@@ -0,0 +1,14 @@
++/* { dg-additional-options "-march=znver4" { target x86_64-*-* i?86-*-* } } */
++
++int *a;
++int b;
++long long c, d;
++void
++e (int f)
++{
++ for (; f; f++)
++ {
++ d += (long long)a[f] * b;
++ c += (long long)a[f] * 3;
++ }
++}
+diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
+index 385e63163c24..9eb73a599339 100644
+--- a/gcc/tree-vect-stmts.cc
++++ b/gcc/tree-vect-stmts.cc
+@@ -14193,8 +14193,7 @@ supportable_widening_operation (vec_info *vinfo,
+ by STMT is only directly used in the reduction statement. */
+ tree lhs = gimple_assign_lhs (vect_orig_stmt (stmt_info)->stmt);
+ stmt_vec_info use_stmt_info = loop_info->lookup_single_use (lhs);
+- if (use_stmt_info
+- && STMT_VINFO_DEF_TYPE (use_stmt_info) == vect_reduction_def)
++ if (use_stmt_info && STMT_VINFO_REDUC_DEF (use_stmt_info))
+ return true;
+ }
+ c1 = VEC_WIDEN_MULT_LO_EXPR;
+
+base-commit: b4ac2c23d8745d98984954e88f02aa73f1c3594b
+prerequisite-patch-id: 743f4e4444f9cac24e67abce2bda52d6a421d870
+--
+2.46.0
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 76096c4..728080e 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,8 +1,10 @@
-11 ????
+11 26 August 2024
- 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
- 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
+ 09_all_esysroot.patch
+ + 32_all_PR116470-debug-bootstrap.patch
+ + 33_all_PR116348-vect.patch
10 19 August 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-26 13:44 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-08-26 13:44 UTC (permalink / raw
To: gentoo-commits
commit: 24f7b8a07ce29ac39d8d3245a1ba7f7abf3dcfa1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 26 13:43:58 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 13:43:58 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=24f7b8a0
15.0.0: drop now-upstream patches
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gentoo/32_all_PR116470-debug-bootstrap.patch | 78 ----------------------
15.0.0/gentoo/33_all_PR116348-vect.patch | 78 ----------------------
15.0.0/gentoo/README.history | 5 ++
3 files changed, 5 insertions(+), 156 deletions(-)
diff --git a/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch b/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch
deleted file mode 100644
index 613cf4c..0000000
--- a/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-https://gcc.gnu.org/PR116470
-https://inbox.sourceware.org/gcc-patches/AS1PR01MB946587924CF9EFA4950ECBAFE48B2@AS1PR01MB9465.eurprd01.prod.exchangelabs.com/
-
-From 9c7050effd98d868d59fbd5ec7eeff1160eb05b8 Mon Sep 17 00:00:00 2001
-Message-ID: <9c7050effd98d868d59fbd5ec7eeff1160eb05b8.1724653254.git.sam@gentoo.org>
-From: Bernd Edlinger <bernd.edlinger@hotmail.de>
-Date: Mon, 26 Aug 2024 05:46:16 +0200
-Subject: [PATCH] Fix bootstap-errors due to enabling -gvariable-location-views
-
-This recent change triggered various bootsteap-errors, mostly on
-x86 targets because line info advance address entries were output
-in the wrong section table.
-The switch to the wrong line table happened in dwarfout_set_ignored_loc.
-It must use the same section as the earlier called
-dwarf2out_switch_text_section.
-
-But also ft32-elf was affected, because the assembler choked on
-something simple as ".2byte .LM2-.LM1", but fortunately it is
-able to use native location views, the configure test was just
-not executed because the ft32 "nop" instruction was missing.
-
-gcc/ChangeLog:
-
-PR debug/116470
- * configure.ac: Add the "nop" instruction for cpu type ft32.
- * configure: Regenerate.
- * dwarf2out.cc (dwarf2out_set_ignored_loc): Use the correct
- line info section.
----
- gcc/configure | 2 +-
- gcc/configure.ac | 2 +-
- gcc/dwarf2out.cc | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/gcc/configure b/gcc/configure
-index 557ea5fa3ac9..3d301b6ecd3d 100755
---- a/gcc/configure
-+++ b/gcc/configure
-@@ -31398,7 +31398,7 @@ esac
- case "$cpu_type" in
- aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
- | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
-- | visium | xstormy16 | xtensa)
-+ | visium | xstormy16 | xtensa | ft32)
- insn="nop"
- ;;
- ia64 | s390)
-diff --git a/gcc/configure.ac b/gcc/configure.ac
-index eaa01d0d7e56..8a2d2b0438e7 100644
---- a/gcc/configure.ac
-+++ b/gcc/configure.ac
-@@ -5610,7 +5610,7 @@ esac
- case "$cpu_type" in
- aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
- | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
-- | visium | xstormy16 | xtensa)
-+ | visium | xstormy16 | xtensa | ft32)
- insn="nop"
- ;;
- ia64 | s390)
-diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
-index 633900b035fe..3f040da33a63 100644
---- a/gcc/dwarf2out.cc
-+++ b/gcc/dwarf2out.cc
-@@ -28939,7 +28939,7 @@ dwarf2out_set_ignored_loc (unsigned int line, unsigned int column,
- dw_fde_ref fde = cfun->fde;
-
- fde->ignored_debug = false;
-- set_cur_line_info_table (function_section (fde->decl));
-+ set_cur_line_info_table (current_function_section ());
-
- dwarf2out_source_line (line, column, filename, 0, true);
- }
-
-base-commit: b4ac2c23d8745d98984954e88f02aa73f1c3594b
---
-2.46.0
-
diff --git a/15.0.0/gentoo/33_all_PR116348-vect.patch b/15.0.0/gentoo/33_all_PR116348-vect.patch
deleted file mode 100644
index 623ce34..0000000
--- a/15.0.0/gentoo/33_all_PR116348-vect.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-https://gcc.gnu.org/PR116348
-https://inbox.sourceware.org/gcc-patches/20240825185348.37025-1-xry111@xry111.site/T/#u
-
-From cc68092ef1bb1134f6d8ddf0281323658a4358ae Mon Sep 17 00:00:00 2001
-Message-ID: <cc68092ef1bb1134f6d8ddf0281323658a4358ae.1724653336.git.sam@gentoo.org>
-From: Xi Ruoyao <xry111@xry111.site>
-Date: Mon, 26 Aug 2024 02:53:13 +0800
-Subject: [PATCH] vect: Fix STMT_VINFO_DEF_TYPE check for odd/even widen mult
- [PR116348]
-
-After fixing PR116142 some code started to trigger an ICE with -O3
--march=znver4. Per Richard Biener who actually made this fix:
-
-"supportable_widening_operation fails at transform time - that's likely
-because vectorizable_reduction "puns" defs to internal_def"
-
-so the check should use STMT_VINFO_REDUC_DEF instead of checking if
-STMT_VINFO_DEF_TYPE is vect_reduction_def.
-
-gcc/ChangeLog:
-
- PR tree-optimization/PR116348
- * tree-vect-stmts.cc (supportable_widening_operation): Use
- STMT_VINFO_REDUC_DEF (x) instead of
- STMT_VINFO_DEF_TYPE (x) == vect_reduction_def.
-
-gcc/testsuite/ChangeLog:
-
- PR tree-optimization/PR116348
- * gcc.c-torture/compile/pr116438.c: New test.
-
-Co-authored-by: Richard Biener <rguenther@suse.de>
----
- gcc/testsuite/gcc.c-torture/compile/pr116438.c | 14 ++++++++++++++
- gcc/tree-vect-stmts.cc | 3 +--
- 2 files changed, 15 insertions(+), 2 deletions(-)
- create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr116438.c
-
-diff --git a/gcc/testsuite/gcc.c-torture/compile/pr116438.c b/gcc/testsuite/gcc.c-torture/compile/pr116438.c
-new file mode 100644
-index 000000000000..97ab0181ab8b
---- /dev/null
-+++ b/gcc/testsuite/gcc.c-torture/compile/pr116438.c
-@@ -0,0 +1,14 @@
-+/* { dg-additional-options "-march=znver4" { target x86_64-*-* i?86-*-* } } */
-+
-+int *a;
-+int b;
-+long long c, d;
-+void
-+e (int f)
-+{
-+ for (; f; f++)
-+ {
-+ d += (long long)a[f] * b;
-+ c += (long long)a[f] * 3;
-+ }
-+}
-diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
-index 385e63163c24..9eb73a599339 100644
---- a/gcc/tree-vect-stmts.cc
-+++ b/gcc/tree-vect-stmts.cc
-@@ -14193,8 +14193,7 @@ supportable_widening_operation (vec_info *vinfo,
- by STMT is only directly used in the reduction statement. */
- tree lhs = gimple_assign_lhs (vect_orig_stmt (stmt_info)->stmt);
- stmt_vec_info use_stmt_info = loop_info->lookup_single_use (lhs);
-- if (use_stmt_info
-- && STMT_VINFO_DEF_TYPE (use_stmt_info) == vect_reduction_def)
-+ if (use_stmt_info && STMT_VINFO_REDUC_DEF (use_stmt_info))
- return true;
- }
- c1 = VEC_WIDEN_MULT_LO_EXPR;
-
-base-commit: b4ac2c23d8745d98984954e88f02aa73f1c3594b
-prerequisite-patch-id: 743f4e4444f9cac24e67abce2bda52d6a421d870
---
-2.46.0
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 728080e..e1c375e 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+12 ????
+
+ - 32_all_PR116470-debug-bootstrap.patch
+ - 33_all_PR116348-vect.patch
+
11 26 August 2024
- 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-02 2:28 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-09-02 2:28 UTC (permalink / raw
To: gentoo-commits
commit: d676863b64b58bf73a7f26eea70f81aeba517b13
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 2 02:28:39 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 2 02:28:39 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d676863b
15.0.0: cut patchset 12
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index e1c375e..a035c01 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-12 ????
+12 1 September 2024
- 32_all_PR116470-debug-bootstrap.patch
- 33_all_PR116348-vect.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-23 15:23 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-09-23 15:23 UTC (permalink / raw
To: gentoo-commits
commit: 690e151179e3dc40e99b3beeb551ac50b321d456
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 15:23:35 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 15:23:35 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=690e1511
15.0.0: add 70_all_middle-end-check-explicitly-for-external-or-constant.patch
Bug: https://gcc.gnu.org/PR116817
Signed-off-by: Sam James <sam <AT> gentoo.org>
...check-explicitly-for-external-or-constant.patch | 93 ++++++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
new file mode 100644
index 0000000..6dcc1a4
--- /dev/null
+++ b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
@@ -0,0 +1,93 @@
+https://inbox.sourceware.org/gcc-patches/patch-18806-tamar@arm.com/T/#u
+https://gcc.gnu.org/PR116817
+
+From 9a5d1eb943dcaf26551b534eb62cbf1dd8443335 Mon Sep 17 00:00:00 2001
+Message-ID: <9a5d1eb943dcaf26551b534eb62cbf1dd8443335.1727104663.git.sam@gentoo.org>
+From: Tamar Christina <tamar.christina@arm.com>
+Date: Mon, 23 Sep 2024 15:29:52 +0100
+Subject: [PATCH] middle-end: check explicitly for external or constants when
+ checking for loop invariant [PR116817]
+
+Hi All,
+
+The previous check if a value was external was checking
+!vect_get_internal_def (vinfo, var) but this of course isn't completely right
+as they could reductions etc.
+
+This changes the check to just explicitly look at externals and constants.
+Note that reductions remain unhandled here, but we don't support codegen of
+boolean reductions today anyway.
+
+So at the time we do then this would have the be handled as well in lowering.
+
+Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
+
+Ok for master?
+
+Thanks,
+Tamar
+
+gcc/ChangeLog:
+
+ PR tree-optimization/116817
+ * tree-vect-patterns.cc (vect_recog_bool_pattern): Check for const or
+ externals.
+
+gcc/testsuite/ChangeLog:
+
+PR tree-optimization/116817
+ * g++.dg/vect/pr116817.cc: New test.
+---
+ gcc/testsuite/g++.dg/vect/pr116817.cc | 16 ++++++++++++++++
+ gcc/tree-vect-patterns.cc | 5 ++++-
+ 2 files changed, 20 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/g++.dg/vect/pr116817.cc
+
+diff --git a/gcc/testsuite/g++.dg/vect/pr116817.cc b/gcc/testsuite/g++.dg/vect/pr116817.cc
+new file mode 100644
+index 00000000000..7e28982fb13
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/vect/pr116817.cc
+@@ -0,0 +1,16 @@
++/* { dg-do compile } */
++/* { dg-additional-options "-O3" } */
++
++int main_ulData0;
++unsigned *main_pSrcBuffer;
++int main(void) {
++ int iSrc = 0;
++ bool bData0;
++ for (; iSrc < 4; iSrc++) {
++ if (bData0)
++ main_pSrcBuffer[iSrc] = main_ulData0;
++ else
++ main_pSrcBuffer[iSrc] = 0;
++ bData0 = !bData0;
++ }
++}
+diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
+index e7e877dd2ad..b913d6de003 100644
+--- a/gcc/tree-vect-patterns.cc
++++ b/gcc/tree-vect-patterns.cc
+@@ -6062,12 +6062,15 @@ vect_recog_bool_pattern (vec_info *vinfo,
+ if (get_vectype_for_scalar_type (vinfo, type) == NULL_TREE)
+ return NULL;
+
++ stmt_vec_info var_def_info = vinfo->lookup_def (var);
+ if (check_bool_pattern (var, vinfo, bool_stmts))
+ var = adjust_bool_stmts (vinfo, bool_stmts, type, stmt_vinfo);
+ else if (integer_type_for_mask (var, vinfo))
+ return NULL;
+ else if (TREE_CODE (TREE_TYPE (var)) == BOOLEAN_TYPE
+- && !vect_get_internal_def (vinfo, var))
++ && var_def_info
++ && (STMT_VINFO_DEF_TYPE (var_def_info) == vect_external_def
++ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_constant_def))
+ {
+ /* If the condition is already a boolean then manually convert it to a
+ mask of the given integer type but don't set a vectype. */
+
+base-commit: 358db2e3ed4acf44282d1d9ebbc4a1a3b6e38d21
+--
+2.46.1
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-24 1:41 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-09-24 1:41 UTC (permalink / raw
To: gentoo-commits
commit: 3e1c7a2699f90793d9bf7107cb0b5943ba7c76c1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 24 01:41:22 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 24 01:41:22 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3e1c7a26
15.0.0: update 70_all_middle-end-check-explicitly-for-external-or-constant.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
...middle-end-check-explicitly-for-external-or-constant.patch | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
index 6dcc1a4..7dcf89d 100644
--- a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
+++ b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
@@ -66,7 +66,7 @@ index 00000000000..7e28982fb13
+ }
+}
diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
-index e7e877dd2ad..b913d6de003 100644
+index e7e877dd2adb55262822f1660f8d92b42d44e6d0..f0298b2ab97a1e7dd0d943340e1389c3c0fa796e 100644
--- a/gcc/tree-vect-patterns.cc
+++ b/gcc/tree-vect-patterns.cc
@@ -6062,12 +6062,15 @@ vect_recog_bool_pattern (vec_info *vinfo,
@@ -80,14 +80,9 @@ index e7e877dd2ad..b913d6de003 100644
return NULL;
else if (TREE_CODE (TREE_TYPE (var)) == BOOLEAN_TYPE
- && !vect_get_internal_def (vinfo, var))
-+ && var_def_info
-+ && (STMT_VINFO_DEF_TYPE (var_def_info) == vect_external_def
++ && (!var_def_info
++ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_external_def
+ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_constant_def))
{
/* If the condition is already a boolean then manually convert it to a
mask of the given integer type but don't set a vectype. */
-
-base-commit: 358db2e3ed4acf44282d1d9ebbc4a1a3b6e38d21
---
-2.46.1
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-29 22:56 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-09-29 22:56 UTC (permalink / raw
To: gentoo-commits
commit: 891af478cc93ae3e2e176ed9739166799b814a05
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 22:55:02 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 22:55:28 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=891af478
15.0.0: add 71_all_PR116878-libcall.patch
It's been approved but not yet merged.
Bug: https://gcc.gnu.org/PR116616
Bug: https://gcc.gnu.org/PR116878
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/71_all_PR116878-libcall.patch | 215 ++++++++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +
2 files changed, 219 insertions(+)
diff --git a/15.0.0/gentoo/71_all_PR116878-libcall.patch b/15.0.0/gentoo/71_all_PR116878-libcall.patch
new file mode 100644
index 0000000..781196d
--- /dev/null
+++ b/15.0.0/gentoo/71_all_PR116878-libcall.patch
@@ -0,0 +1,215 @@
+https://gcc.gnu.org/PR116878
+https://gcc.gnu.org/PR116616
+
+From b9883d33e6338b1a44247b3f8772a5e5d2757593 Mon Sep 17 00:00:00 2001
+Message-ID: <b9883d33e6338b1a44247b3f8772a5e5d2757593.1727650422.git.sam@gentoo.org>
+From: Filip Kastl <fkastl@suse.cz>
+Date: Tue, 10 Sep 2024 19:22:27 +0200
+Subject: [PATCH] gimple ssa: Don't use __builtin_popcount in switch exp
+ transform
+
+Switch exponential transformation in the switch conversion pass
+currently generates
+
+tmp1 = __builtin_popcount (var);
+tmp2 = tmp1 == 1;
+
+when inserting code to determine if var is power of two. If the target
+doesn't support expanding the builtin as special instructions switch
+conversion relies on this whole pattern being expanded as bitmagic.
+However, it is possible that other GIMPLE optimizations move the two
+statements of the pattern apart. In that case the builtin becomes a
+libgcc call in the final binary. The call is slow and in case of
+freestanding programs can result in linking error (this bug was
+originally found while compiling Linux kernel).
+
+This patch modifies switch conversion to insert the bitmagic
+(var ^ (var - 1)) > (var - 1) instead of the builtin.
+
+gcc/ChangeLog:
+
+ PR tree-optimization/116616
+ * tree-switch-conversion.cc (can_pow2p): Remove this function.
+ (gen_pow2p): Generate bitmagic instead of a builtin. Remove the
+ TYPE parameter.
+ (switch_conversion::is_exp_index_transform_viable): Don't call
+ can_pow2p.
+ (switch_conversion::exp_index_transform): Call gen_pow2p without
+ the TYPE parameter.
+ * tree-switch-conversion.h: Remove
+ m_exp_index_transform_pow2p_type.
+
+gcc/testsuite/ChangeLog:
+
+ PR tree-optimization/116616
+ * gcc.target/i386/switch-exp-transform-1.c: Don't test for
+ presence of the POPCOUNT internal fn call.
+
+Signed-off-by: Filip Kastl <fkastl@suse.cz>
+---
+ .../gcc.target/i386/switch-exp-transform-1.c | 7 +-
+ gcc/tree-switch-conversion.cc | 84 +++++--------------
+ gcc/tree-switch-conversion.h | 6 +-
+ 3 files changed, 23 insertions(+), 74 deletions(-)
+
+diff --git a/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c b/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
+index a8c9e03e515f..4832f5b52c33 100644
+--- a/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
++++ b/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
+@@ -1,10 +1,8 @@
+ /* { dg-do compile } */
+-/* { dg-options "-O2 -fdump-tree-switchconv -fdump-tree-widening_mul -mpopcnt -mbmi" } */
++/* { dg-options "-O2 -fdump-tree-switchconv -mbmi" } */
+
+ /* Checks that exponential index transform enables switch conversion to convert
+- this switch into an array lookup. Also checks that the "index variable is a
+- power of two" check has been generated and that it has been later expanded
+- into an internal function. */
++ this switch into an array lookup. */
+
+ int foo(unsigned bar)
+ {
+@@ -30,4 +28,3 @@ int foo(unsigned bar)
+ }
+
+ /* { dg-final { scan-tree-dump "CSWTCH" "switchconv" } } */
+-/* { dg-final { scan-tree-dump "POPCOUNT" "widening_mul" } } */
+diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc
+index c1332a260943..00426d400006 100644
+--- a/gcc/tree-switch-conversion.cc
++++ b/gcc/tree-switch-conversion.cc
+@@ -133,75 +133,33 @@ gen_log2 (tree op, location_t loc, tree *result, tree type)
+ return stmts;
+ }
+
+-/* Is it possible to efficiently check that a value of TYPE is a power of 2?
+-
+- If yes, returns TYPE. If no, returns NULL_TREE. May also return another
+- type. This indicates that logarithm of the variable can be computed but
+- only after it is converted to this type.
+-
+- Also see gen_pow2p. */
+-
+-static tree
+-can_pow2p (tree type)
+-{
+- /* __builtin_popcount supports the unsigned type or its long and long long
+- variants. Choose the smallest out of those that can still fit TYPE. */
+- int prec = TYPE_PRECISION (type);
+- int i_prec = TYPE_PRECISION (unsigned_type_node);
+- int li_prec = TYPE_PRECISION (long_unsigned_type_node);
+- int lli_prec = TYPE_PRECISION (long_long_unsigned_type_node);
+-
+- if (prec <= i_prec)
+- return unsigned_type_node;
+- else if (prec <= li_prec)
+- return long_unsigned_type_node;
+- else if (prec <= lli_prec)
+- return long_long_unsigned_type_node;
+- else
+- return NULL_TREE;
+-}
+-
+-/* Build a sequence of gimple statements checking that OP is a power of 2. Use
+- special optabs if target supports them. Return the result as a
+- boolean_type_node ssa name through RESULT. Assumes that OP's value will
+- be non-negative. The generated check may give arbitrary answer for negative
+- values.
+-
+- Before computing the check, OP may have to be converted to another type.
+- This should be specified in TYPE. Use can_pow2p to decide what this type
+- should be.
+-
+- Should only be used if can_pow2p returns true for type of OP. */
++/* Build a sequence of gimple statements checking that OP is a power of 2.
++ Return the result as a boolean_type_node ssa name through RESULT. Assumes
++ that OP's value will be non-negative. The generated check may give
++ arbitrary answer for negative values. */
+
+ static gimple_seq
+-gen_pow2p (tree op, location_t loc, tree *result, tree type)
++gen_pow2p (tree op, location_t loc, tree *result)
+ {
+ gimple_seq stmts = NULL;
+ gimple_stmt_iterator gsi = gsi_last (stmts);
+
+- built_in_function fn;
+- if (type == unsigned_type_node)
+- fn = BUILT_IN_POPCOUNT;
+- else if (type == long_unsigned_type_node)
+- fn = BUILT_IN_POPCOUNTL;
+- else
+- {
+- fn = BUILT_IN_POPCOUNTLL;
+- gcc_checking_assert (type == long_long_unsigned_type_node);
+- }
++ tree type = TREE_TYPE (op);
++ tree utype = unsigned_type_for (type);
+
+- tree orig_type = TREE_TYPE (op);
++ /* Build (op ^ (op - 1)) > (op - 1). */
+ tree tmp1;
+- if (type != orig_type)
+- tmp1 = gimple_convert (&gsi, false, GSI_NEW_STMT, loc, type, op);
+- else
++ if (types_compatible_p (type, utype))
+ tmp1 = op;
+- /* Build __builtin_popcount{l,ll} (op) == 1. */
+- tree tmp2 = gimple_build (&gsi, false, GSI_NEW_STMT, loc,
+- as_combined_fn (fn), integer_type_node, tmp1);
+- *result = gimple_build (&gsi, false, GSI_NEW_STMT, loc, EQ_EXPR,
+- boolean_type_node, tmp2,
+- build_one_cst (integer_type_node));
++ else
++ tmp1 = gimple_convert (&gsi, false, GSI_NEW_STMT, loc, utype, op);
++ tree tmp2 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, MINUS_EXPR, utype,
++ tmp1, build_one_cst (utype));
++ tree tmp3 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, BIT_XOR_EXPR,
++ utype, tmp1, tmp2);
++ *result = gimple_build (&gsi, false, GSI_NEW_STMT, loc, GT_EXPR,
++ boolean_type_node, tmp3, tmp2);
++
+ return stmts;
+ }
+
+@@ -371,9 +329,6 @@ switch_conversion::is_exp_index_transform_viable (gswitch *swtch)
+ m_exp_index_transform_log2_type = can_log2 (index_type, opt_type);
+ if (!m_exp_index_transform_log2_type)
+ return false;
+- m_exp_index_transform_pow2p_type = can_pow2p (index_type);
+- if (!m_exp_index_transform_pow2p_type)
+- return false;
+
+ /* Check that each case label corresponds only to one value
+ (no case 1..3). */
+@@ -467,8 +422,7 @@ switch_conversion::exp_index_transform (gswitch *swtch)
+ new_edge2->probability = profile_probability::even ();
+
+ tree tmp;
+- gimple_seq stmts = gen_pow2p (index, UNKNOWN_LOCATION, &tmp,
+- m_exp_index_transform_pow2p_type);
++ gimple_seq stmts = gen_pow2p (index, UNKNOWN_LOCATION, &tmp);
+ gsi = gsi_last_bb (cond_bb);
+ gsi_insert_seq_after (&gsi, stmts, GSI_LAST_NEW_STMT);
+ gcond *stmt_cond = gimple_build_cond (NE_EXPR, tmp, boolean_false_node,
+diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h
+index 14610499e5fb..6468995eb316 100644
+--- a/gcc/tree-switch-conversion.h
++++ b/gcc/tree-switch-conversion.h
+@@ -920,11 +920,9 @@ public:
+ bool m_exp_index_transform_applied;
+
+ /* If switch conversion decided exponential index transform is viable, here
+- will be stored the types to which index variable has to be converted
+- before the logarithm and the "is power of 2" operations which are part of
+- the transform. */
++ will be stored the type to which index variable has to be converted
++ before the logarithm operation which is a part of the transform. */
+ tree m_exp_index_transform_log2_type;
+- tree m_exp_index_transform_pow2p_type;
+ };
+
+ void
+--
+2.46.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index a035c01..6c31450 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+13 29 September 2024
+
+ + 71_all_PR116878-libcall.patch
+
12 1 September 2024
- 32_all_PR116470-debug-bootstrap.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-30 14:05 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-09-30 14:05 UTC (permalink / raw
To: gentoo-commits
commit: 4dffefc137f5ba6524cdb6eb598313646c5df6c8
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 30 14:05:13 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 30 14:05:13 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4dffefc1
15.0.0: drop 70_all_middle-end-check-explicitly-for-external-or-constant.patch
Merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...check-explicitly-for-external-or-constant.patch | 88 ----------------------
15.0.0/gentoo/README.history | 5 ++
2 files changed, 5 insertions(+), 88 deletions(-)
diff --git a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
deleted file mode 100644
index 7dcf89d..0000000
--- a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-https://inbox.sourceware.org/gcc-patches/patch-18806-tamar@arm.com/T/#u
-https://gcc.gnu.org/PR116817
-
-From 9a5d1eb943dcaf26551b534eb62cbf1dd8443335 Mon Sep 17 00:00:00 2001
-Message-ID: <9a5d1eb943dcaf26551b534eb62cbf1dd8443335.1727104663.git.sam@gentoo.org>
-From: Tamar Christina <tamar.christina@arm.com>
-Date: Mon, 23 Sep 2024 15:29:52 +0100
-Subject: [PATCH] middle-end: check explicitly for external or constants when
- checking for loop invariant [PR116817]
-
-Hi All,
-
-The previous check if a value was external was checking
-!vect_get_internal_def (vinfo, var) but this of course isn't completely right
-as they could reductions etc.
-
-This changes the check to just explicitly look at externals and constants.
-Note that reductions remain unhandled here, but we don't support codegen of
-boolean reductions today anyway.
-
-So at the time we do then this would have the be handled as well in lowering.
-
-Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
-
-Ok for master?
-
-Thanks,
-Tamar
-
-gcc/ChangeLog:
-
- PR tree-optimization/116817
- * tree-vect-patterns.cc (vect_recog_bool_pattern): Check for const or
- externals.
-
-gcc/testsuite/ChangeLog:
-
-PR tree-optimization/116817
- * g++.dg/vect/pr116817.cc: New test.
----
- gcc/testsuite/g++.dg/vect/pr116817.cc | 16 ++++++++++++++++
- gcc/tree-vect-patterns.cc | 5 ++++-
- 2 files changed, 20 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/g++.dg/vect/pr116817.cc
-
-diff --git a/gcc/testsuite/g++.dg/vect/pr116817.cc b/gcc/testsuite/g++.dg/vect/pr116817.cc
-new file mode 100644
-index 00000000000..7e28982fb13
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/vect/pr116817.cc
-@@ -0,0 +1,16 @@
-+/* { dg-do compile } */
-+/* { dg-additional-options "-O3" } */
-+
-+int main_ulData0;
-+unsigned *main_pSrcBuffer;
-+int main(void) {
-+ int iSrc = 0;
-+ bool bData0;
-+ for (; iSrc < 4; iSrc++) {
-+ if (bData0)
-+ main_pSrcBuffer[iSrc] = main_ulData0;
-+ else
-+ main_pSrcBuffer[iSrc] = 0;
-+ bData0 = !bData0;
-+ }
-+}
-diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
-index e7e877dd2adb55262822f1660f8d92b42d44e6d0..f0298b2ab97a1e7dd0d943340e1389c3c0fa796e 100644
---- a/gcc/tree-vect-patterns.cc
-+++ b/gcc/tree-vect-patterns.cc
-@@ -6062,12 +6062,15 @@ vect_recog_bool_pattern (vec_info *vinfo,
- if (get_vectype_for_scalar_type (vinfo, type) == NULL_TREE)
- return NULL;
-
-+ stmt_vec_info var_def_info = vinfo->lookup_def (var);
- if (check_bool_pattern (var, vinfo, bool_stmts))
- var = adjust_bool_stmts (vinfo, bool_stmts, type, stmt_vinfo);
- else if (integer_type_for_mask (var, vinfo))
- return NULL;
- else if (TREE_CODE (TREE_TYPE (var)) == BOOLEAN_TYPE
-- && !vect_get_internal_def (vinfo, var))
-+ && (!var_def_info
-+ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_external_def
-+ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_constant_def))
- {
- /* If the condition is already a boolean then manually convert it to a
- mask of the given integer type but don't set a vectype. */
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 6c31450..819d192 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,5 +1,10 @@
+14 ????
+
+ - 70_all_middle-end-check-explicitly-for-external-or-constant.patch
+
13 29 September 2024
+ + 70_all_middle-end-check-explicitly-for-external-or-constant.patch
+ 71_all_PR116878-libcall.patch
12 1 September 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-02 19:45 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-02 19:45 UTC (permalink / raw
To: gentoo-commits
commit: 6566f31fc01e405d7cad5739140fb61e98b0dd82
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 2 19:44:53 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 2 19:44:53 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6566f31f
15.0.0: drop 71_all_PR116878-libcall.patch
Merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/71_all_PR116878-libcall.patch | 215 ----------------------------
15.0.0/gentoo/README.history | 1 +
2 files changed, 1 insertion(+), 215 deletions(-)
diff --git a/15.0.0/gentoo/71_all_PR116878-libcall.patch b/15.0.0/gentoo/71_all_PR116878-libcall.patch
deleted file mode 100644
index 781196d..0000000
--- a/15.0.0/gentoo/71_all_PR116878-libcall.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-https://gcc.gnu.org/PR116878
-https://gcc.gnu.org/PR116616
-
-From b9883d33e6338b1a44247b3f8772a5e5d2757593 Mon Sep 17 00:00:00 2001
-Message-ID: <b9883d33e6338b1a44247b3f8772a5e5d2757593.1727650422.git.sam@gentoo.org>
-From: Filip Kastl <fkastl@suse.cz>
-Date: Tue, 10 Sep 2024 19:22:27 +0200
-Subject: [PATCH] gimple ssa: Don't use __builtin_popcount in switch exp
- transform
-
-Switch exponential transformation in the switch conversion pass
-currently generates
-
-tmp1 = __builtin_popcount (var);
-tmp2 = tmp1 == 1;
-
-when inserting code to determine if var is power of two. If the target
-doesn't support expanding the builtin as special instructions switch
-conversion relies on this whole pattern being expanded as bitmagic.
-However, it is possible that other GIMPLE optimizations move the two
-statements of the pattern apart. In that case the builtin becomes a
-libgcc call in the final binary. The call is slow and in case of
-freestanding programs can result in linking error (this bug was
-originally found while compiling Linux kernel).
-
-This patch modifies switch conversion to insert the bitmagic
-(var ^ (var - 1)) > (var - 1) instead of the builtin.
-
-gcc/ChangeLog:
-
- PR tree-optimization/116616
- * tree-switch-conversion.cc (can_pow2p): Remove this function.
- (gen_pow2p): Generate bitmagic instead of a builtin. Remove the
- TYPE parameter.
- (switch_conversion::is_exp_index_transform_viable): Don't call
- can_pow2p.
- (switch_conversion::exp_index_transform): Call gen_pow2p without
- the TYPE parameter.
- * tree-switch-conversion.h: Remove
- m_exp_index_transform_pow2p_type.
-
-gcc/testsuite/ChangeLog:
-
- PR tree-optimization/116616
- * gcc.target/i386/switch-exp-transform-1.c: Don't test for
- presence of the POPCOUNT internal fn call.
-
-Signed-off-by: Filip Kastl <fkastl@suse.cz>
----
- .../gcc.target/i386/switch-exp-transform-1.c | 7 +-
- gcc/tree-switch-conversion.cc | 84 +++++--------------
- gcc/tree-switch-conversion.h | 6 +-
- 3 files changed, 23 insertions(+), 74 deletions(-)
-
-diff --git a/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c b/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
-index a8c9e03e515f..4832f5b52c33 100644
---- a/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
-+++ b/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
-@@ -1,10 +1,8 @@
- /* { dg-do compile } */
--/* { dg-options "-O2 -fdump-tree-switchconv -fdump-tree-widening_mul -mpopcnt -mbmi" } */
-+/* { dg-options "-O2 -fdump-tree-switchconv -mbmi" } */
-
- /* Checks that exponential index transform enables switch conversion to convert
-- this switch into an array lookup. Also checks that the "index variable is a
-- power of two" check has been generated and that it has been later expanded
-- into an internal function. */
-+ this switch into an array lookup. */
-
- int foo(unsigned bar)
- {
-@@ -30,4 +28,3 @@ int foo(unsigned bar)
- }
-
- /* { dg-final { scan-tree-dump "CSWTCH" "switchconv" } } */
--/* { dg-final { scan-tree-dump "POPCOUNT" "widening_mul" } } */
-diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc
-index c1332a260943..00426d400006 100644
---- a/gcc/tree-switch-conversion.cc
-+++ b/gcc/tree-switch-conversion.cc
-@@ -133,75 +133,33 @@ gen_log2 (tree op, location_t loc, tree *result, tree type)
- return stmts;
- }
-
--/* Is it possible to efficiently check that a value of TYPE is a power of 2?
--
-- If yes, returns TYPE. If no, returns NULL_TREE. May also return another
-- type. This indicates that logarithm of the variable can be computed but
-- only after it is converted to this type.
--
-- Also see gen_pow2p. */
--
--static tree
--can_pow2p (tree type)
--{
-- /* __builtin_popcount supports the unsigned type or its long and long long
-- variants. Choose the smallest out of those that can still fit TYPE. */
-- int prec = TYPE_PRECISION (type);
-- int i_prec = TYPE_PRECISION (unsigned_type_node);
-- int li_prec = TYPE_PRECISION (long_unsigned_type_node);
-- int lli_prec = TYPE_PRECISION (long_long_unsigned_type_node);
--
-- if (prec <= i_prec)
-- return unsigned_type_node;
-- else if (prec <= li_prec)
-- return long_unsigned_type_node;
-- else if (prec <= lli_prec)
-- return long_long_unsigned_type_node;
-- else
-- return NULL_TREE;
--}
--
--/* Build a sequence of gimple statements checking that OP is a power of 2. Use
-- special optabs if target supports them. Return the result as a
-- boolean_type_node ssa name through RESULT. Assumes that OP's value will
-- be non-negative. The generated check may give arbitrary answer for negative
-- values.
--
-- Before computing the check, OP may have to be converted to another type.
-- This should be specified in TYPE. Use can_pow2p to decide what this type
-- should be.
--
-- Should only be used if can_pow2p returns true for type of OP. */
-+/* Build a sequence of gimple statements checking that OP is a power of 2.
-+ Return the result as a boolean_type_node ssa name through RESULT. Assumes
-+ that OP's value will be non-negative. The generated check may give
-+ arbitrary answer for negative values. */
-
- static gimple_seq
--gen_pow2p (tree op, location_t loc, tree *result, tree type)
-+gen_pow2p (tree op, location_t loc, tree *result)
- {
- gimple_seq stmts = NULL;
- gimple_stmt_iterator gsi = gsi_last (stmts);
-
-- built_in_function fn;
-- if (type == unsigned_type_node)
-- fn = BUILT_IN_POPCOUNT;
-- else if (type == long_unsigned_type_node)
-- fn = BUILT_IN_POPCOUNTL;
-- else
-- {
-- fn = BUILT_IN_POPCOUNTLL;
-- gcc_checking_assert (type == long_long_unsigned_type_node);
-- }
-+ tree type = TREE_TYPE (op);
-+ tree utype = unsigned_type_for (type);
-
-- tree orig_type = TREE_TYPE (op);
-+ /* Build (op ^ (op - 1)) > (op - 1). */
- tree tmp1;
-- if (type != orig_type)
-- tmp1 = gimple_convert (&gsi, false, GSI_NEW_STMT, loc, type, op);
-- else
-+ if (types_compatible_p (type, utype))
- tmp1 = op;
-- /* Build __builtin_popcount{l,ll} (op) == 1. */
-- tree tmp2 = gimple_build (&gsi, false, GSI_NEW_STMT, loc,
-- as_combined_fn (fn), integer_type_node, tmp1);
-- *result = gimple_build (&gsi, false, GSI_NEW_STMT, loc, EQ_EXPR,
-- boolean_type_node, tmp2,
-- build_one_cst (integer_type_node));
-+ else
-+ tmp1 = gimple_convert (&gsi, false, GSI_NEW_STMT, loc, utype, op);
-+ tree tmp2 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, MINUS_EXPR, utype,
-+ tmp1, build_one_cst (utype));
-+ tree tmp3 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, BIT_XOR_EXPR,
-+ utype, tmp1, tmp2);
-+ *result = gimple_build (&gsi, false, GSI_NEW_STMT, loc, GT_EXPR,
-+ boolean_type_node, tmp3, tmp2);
-+
- return stmts;
- }
-
-@@ -371,9 +329,6 @@ switch_conversion::is_exp_index_transform_viable (gswitch *swtch)
- m_exp_index_transform_log2_type = can_log2 (index_type, opt_type);
- if (!m_exp_index_transform_log2_type)
- return false;
-- m_exp_index_transform_pow2p_type = can_pow2p (index_type);
-- if (!m_exp_index_transform_pow2p_type)
-- return false;
-
- /* Check that each case label corresponds only to one value
- (no case 1..3). */
-@@ -467,8 +422,7 @@ switch_conversion::exp_index_transform (gswitch *swtch)
- new_edge2->probability = profile_probability::even ();
-
- tree tmp;
-- gimple_seq stmts = gen_pow2p (index, UNKNOWN_LOCATION, &tmp,
-- m_exp_index_transform_pow2p_type);
-+ gimple_seq stmts = gen_pow2p (index, UNKNOWN_LOCATION, &tmp);
- gsi = gsi_last_bb (cond_bb);
- gsi_insert_seq_after (&gsi, stmts, GSI_LAST_NEW_STMT);
- gcond *stmt_cond = gimple_build_cond (NE_EXPR, tmp, boolean_false_node,
-diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h
-index 14610499e5fb..6468995eb316 100644
---- a/gcc/tree-switch-conversion.h
-+++ b/gcc/tree-switch-conversion.h
-@@ -920,11 +920,9 @@ public:
- bool m_exp_index_transform_applied;
-
- /* If switch conversion decided exponential index transform is viable, here
-- will be stored the types to which index variable has to be converted
-- before the logarithm and the "is power of 2" operations which are part of
-- the transform. */
-+ will be stored the type to which index variable has to be converted
-+ before the logarithm operation which is a part of the transform. */
- tree m_exp_index_transform_log2_type;
-- tree m_exp_index_transform_pow2p_type;
- };
-
- void
---
-2.46.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 819d192..d966e4c 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,6 +1,7 @@
14 ????
- 70_all_middle-end-check-explicitly-for-external-or-constant.patch
+ - 71_all_PR116878-libcall.patch
13 29 September 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-04 9:28 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-04 9:28 UTC (permalink / raw
To: gentoo-commits
commit: f44cf391c1dbacd2651298e2fb366905a5fe0a06
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 4 09:27:50 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 4 09:27:50 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=f44cf391
15.0.0: add two C++ patches
+ 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
+ 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
...erences-to-internal-linkage-vars-in-C-11-.patch | 96 ++++++++++++++++++++++
...e-underlying-decl-rather-than-the-USING_D.patch | 76 +++++++++++++++++
15.0.0/gentoo/README.history | 4 +-
3 files changed, 175 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch b/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
new file mode 100644
index 0000000..4e2f1f4
--- /dev/null
+++ b/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
@@ -0,0 +1,96 @@
+From 923bd335a44b1b556d705a7f1d36a2e9c06d9c5c Mon Sep 17 00:00:00 2001
+Message-ID: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
+From: Nathaniel Shead <nathanieloshead@gmail.com>
+Date: Fri, 4 Oct 2024 12:41:49 +1000
+Subject: [PATCH 1/2] c++: Allow references to internal-linkage vars in C++11
+ [PR113266]
+
+[temp.arg.nontype] changed in C++11 to allow naming internal-linkage
+variables and functions. We currently already handle internal-linkage
+functions, but variables were missed; this patch updates this.
+
+ PR c++/113266
+ PR c++/116911
+
+gcc/cp/ChangeLog:
+
+ * parser.cc (cp_parser_template_argument): Allow
+ internal-linkage variables since C++11.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.dg/cpp0x/nontype6.C: New test.
+
+Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
+---
+ gcc/cp/parser.cc | 17 ++++++++++++-----
+ gcc/testsuite/g++.dg/cpp0x/nontype6.C | 19 +++++++++++++++++++
+ 2 files changed, 31 insertions(+), 5 deletions(-)
+ create mode 100644 gcc/testsuite/g++.dg/cpp0x/nontype6.C
+
+diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
+index 08f9c89f1f0..e758ddeb1d5 100644
+--- a/gcc/cp/parser.cc
++++ b/gcc/cp/parser.cc
+@@ -19864,9 +19864,11 @@ cp_parser_template_argument (cp_parser* parser)
+
+ -- the name of a non-type template-parameter; or
+
+- -- the name of an object or function with external linkage...
++ -- the name of an object or function with external (or internal,
++ since C++11) linkage...
+
+- -- the address of an object or function with external linkage...
++ -- the address of an object or function with external (or internal,
++ since C++11) linkage...
+
+ -- a pointer to member... */
+ /* Look for a non-type template parameter. */
+@@ -19929,11 +19931,16 @@ cp_parser_template_argument (cp_parser* parser)
+ probe = TREE_OPERAND (probe, 1);
+ if (VAR_P (probe))
+ {
+- /* A variable without external linkage might still be a
++ /* A variable without valid linkage might still be a
+ valid constant-expression, so no error is issued here
+ if the external-linkage check fails. */
+- if (!address_p && !DECL_EXTERNAL_LINKAGE_P (probe))
+- cp_parser_simulate_error (parser);
++ if (!address_p && cxx_dialect < cxx17)
++ {
++ linkage_kind linkage = decl_linkage (probe);
++ if (linkage != lk_external
++ && (cxx_dialect < cxx11 || linkage != lk_internal))
++ cp_parser_simulate_error (parser);
++ }
+ }
+ else if (is_overloaded_fn (argument))
+ /* All overloaded functions are allowed; if the external
+diff --git a/gcc/testsuite/g++.dg/cpp0x/nontype6.C b/gcc/testsuite/g++.dg/cpp0x/nontype6.C
+new file mode 100644
+index 00000000000..5543d1e8b6d
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/cpp0x/nontype6.C
+@@ -0,0 +1,19 @@
++// PR c++/113266, PR c++/116911
++// { dg-do compile }
++
++template <int &> struct a {};
++static int guard1;
++a<guard1> b; // { dg-error "constant-expression|invalid" "" { target c++98_only } }
++
++namespace {
++ int guard2;
++}
++a<guard2> c; // OK in C++98 because guard2 has external linkage
++ // OK since C++11 because we can refer to an internal linkage decl
++
++void nolinkage() {
++ static int guard3;
++ a<guard3> d; // { dg-error "constant-expression|invalid" "" { target c++98_only } }
++ // { dg-error "constant expression|no linkage" "" { target { c++11 && c++14_down } } .-1 }
++ // OK since C++17 since we can now refer to no-linkage decls
++}
+--
+2.46.2
+
diff --git a/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch b/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
new file mode 100644
index 0000000..ab12bf6
--- /dev/null
+++ b/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
@@ -0,0 +1,76 @@
+From ba7c4e109fc589603911630deb2f19eba88bdbe8 Mon Sep 17 00:00:00 2001
+Message-ID: <ba7c4e109fc589603911630deb2f19eba88bdbe8.1728034006.git.sam@gentoo.org>
+In-Reply-To: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
+References: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
+From: Nathaniel Shead <nathanieloshead@gmail.com>
+Date: Fri, 4 Oct 2024 10:52:02 +1000
+Subject: [PATCH 2/2] c++: Return the underlying decl rather than the
+ USING_DECL from update_binding [PR116913]
+
+Users of pushdecl assume that the returned decl will be a possibly
+updated decl matching the one that was passed in. My r15-3910 change
+broke this since in some cases we would now return USING_DECLs; this
+patch fixes the situation.
+
+ PR c++/116913
+
+gcc/cp/ChangeLog:
+
+ * name-lookup.cc (update_binding): Return the strip_using'd old
+ decl rather than the binding.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.dg/lookup/using70.C: New test.
+
+Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
+---
+ gcc/cp/name-lookup.cc | 4 ++--
+ gcc/testsuite/g++.dg/lookup/using70.C | 13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+ create mode 100644 gcc/testsuite/g++.dg/lookup/using70.C
+
+diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
+index 4754ef5a522..609bd6e8c9b 100644
+--- a/gcc/cp/name-lookup.cc
++++ b/gcc/cp/name-lookup.cc
+@@ -3101,7 +3101,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
+ {
+ if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl)))
+ /* Two type decls to the same type. Do nothing. */
+- return old_bval;
++ return old;
+ else
+ goto conflict;
+ }
+@@ -3114,7 +3114,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
+
+ /* The new one must be an alias at this point. */
+ gcc_assert (DECL_NAMESPACE_ALIAS (decl));
+- return old_bval;
++ return old;
+ }
+ else if (TREE_CODE (old) == VAR_DECL)
+ {
+diff --git a/gcc/testsuite/g++.dg/lookup/using70.C b/gcc/testsuite/g++.dg/lookup/using70.C
+new file mode 100644
+index 00000000000..14838eea7ec
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/lookup/using70.C
+@@ -0,0 +1,13 @@
++// PR c++/116913
++// { dg-do compile { target c++11 } }
++
++namespace ns {
++ struct c {};
++ using d = int;
++}
++
++using ns::c;
++using ns::d;
++
++using c = ns::c;
++using d = ns::d;
+--
+2.46.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index d966e4c..2d85dc2 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,7 +1,9 @@
-14 ????
+14 4 October 2024
- 70_all_middle-end-check-explicitly-for-external-or-constant.patch
- 71_all_PR116878-libcall.patch
+ + 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
+ + 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
13 29 September 2024
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-04 10:37 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-04 10:37 UTC (permalink / raw
To: gentoo-commits
commit: fd69f7a88e4fa1dd773750c0ce7a31c20f452ce2
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 4 10:36:15 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 4 10:36:57 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=fd69f7a8
15.0.0: drop patches merged upstream
- 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
- 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
...erences-to-internal-linkage-vars-in-C-11-.patch | 96 ----------------------
...e-underlying-decl-rather-than-the-USING_D.patch | 76 -----------------
15.0.0/gentoo/README.history | 5 ++
3 files changed, 5 insertions(+), 172 deletions(-)
diff --git a/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch b/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
deleted file mode 100644
index 4e2f1f4..0000000
--- a/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 923bd335a44b1b556d705a7f1d36a2e9c06d9c5c Mon Sep 17 00:00:00 2001
-Message-ID: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
-From: Nathaniel Shead <nathanieloshead@gmail.com>
-Date: Fri, 4 Oct 2024 12:41:49 +1000
-Subject: [PATCH 1/2] c++: Allow references to internal-linkage vars in C++11
- [PR113266]
-
-[temp.arg.nontype] changed in C++11 to allow naming internal-linkage
-variables and functions. We currently already handle internal-linkage
-functions, but variables were missed; this patch updates this.
-
- PR c++/113266
- PR c++/116911
-
-gcc/cp/ChangeLog:
-
- * parser.cc (cp_parser_template_argument): Allow
- internal-linkage variables since C++11.
-
-gcc/testsuite/ChangeLog:
-
- * g++.dg/cpp0x/nontype6.C: New test.
-
-Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
----
- gcc/cp/parser.cc | 17 ++++++++++++-----
- gcc/testsuite/g++.dg/cpp0x/nontype6.C | 19 +++++++++++++++++++
- 2 files changed, 31 insertions(+), 5 deletions(-)
- create mode 100644 gcc/testsuite/g++.dg/cpp0x/nontype6.C
-
-diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
-index 08f9c89f1f0..e758ddeb1d5 100644
---- a/gcc/cp/parser.cc
-+++ b/gcc/cp/parser.cc
-@@ -19864,9 +19864,11 @@ cp_parser_template_argument (cp_parser* parser)
-
- -- the name of a non-type template-parameter; or
-
-- -- the name of an object or function with external linkage...
-+ -- the name of an object or function with external (or internal,
-+ since C++11) linkage...
-
-- -- the address of an object or function with external linkage...
-+ -- the address of an object or function with external (or internal,
-+ since C++11) linkage...
-
- -- a pointer to member... */
- /* Look for a non-type template parameter. */
-@@ -19929,11 +19931,16 @@ cp_parser_template_argument (cp_parser* parser)
- probe = TREE_OPERAND (probe, 1);
- if (VAR_P (probe))
- {
-- /* A variable without external linkage might still be a
-+ /* A variable without valid linkage might still be a
- valid constant-expression, so no error is issued here
- if the external-linkage check fails. */
-- if (!address_p && !DECL_EXTERNAL_LINKAGE_P (probe))
-- cp_parser_simulate_error (parser);
-+ if (!address_p && cxx_dialect < cxx17)
-+ {
-+ linkage_kind linkage = decl_linkage (probe);
-+ if (linkage != lk_external
-+ && (cxx_dialect < cxx11 || linkage != lk_internal))
-+ cp_parser_simulate_error (parser);
-+ }
- }
- else if (is_overloaded_fn (argument))
- /* All overloaded functions are allowed; if the external
-diff --git a/gcc/testsuite/g++.dg/cpp0x/nontype6.C b/gcc/testsuite/g++.dg/cpp0x/nontype6.C
-new file mode 100644
-index 00000000000..5543d1e8b6d
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/cpp0x/nontype6.C
-@@ -0,0 +1,19 @@
-+// PR c++/113266, PR c++/116911
-+// { dg-do compile }
-+
-+template <int &> struct a {};
-+static int guard1;
-+a<guard1> b; // { dg-error "constant-expression|invalid" "" { target c++98_only } }
-+
-+namespace {
-+ int guard2;
-+}
-+a<guard2> c; // OK in C++98 because guard2 has external linkage
-+ // OK since C++11 because we can refer to an internal linkage decl
-+
-+void nolinkage() {
-+ static int guard3;
-+ a<guard3> d; // { dg-error "constant-expression|invalid" "" { target c++98_only } }
-+ // { dg-error "constant expression|no linkage" "" { target { c++11 && c++14_down } } .-1 }
-+ // OK since C++17 since we can now refer to no-linkage decls
-+}
---
-2.46.2
-
diff --git a/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch b/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
deleted file mode 100644
index ab12bf6..0000000
--- a/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From ba7c4e109fc589603911630deb2f19eba88bdbe8 Mon Sep 17 00:00:00 2001
-Message-ID: <ba7c4e109fc589603911630deb2f19eba88bdbe8.1728034006.git.sam@gentoo.org>
-In-Reply-To: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
-References: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
-From: Nathaniel Shead <nathanieloshead@gmail.com>
-Date: Fri, 4 Oct 2024 10:52:02 +1000
-Subject: [PATCH 2/2] c++: Return the underlying decl rather than the
- USING_DECL from update_binding [PR116913]
-
-Users of pushdecl assume that the returned decl will be a possibly
-updated decl matching the one that was passed in. My r15-3910 change
-broke this since in some cases we would now return USING_DECLs; this
-patch fixes the situation.
-
- PR c++/116913
-
-gcc/cp/ChangeLog:
-
- * name-lookup.cc (update_binding): Return the strip_using'd old
- decl rather than the binding.
-
-gcc/testsuite/ChangeLog:
-
- * g++.dg/lookup/using70.C: New test.
-
-Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
----
- gcc/cp/name-lookup.cc | 4 ++--
- gcc/testsuite/g++.dg/lookup/using70.C | 13 +++++++++++++
- 2 files changed, 15 insertions(+), 2 deletions(-)
- create mode 100644 gcc/testsuite/g++.dg/lookup/using70.C
-
-diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
-index 4754ef5a522..609bd6e8c9b 100644
---- a/gcc/cp/name-lookup.cc
-+++ b/gcc/cp/name-lookup.cc
-@@ -3101,7 +3101,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
- {
- if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl)))
- /* Two type decls to the same type. Do nothing. */
-- return old_bval;
-+ return old;
- else
- goto conflict;
- }
-@@ -3114,7 +3114,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
-
- /* The new one must be an alias at this point. */
- gcc_assert (DECL_NAMESPACE_ALIAS (decl));
-- return old_bval;
-+ return old;
- }
- else if (TREE_CODE (old) == VAR_DECL)
- {
-diff --git a/gcc/testsuite/g++.dg/lookup/using70.C b/gcc/testsuite/g++.dg/lookup/using70.C
-new file mode 100644
-index 00000000000..14838eea7ec
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/lookup/using70.C
-@@ -0,0 +1,13 @@
-+// PR c++/116913
-+// { dg-do compile { target c++11 } }
-+
-+namespace ns {
-+ struct c {};
-+ using d = int;
-+}
-+
-+using ns::c;
-+using ns::d;
-+
-+using c = ns::c;
-+using d = ns::d;
---
-2.46.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 2d85dc2..f58b501 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+15 ????
+
+ - 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
+ - 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
+
14 4 October 2024
- 70_all_middle-end-check-explicitly-for-external-or-constant.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-07 2:45 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-07 2:45 UTC (permalink / raw
To: gentoo-commits
commit: 9a259e1746b11f94c3ccdeacb33bcc9ccfeb3f5f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 7 02:45:18 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 7 02:45:18 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9a259e17
15.0.0: cut patchset 15
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index f58b501..a6954a6 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-15 ????
+15 7 October 2024
- 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
- 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-13 22:48 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-13 22:48 UTC (permalink / raw
To: gentoo-commits
commit: b4a852b00ffc7c9436d15867d602c28837c97758
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 13 22:47:21 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 13 22:47:21 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b4a852b0
15.0.0: add two coro patches
Bug: https://gcc.gnu.org/PR116506
Bug: https://gcc.gnu.org/PR116914
Closes: https://bugs.gentoo.org/941147
Closes: https://bugs.gentoo.org/941148
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/70_all_PR116506-coro.patch | 295 +++++++++++++++++++++++++++++++
15.0.0/gentoo/71_all_PR116914-coro.patch | 51 ++++++
15.0.0/gentoo/README.history | 5 +
3 files changed, 351 insertions(+)
diff --git a/15.0.0/gentoo/70_all_PR116506-coro.patch b/15.0.0/gentoo/70_all_PR116506-coro.patch
new file mode 100644
index 0000000..4e670fc
--- /dev/null
+++ b/15.0.0/gentoo/70_all_PR116506-coro.patch
@@ -0,0 +1,295 @@
+From 06475fcc5b72fdb9b24e7e39703942e1e3f2f0d5 Mon Sep 17 00:00:00 2001
+From: Iain Sandoe <iain@sandoe.co.uk>
+Date: Thu, 29 Aug 2024 11:18:24 +0100
+Subject: [PATCH] c++, coroutines: Fix awaiter var creation [PR116506].
+
+Awaiters always need to have a coroutine state frame copy since
+they persist across potential supensions. It simplifies the later
+analysis considerably to assign these early which we do when
+building co_await expressions.
+
+The cleanups in r15-3146-g47dbd69b1, unfortunately elided some of
+processing used to cater for cases where the var created from an
+xvalue, or is a pointer/reference type.
+
+Corrected thus.
+
+ PR c++/116506
+ PR c++/116880
+
+gcc/cp/ChangeLog:
+
+ * coroutines.cc (build_co_await): Ensure that xvalues are
+ materialised. Handle references/pointer values in awaiter
+ access expressions.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.dg/coroutines/pr116506.C: New test.
+ * g++.dg/coroutines/pr116880.C: New test.
+
+Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
+---
+ gcc/cp/coroutines.cc | 82 +++++++++++++++++-----
+ gcc/testsuite/g++.dg/coroutines/pr116506.C | 53 ++++++++++++++
+ gcc/testsuite/g++.dg/coroutines/pr116880.C | 36 ++++++++++
+ 3 files changed, 154 insertions(+), 17 deletions(-)
+ create mode 100644 gcc/testsuite/g++.dg/coroutines/pr116506.C
+ create mode 100644 gcc/testsuite/g++.dg/coroutines/pr116880.C
+
+diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
+index 86a5ac8999a..ba6ee41a4e7 100644
+--- a/gcc/cp/coroutines.cc
++++ b/gcc/cp/coroutines.cc
+@@ -1071,6 +1071,30 @@ build_template_co_await_expr (location_t kw, tree type, tree expr, tree kind)
+ return aw_expr;
+ }
+
++/* For a component ref that is not a pointer type, decide if we can use
++ this directly. */
++static bool
++usable_component_ref (tree comp_ref)
++{
++ if (TREE_CODE (comp_ref) != COMPONENT_REF
++ || TREE_SIDE_EFFECTS (comp_ref))
++ return false;
++
++ while (TREE_CODE (comp_ref) == COMPONENT_REF)
++ {
++ comp_ref = TREE_OPERAND (comp_ref, 0);
++ STRIP_NOPS (comp_ref);
++ /* x-> */
++ if (INDIRECT_REF_P (comp_ref))
++ return false;
++ /* operator-> */
++ if (TREE_CODE (comp_ref) == CALL_EXPR)
++ return false;
++ STRIP_NOPS (comp_ref);
++ }
++ gcc_checking_assert (VAR_P (comp_ref) || TREE_CODE (comp_ref) == PARM_DECL);
++ return true;
++}
+
+ /* This performs [expr.await] bullet 3.3 and validates the interface obtained.
+ It is also used to build the initial and final suspend points.
+@@ -1133,13 +1157,12 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind,
+ if (o_type && !VOID_TYPE_P (o_type))
+ o_type = complete_type_or_else (o_type, o);
+
+- if (!o_type)
++ if (!o_type || o_type == error_mark_node)
+ return error_mark_node;
+
+ if (TREE_CODE (o_type) != RECORD_TYPE)
+ {
+- error_at (loc, "awaitable type %qT is not a structure",
+- o_type);
++ error_at (loc, "awaitable type %qT is not a structure", o_type);
+ return error_mark_node;
+ }
+
+@@ -1165,20 +1188,47 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind,
+ if (!glvalue_p (o))
+ o = get_target_expr (o, tf_warning_or_error);
+
+- tree e_proxy = o;
+- if (glvalue_p (o))
++ /* We know that we need a coroutine state frame variable for the awaiter,
++ since it must persist across suspension; so where one is needed, build
++ it now. */
++ tree e_proxy = STRIP_NOPS (o);
++ if (INDIRECT_REF_P (e_proxy))
++ e_proxy = TREE_OPERAND (e_proxy, 0);
++ o_type = TREE_TYPE (e_proxy);
++ bool is_ptr = TYPE_PTR_P (o_type);
++ if (!is_ptr
++ && (TREE_CODE (e_proxy) == PARM_DECL
++ || usable_component_ref (e_proxy)
++ || (VAR_P (e_proxy) && !is_local_temp (e_proxy))))
+ o = NULL_TREE; /* Use the existing entity. */
+- else /* We need to materialise it. */
++ else /* We need a non-temp var. */
+ {
+- e_proxy = get_awaitable_var (suspend_kind, o_type);
+- o = cp_build_init_expr (loc, e_proxy, o);
+- e_proxy = convert_from_reference (e_proxy);
++ tree p_type = o_type;
++ tree o_a = o;
++ if (lvalue_p (o) && !TREE_SIDE_EFFECTS (o))
++ {
++ if (is_ptr)
++ p_type = TREE_TYPE (p_type);
++ p_type = cp_build_reference_type (p_type, false);
++ o_a = build_address (o);
++ }
++ if (INDIRECT_REF_P (o_a))
++ o_a = TREE_OPERAND (o_a, 0);
++ e_proxy = get_awaitable_var (suspend_kind, p_type);
++ o = cp_build_init_expr (loc, e_proxy, o_a);
+ }
+
++ /* Build an expression for the object that will be used to call the awaitable
++ methods. */
++ tree e_object = convert_from_reference (e_proxy);
++ if (TYPE_PTR_P (TREE_TYPE (e_object)))
++ e_object = cp_build_indirect_ref (input_location, e_object, RO_UNARY_STAR,
++ tf_warning_or_error);
++
+ /* I suppose we could check that this is contextually convertible to bool. */
+ tree awrd_func = NULL_TREE;
+ tree awrd_call
+- = build_new_method_call (e_proxy, awrd_meth, NULL, NULL_TREE, LOOKUP_NORMAL,
++ = build_new_method_call (e_object, awrd_meth, NULL, NULL_TREE, LOOKUP_NORMAL,
+ &awrd_func, tf_warning_or_error);
+
+ if (!awrd_func || !awrd_call || awrd_call == error_mark_node)
+@@ -1192,7 +1242,7 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind,
+ tree h_proxy = get_coroutine_self_handle_proxy (current_function_decl);
+ vec<tree, va_gc> *args = make_tree_vector_single (h_proxy);
+ tree awsp_call
+- = build_new_method_call (e_proxy, awsp_meth, &args, NULL_TREE,
++ = build_new_method_call (e_object, awsp_meth, &args, NULL_TREE,
+ LOOKUP_NORMAL, &awsp_func, tf_warning_or_error);
+
+ release_tree_vector (args);
+@@ -1224,7 +1274,7 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind,
+ /* Finally, the type of e.await_resume() is the co_await's type. */
+ tree awrs_func = NULL_TREE;
+ tree awrs_call
+- = build_new_method_call (e_proxy, awrs_meth, NULL, NULL_TREE, LOOKUP_NORMAL,
++ = build_new_method_call (e_object, awrs_meth, NULL, NULL_TREE, LOOKUP_NORMAL,
+ &awrs_func, tf_warning_or_error);
+
+ if (!awrs_func || !awrs_call || awrs_call == error_mark_node)
+@@ -1238,7 +1288,7 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind,
+ return error_mark_node;
+ if (coro_diagnose_throwing_fn (awrs_func))
+ return error_mark_node;
+- if (tree dummy = cxx_maybe_build_cleanup (e_proxy, tf_none))
++ if (tree dummy = cxx_maybe_build_cleanup (e_object, tf_none))
+ {
+ if (CONVERT_EXPR_P (dummy))
+ dummy = TREE_OPERAND (dummy, 0);
+@@ -1249,7 +1299,8 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind,
+ }
+
+ /* We now have three call expressions, in terms of the promise, handle and
+- 'e' proxies. Save them in the await expression for later expansion. */
++ 'e' proxy expression. Save them in the await expression for later
++ expansion. */
+
+ tree awaiter_calls = make_tree_vec (3);
+ TREE_VEC_ELT (awaiter_calls, 0) = awrd_call; /* await_ready(). */
+@@ -1262,9 +1313,6 @@ build_co_await (location_t loc, tree a, suspend_point_kind suspend_kind,
+ }
+ TREE_VEC_ELT (awaiter_calls, 2) = awrs_call; /* await_resume(). */
+
+- if (REFERENCE_REF_P (e_proxy))
+- e_proxy = TREE_OPERAND (e_proxy, 0);
+-
+ tree awrs_type = TREE_TYPE (TREE_TYPE (awrs_func));
+ tree suspend_kind_cst = build_int_cst (integer_type_node,
+ (int) suspend_kind);
+diff --git a/gcc/testsuite/g++.dg/coroutines/pr116506.C b/gcc/testsuite/g++.dg/coroutines/pr116506.C
+new file mode 100644
+index 00000000000..57a6e360566
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/coroutines/pr116506.C
+@@ -0,0 +1,53 @@
++// { dg-do run }
++// { dg-additional-options "-fno-exceptions" }
++
++#include <coroutine>
++
++bool g_too_early = true;
++std::coroutine_handle<> g_handle;
++
++struct Awaiter {
++ Awaiter() {}
++ ~Awaiter() {
++ if (g_too_early) {
++ __builtin_abort ();
++ }
++ }
++
++ bool await_ready() { return false; }
++ void await_suspend(std::coroutine_handle<> handle) {
++ g_handle = handle;
++ }
++
++ void await_resume() {}
++};
++
++struct SuspendNever {
++ bool await_ready() noexcept { return true; }
++ void await_suspend(std::coroutine_handle<>) noexcept {}
++ void await_resume() noexcept {}
++};
++
++struct Coroutine {
++ struct promise_type {
++ Coroutine get_return_object() { return {}; }
++ SuspendNever initial_suspend() { return {}; }
++ SuspendNever final_suspend() noexcept { return {}; }
++ void return_void() {}
++ void unhandled_exception() {}
++
++ Awaiter&& await_transform(Awaiter&& u) {
++ return static_cast<Awaiter&&>(u);
++ }
++ };
++};
++
++Coroutine foo() {
++ co_await Awaiter{};
++}
++
++int main() {
++ foo();
++ g_too_early = false;
++ g_handle.destroy();
++}
+diff --git a/gcc/testsuite/g++.dg/coroutines/pr116880.C b/gcc/testsuite/g++.dg/coroutines/pr116880.C
+new file mode 100644
+index 00000000000..f0db6a26044
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/coroutines/pr116880.C
+@@ -0,0 +1,36 @@
++#include <coroutine>
++
++struct promise_type;
++using handle_type = std::coroutine_handle<promise_type>;
++
++struct Co {
++ handle_type handle;
++ using promise_type = ::promise_type;
++
++ explicit Co(handle_type handle) : handle(handle) {}
++
++ bool await_ready() { return false; }
++ std::coroutine_handle<> await_suspend(handle_type handle);
++ void await_resume() {}
++};
++
++struct Done {};
++
++struct promise_type {
++ Co get_return_object();
++
++ std::suspend_always initial_suspend() { return {}; };
++ std::suspend_always final_suspend() noexcept { return {}; };
++ void return_value(Done) {}
++ void return_value(Co&&);
++ void unhandled_exception() { throw; };
++ Co&& await_transform(Co&& co) { return static_cast<Co&&>(co); }
++};
++
++Co tryToRun();
++
++Co init()
++{
++ co_await tryToRun();
++ co_return Done{};
++}
+--
+2.39.2 (Apple Git-143)
diff --git a/15.0.0/gentoo/71_all_PR116914-coro.patch b/15.0.0/gentoo/71_all_PR116914-coro.patch
new file mode 100644
index 0000000..100d2bb
--- /dev/null
+++ b/15.0.0/gentoo/71_all_PR116914-coro.patch
@@ -0,0 +1,51 @@
+From 1035866a75b27bb2cac49bac1070877d95f7d3c0 Mon Sep 17 00:00:00 2001
+From: Iain Sandoe <iain@sandoe.co.uk>
+Date: Sun, 29 Sep 2024 10:04:39 +0100
+Subject: [PATCH] c++, coroutines: stmt expressions some progress
+
+---
+ gcc/cp/coroutines.cc | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc
+index af8798b04ba..94bfa6ac450 100644
+--- a/gcc/cp/coroutines.cc
++++ b/gcc/cp/coroutines.cc
+@@ -2131,6 +2131,14 @@ await_statement_expander (tree *stmt, int *do_subtree, void *d)
+ }
+ else if (EXPR_P (*stmt))
+ {
++ /* Look for ({}) at the top level - just recurse into these. */
++ if (TREE_CODE (*stmt) == EXPR_STMT)
++ {
++ tree inner = EXPR_STMT_EXPR (*stmt);
++ if (TREE_CODE (inner) == STATEMENT_LIST
++ || TREE_CODE (inner) == BIND_EXPR)
++ return NULL_TREE; // process contents
++ }
+ process_one_statement (stmt, d);
+ *do_subtree = 0; /* Done subtrees. */
+ }
+@@ -3860,6 +3868,20 @@ await_statement_walker (tree *stmt, int *do_subtree, void *d)
+ if (!(cp_walk_tree (stmt, find_any_await, &await_ptr, &visited)))
+ return NULL_TREE; /* Nothing special to do here. */
+
++ /* Handle statement expressions. */
++ if (TREE_CODE (expr) == EXPR_STMT)
++ {
++ tree inner = EXPR_STMT_EXPR (expr);
++ if (TREE_CODE (inner) == STATEMENT_LIST
++ || TREE_CODE (inner) == BIND_EXPR)
++ {
++ res = cp_walk_tree (&EXPR_STMT_EXPR (expr),
++ await_statement_walker, d, NULL);
++ *do_subtree = 0;
++ return res;
++ }
++ }
++
+ visited.empty ();
+ awpts->saw_awaits = 0;
+ hash_set<tree> truth_aoif_to_expand;
+--
+2.39.2 (Apple Git-143)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index a6954a6..073283d 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+16 13 October 2024
+
+ + 70_all_PR116506-coro.patch
+ + 71_all_PR116914-coro.patch
+
15 7 October 2024
- 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-17 4:15 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-17 4:15 UTC (permalink / raw
To: gentoo-commits
commit: 63001509ff89680da88fd497486bcb3add0c4f65
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 17 04:15:08 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 17 04:15:08 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=63001509
15.0.0: add 72_all_PR117177-libcpp.patch
Fixes building glibc. Approved upstream but not yet merged.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117177-libcpp.patch | 234 +++++++++++++++++++++++++++++
1 file changed, 234 insertions(+)
diff --git a/15.0.0/gentoo/72_all_PR117177-libcpp.patch b/15.0.0/gentoo/72_all_PR117177-libcpp.patch
new file mode 100644
index 0000000..1db42c9
--- /dev/null
+++ b/15.0.0/gentoo/72_all_PR117177-libcpp.patch
@@ -0,0 +1,234 @@
+From b2681b59424dd3a5fdf4101f8cc9eff60a5166b7 Mon Sep 17 00:00:00 2001
+Message-ID: <b2681b59424dd3a5fdf4101f8cc9eff60a5166b7.1729138476.git.sam@gentoo.org>
+From: Jakub Jelinek <jakub@redhat.com>
+Date: Wed, 16 Oct 2024 23:09:32 +0200
+Subject: [PATCH] c: Fix up speed up compilation of large char array
+ initializers when not using #embed [PR117177]
+
+Hi!
+
+Apparently my
+c: Speed up compilation of large char array initializers when not using #embed
+patch broke building glibc.
+
+The issue is that when using CPP_EMBED, we are guaranteed by the
+preprocessor that there is CPP_NUMBER CPP_COMMA before it and
+CPP_COMMA CPP_NUMBER after it (or CPP_COMMA CPP_EMBED), so RAW_DATA_CST
+never ends up at the end of arrays of unknown length.
+Now, the c_parser_initval optimization attempted to preserve that property
+rather than changing everything that e.g. inferes array number of elements
+from the initializer etc. to deal with RAW_DATA_CST at the end, but
+it didn't take into account the possibility that there could be
+CPP_COMMA followed by CPP_CLOSE_BRACE (where the CPP_COMMA is redundant).
+
+As we are peaking already at 4 tokens in that code, peeking more would
+require using raw tokens and that seems to be expensive doing it for
+every pair of tokens due to vec_free done when we are out of raw tokens.
+
+So, the following patch instead determines the case where we want
+another INTEGER_CST element after it after consuming the tokens, and just
+arranges for another process_init_element.
+
+Ok for trunk if this passes bootstrap/regtest?
+
+2024-10-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/117177
+gcc/c/
+ * c-parser.cc (c_parser_initval): Instead of doing
+ orig_len == INT_MAX checks before consuming tokens to set
+ last = 1, check it after consuming it and if not followed
+ by CPP_COMMA CPP_NUMBER, call process_init_element once
+ more with the last CPP_NUMBER.
+gcc/testsuite/
+ * c-c++-common/init-4.c: New test.
+---
+ gcc/c/c-parser.cc | 35 ++++++++---
+ gcc/testsuite/c-c++-common/init-4.c | 97 +++++++++++++++++++++++++++++
+ 2 files changed, 122 insertions(+), 10 deletions(-)
+ create mode 100644 gcc/testsuite/c-c++-common/init-4.c
+
+diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
+index e4381044e5c..090ab1cbc08 100644
+--- a/gcc/c/c-parser.cc
++++ b/gcc/c/c-parser.cc
+@@ -6529,6 +6529,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ unsigned int i;
+ gcc_checking_assert (len >= 64);
+ location_t last_loc = UNKNOWN_LOCATION;
++ location_t prev_loc = UNKNOWN_LOCATION;
+ for (i = 0; i < 64; ++i)
+ {
+ c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
+@@ -6544,6 +6545,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ buf1[i] = (char) tree_to_uhwi (tok->value);
+ if (i == 0)
+ loc = tok->location;
++ prev_loc = last_loc;
+ last_loc = tok->location;
+ }
+ if (i < 64)
+@@ -6567,6 +6569,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ unsigned int max_len = 131072 - offsetof (struct tree_string, str) - 1;
+ unsigned int orig_len = len;
+ unsigned int off = 0, last = 0;
++ unsigned char lastc = 0;
+ if (!wi::neg_p (wi::to_wide (val)) && wi::to_widest (val) <= UCHAR_MAX)
+ off = 1;
+ len = MIN (len, max_len - off);
+@@ -6596,20 +6599,25 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ if (tok2->type != CPP_COMMA && tok2->type != CPP_CLOSE_BRACE)
+ break;
+ buf2[i + off] = (char) tree_to_uhwi (tok->value);
+- /* If orig_len is INT_MAX, this can be flexible array member and
+- in that case we need to ensure another element which
+- for CPP_EMBED is normally guaranteed after it. Include
+- that byte in the RAW_DATA_OWNER though, so it can be optimized
+- later. */
+- if (tok2->type == CPP_CLOSE_BRACE && orig_len == INT_MAX)
+- {
+- last = 1;
+- break;
+- }
++ prev_loc = last_loc;
+ last_loc = tok->location;
+ c_parser_consume_token (parser);
+ c_parser_consume_token (parser);
+ }
++ /* If orig_len is INT_MAX, this can be flexible array member and
++ in that case we need to ensure another element which
++ for CPP_EMBED is normally guaranteed after it. Include
++ that byte in the RAW_DATA_OWNER though, so it can be optimized
++ later. */
++ if (orig_len == INT_MAX
++ && (!c_parser_next_token_is (parser, CPP_COMMA)
++ || c_parser_peek_2nd_token (parser)->type != CPP_NUMBER))
++ {
++ --i;
++ last = 1;
++ std::swap (prev_loc, last_loc);
++ lastc = (unsigned char) buf2[i + off];
++ }
+ val = make_node (RAW_DATA_CST);
+ TREE_TYPE (val) = integer_type_node;
+ RAW_DATA_LENGTH (val) = i;
+@@ -6625,6 +6633,13 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ init.original_type = integer_type_node;
+ init.m_decimal = 0;
+ process_init_element (loc, init, false, braced_init_obstack);
++ if (last)
++ {
++ init.value = build_int_cst (integer_type_node, lastc);
++ init.original_code = INTEGER_CST;
++ set_c_expr_source_range (&init, prev_loc, prev_loc);
++ process_init_element (prev_loc, init, false, braced_init_obstack);
++ }
+ }
+ }
+
+diff --git a/gcc/testsuite/c-c++-common/init-4.c b/gcc/testsuite/c-c++-common/init-4.c
+new file mode 100644
+index 00000000000..d575a3f5a51
+--- /dev/null
++++ b/gcc/testsuite/c-c++-common/init-4.c
+@@ -0,0 +1,97 @@
++/* { dg-do run } */
++/* { dg-options "-O2" } */
++
++unsigned char a1[] = {
++ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
++ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
++ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
++ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
++ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
++ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
++ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
++ 0xfa, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++};
++unsigned char a2[] = {
++ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
++ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
++ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
++ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
++ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
++ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
++ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00
++};
++unsigned char a3[] = {
++ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
++ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
++ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
++ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
++ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
++ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
++ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
++};
++unsigned char a4[] = {
++ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
++ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
++ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
++ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
++ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
++ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
++ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
++ 0xfa
++};
++unsigned char a5[] = {
++ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
++ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
++ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
++ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
++ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
++ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
++ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
++ 0xfa,
++};
++unsigned char a6[] = {
++ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
++ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
++ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
++ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
++ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
++ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
++ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
++ 0xfa, 0xfb
++};
++unsigned char a7[] = {
++ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
++ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
++ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
++ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
++ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
++ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
++ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
++ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
++ 0xfa, 0xfb
++};
++
++int
++main ()
++{
++ if (sizeof (a1) != 72
++ || sizeof (a2) != 64
++ || __builtin_memcmp (a1, a2, 64) != 0
++ || sizeof (a3) != 64
++ || __builtin_memcmp (a1, a3, 64) != 0
++ || sizeof (a4) != 65
++ || __builtin_memcmp (a1, a4, 65) != 0
++ || sizeof (a5) != 65
++ || __builtin_memcmp (a1, a5, 65) != 0
++ || sizeof (a6) != 66
++ || __builtin_memcmp (a1, a6, 66) != 0
++ || sizeof (a7) != 66
++ || __builtin_memcmp (a1, a7, 66) != 0)
++ __builtin_abort ();
++}
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-17 5:01 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-17 5:01 UTC (permalink / raw
To: gentoo-commits
commit: 15d55a133c02c17eb73a729f098a0b6fa6e70632
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 17 05:00:54 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 17 05:00:54 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=15d55a13
15.0.0: drop 72_all_PR117177-libcpp.patch
Now merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117177-libcpp.patch | 234 -----------------------------
1 file changed, 234 deletions(-)
diff --git a/15.0.0/gentoo/72_all_PR117177-libcpp.patch b/15.0.0/gentoo/72_all_PR117177-libcpp.patch
deleted file mode 100644
index 1db42c9..0000000
--- a/15.0.0/gentoo/72_all_PR117177-libcpp.patch
+++ /dev/null
@@ -1,234 +0,0 @@
-From b2681b59424dd3a5fdf4101f8cc9eff60a5166b7 Mon Sep 17 00:00:00 2001
-Message-ID: <b2681b59424dd3a5fdf4101f8cc9eff60a5166b7.1729138476.git.sam@gentoo.org>
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Wed, 16 Oct 2024 23:09:32 +0200
-Subject: [PATCH] c: Fix up speed up compilation of large char array
- initializers when not using #embed [PR117177]
-
-Hi!
-
-Apparently my
-c: Speed up compilation of large char array initializers when not using #embed
-patch broke building glibc.
-
-The issue is that when using CPP_EMBED, we are guaranteed by the
-preprocessor that there is CPP_NUMBER CPP_COMMA before it and
-CPP_COMMA CPP_NUMBER after it (or CPP_COMMA CPP_EMBED), so RAW_DATA_CST
-never ends up at the end of arrays of unknown length.
-Now, the c_parser_initval optimization attempted to preserve that property
-rather than changing everything that e.g. inferes array number of elements
-from the initializer etc. to deal with RAW_DATA_CST at the end, but
-it didn't take into account the possibility that there could be
-CPP_COMMA followed by CPP_CLOSE_BRACE (where the CPP_COMMA is redundant).
-
-As we are peaking already at 4 tokens in that code, peeking more would
-require using raw tokens and that seems to be expensive doing it for
-every pair of tokens due to vec_free done when we are out of raw tokens.
-
-So, the following patch instead determines the case where we want
-another INTEGER_CST element after it after consuming the tokens, and just
-arranges for another process_init_element.
-
-Ok for trunk if this passes bootstrap/regtest?
-
-2024-10-16 Jakub Jelinek <jakub@redhat.com>
-
- PR c/117177
-gcc/c/
- * c-parser.cc (c_parser_initval): Instead of doing
- orig_len == INT_MAX checks before consuming tokens to set
- last = 1, check it after consuming it and if not followed
- by CPP_COMMA CPP_NUMBER, call process_init_element once
- more with the last CPP_NUMBER.
-gcc/testsuite/
- * c-c++-common/init-4.c: New test.
----
- gcc/c/c-parser.cc | 35 ++++++++---
- gcc/testsuite/c-c++-common/init-4.c | 97 +++++++++++++++++++++++++++++
- 2 files changed, 122 insertions(+), 10 deletions(-)
- create mode 100644 gcc/testsuite/c-c++-common/init-4.c
-
-diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
-index e4381044e5c..090ab1cbc08 100644
---- a/gcc/c/c-parser.cc
-+++ b/gcc/c/c-parser.cc
-@@ -6529,6 +6529,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- unsigned int i;
- gcc_checking_assert (len >= 64);
- location_t last_loc = UNKNOWN_LOCATION;
-+ location_t prev_loc = UNKNOWN_LOCATION;
- for (i = 0; i < 64; ++i)
- {
- c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
-@@ -6544,6 +6545,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- buf1[i] = (char) tree_to_uhwi (tok->value);
- if (i == 0)
- loc = tok->location;
-+ prev_loc = last_loc;
- last_loc = tok->location;
- }
- if (i < 64)
-@@ -6567,6 +6569,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- unsigned int max_len = 131072 - offsetof (struct tree_string, str) - 1;
- unsigned int orig_len = len;
- unsigned int off = 0, last = 0;
-+ unsigned char lastc = 0;
- if (!wi::neg_p (wi::to_wide (val)) && wi::to_widest (val) <= UCHAR_MAX)
- off = 1;
- len = MIN (len, max_len - off);
-@@ -6596,20 +6599,25 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- if (tok2->type != CPP_COMMA && tok2->type != CPP_CLOSE_BRACE)
- break;
- buf2[i + off] = (char) tree_to_uhwi (tok->value);
-- /* If orig_len is INT_MAX, this can be flexible array member and
-- in that case we need to ensure another element which
-- for CPP_EMBED is normally guaranteed after it. Include
-- that byte in the RAW_DATA_OWNER though, so it can be optimized
-- later. */
-- if (tok2->type == CPP_CLOSE_BRACE && orig_len == INT_MAX)
-- {
-- last = 1;
-- break;
-- }
-+ prev_loc = last_loc;
- last_loc = tok->location;
- c_parser_consume_token (parser);
- c_parser_consume_token (parser);
- }
-+ /* If orig_len is INT_MAX, this can be flexible array member and
-+ in that case we need to ensure another element which
-+ for CPP_EMBED is normally guaranteed after it. Include
-+ that byte in the RAW_DATA_OWNER though, so it can be optimized
-+ later. */
-+ if (orig_len == INT_MAX
-+ && (!c_parser_next_token_is (parser, CPP_COMMA)
-+ || c_parser_peek_2nd_token (parser)->type != CPP_NUMBER))
-+ {
-+ --i;
-+ last = 1;
-+ std::swap (prev_loc, last_loc);
-+ lastc = (unsigned char) buf2[i + off];
-+ }
- val = make_node (RAW_DATA_CST);
- TREE_TYPE (val) = integer_type_node;
- RAW_DATA_LENGTH (val) = i;
-@@ -6625,6 +6633,13 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- init.original_type = integer_type_node;
- init.m_decimal = 0;
- process_init_element (loc, init, false, braced_init_obstack);
-+ if (last)
-+ {
-+ init.value = build_int_cst (integer_type_node, lastc);
-+ init.original_code = INTEGER_CST;
-+ set_c_expr_source_range (&init, prev_loc, prev_loc);
-+ process_init_element (prev_loc, init, false, braced_init_obstack);
-+ }
- }
- }
-
-diff --git a/gcc/testsuite/c-c++-common/init-4.c b/gcc/testsuite/c-c++-common/init-4.c
-new file mode 100644
-index 00000000000..d575a3f5a51
---- /dev/null
-+++ b/gcc/testsuite/c-c++-common/init-4.c
-@@ -0,0 +1,97 @@
-+/* { dg-do run } */
-+/* { dg-options "-O2" } */
-+
-+unsigned char a1[] = {
-+ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
-+ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
-+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
-+ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
-+ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
-+ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
-+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
-+ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
-+ 0xfa, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+};
-+unsigned char a2[] = {
-+ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
-+ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
-+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
-+ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
-+ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
-+ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
-+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
-+ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00
-+};
-+unsigned char a3[] = {
-+ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
-+ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
-+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
-+ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
-+ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
-+ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
-+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
-+ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
-+};
-+unsigned char a4[] = {
-+ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
-+ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
-+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
-+ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
-+ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
-+ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
-+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
-+ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
-+ 0xfa
-+};
-+unsigned char a5[] = {
-+ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
-+ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
-+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
-+ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
-+ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
-+ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
-+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
-+ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
-+ 0xfa,
-+};
-+unsigned char a6[] = {
-+ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
-+ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
-+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
-+ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
-+ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
-+ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
-+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
-+ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
-+ 0xfa, 0xfb
-+};
-+unsigned char a7[] = {
-+ 0xc8, 0xc9, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
-+ 0x00, 0xd1, 0x00, 0xd3, 0xd4, 0x00, 0xd6, 0xd7,
-+ 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0x00, 0x00, 0xdf,
-+ 0xe0, 0xe1, 0xe2, 0x00, 0xe4, 0xe5, 0xe6, 0xe7,
-+ 0xe8, 0xe9, 0xea, 0xeb, 0x00, 0xed, 0xee, 0xef,
-+ 0x00, 0xf1, 0x00, 0xf3, 0xf4, 0x00, 0xf6, 0xf7,
-+ 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0x00, 0x00, 0xff,
-+ 0x00, 0x00, 0xc3, 0xe3, 0x00, 0x00, 0x00, 0x00,
-+ 0xfa, 0xfb
-+};
-+
-+int
-+main ()
-+{
-+ if (sizeof (a1) != 72
-+ || sizeof (a2) != 64
-+ || __builtin_memcmp (a1, a2, 64) != 0
-+ || sizeof (a3) != 64
-+ || __builtin_memcmp (a1, a3, 64) != 0
-+ || sizeof (a4) != 65
-+ || __builtin_memcmp (a1, a4, 65) != 0
-+ || sizeof (a5) != 65
-+ || __builtin_memcmp (a1, a5, 65) != 0
-+ || sizeof (a6) != 66
-+ || __builtin_memcmp (a1, a6, 66) != 0
-+ || sizeof (a7) != 66
-+ || __builtin_memcmp (a1, a7, 66) != 0)
-+ __builtin_abort ();
-+}
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-17 23:03 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-17 23:03 UTC (permalink / raw
To: gentoo-commits
commit: e1ed90a71415a98a6d4c7d6efe03b5e0551fbb4c
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 17 23:02:59 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 17 23:02:59 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e1ed90a7
15.0.0: add 72_all_PR117192-andn.patch
Bug: https://gcc.gnu.org/PR117192
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117192-andn.patch | 94 ++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/15.0.0/gentoo/72_all_PR117192-andn.patch b/15.0.0/gentoo/72_all_PR117192-andn.patch
new file mode 100644
index 0000000..5593ae0
--- /dev/null
+++ b/15.0.0/gentoo/72_all_PR117192-andn.patch
@@ -0,0 +1,94 @@
+https://gcc.gnu.org/PR17192
+
+From 70f59d2a1c51bde085d8fc7df002918851e76c9c Mon Sep 17 00:00:00 2001
+From: "Cui, Lili" <lili.cui@intel.com>
+Date: Thu, 17 Oct 2024 08:50:38 +0800
+Subject: [PATCH] Support andn_optab for x86
+
+Add new andn pattern to match the new optab added by
+r15-1890-gf379596e0ba99d. Only enable 64bit, 128bit and
+256bit vector ANDN, X86-64 has mask mov instruction when
+avx512 is enabled.
+
+gcc/ChangeLog:
+
+ * config/i386/sse.md (andn<mode>3): New.
+ * config/i386/mmx.md (andn<mode>3): New.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.target/i386/vect-cmp.C: New test.
+---
+ gcc/config/i386/mmx.md | 7 +++++++
+ gcc/config/i386/sse.md | 7 +++++++
+ gcc/testsuite/g++.target/i386/vect-cmp.C | 23 +++++++++++++++++++++++
+ 3 files changed, 37 insertions(+)
+ create mode 100644 gcc/testsuite/g++.target/i386/vect-cmp.C
+
+diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
+index 9d2a82c598e5..ef4ed8b501a1 100644
+--- a/gcc/config/i386/mmx.md
++++ b/gcc/config/i386/mmx.md
+@@ -4467,6 +4467,13 @@
+ operands[0] = lowpart_subreg (V16QImode, operands[0], <MODE>mode);
+ })
+
++(define_expand "andn<mode>3"
++ [(set (match_operand:MMXMODEI 0 "register_operand")
++ (and:MMXMODEI
++ (not:MMXMODEI (match_operand:MMXMODEI 1 "register_operand"))
++ (match_operand:MMXMODEI 2 "register_operand")))]
++ "TARGET_SSE2")
++
+ (define_insn "mmx_andnot<mode>3"
+ [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,x,v")
+ (and:MMXMODEI
+diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
+index a45b50ad7324..7be313346677 100644
+--- a/gcc/config/i386/sse.md
++++ b/gcc/config/i386/sse.md
+@@ -18438,6 +18438,13 @@
+ (match_operand:VI_AVX2 2 "vector_operand")))]
+ "TARGET_SSE2")
+
++(define_expand "andn<mode>3"
++ [(set (match_operand:VI 0 "register_operand")
++ (and:VI
++ (not:VI (match_operand:VI 2 "register_operand"))
++ (match_operand:VI 1 "register_operand")))]
++ "TARGET_SSE2")
++
+ (define_expand "<sse2_avx2>_andnot<mode>3_mask"
+ [(set (match_operand:VI48_AVX512VL 0 "register_operand")
+ (vec_merge:VI48_AVX512VL
+diff --git a/gcc/testsuite/g++.target/i386/vect-cmp.C b/gcc/testsuite/g++.target/i386/vect-cmp.C
+new file mode 100644
+index 000000000000..c154474fa51c
+--- /dev/null
++++ b/gcc/testsuite/g++.target/i386/vect-cmp.C
+@@ -0,0 +1,23 @@
++/* { dg-do compile } */
++/* { dg-options "-O2 -march=x86-64-v3 -fdump-tree-optimized" } */
++
++#define vect8 __attribute__((vector_size(8) ))
++#define vect16 __attribute__((vector_size(16) ))
++#define vect32 __attribute__((vector_size(32) ))
++
++vect8 int bar0 (vect8 float a, vect8 float b, vect8 int c)
++{
++ return (a > b) ? 0 : c;
++}
++
++vect16 int bar1 (vect16 float a, vect16 float b, vect16 int c)
++{
++ return (a > b) ? 0 : c;
++}
++
++vect32 int bar2 (vect32 float a, vect32 float b, vect32 int c)
++{
++ return (a > b) ? 0 : c;
++}
++
++/* { dg-final { scan-tree-dump-times ".BIT_ANDN " 3 "optimized" { target { ! ia32 } } } } */
+--
+2.43.5
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-17 23:33 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-17 23:33 UTC (permalink / raw
To: gentoo-commits
commit: 137934d3c0119acebb59614f6627e8b4fe299feb
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 17 23:33:01 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 17 23:33:17 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=137934d3
15.0.0: fix 72_all_PR117192-andn.patch
Doh. Apply the patch, not the commit it's fixing...
Fixes: e1ed90a71415a98a6d4c7d6efe03b5e0551fbb4c
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117192-andn.patch | 98 ++++----------------------------
1 file changed, 12 insertions(+), 86 deletions(-)
diff --git a/15.0.0/gentoo/72_all_PR117192-andn.patch b/15.0.0/gentoo/72_all_PR117192-andn.patch
index 5593ae0..f7706c1 100644
--- a/15.0.0/gentoo/72_all_PR117192-andn.patch
+++ b/15.0.0/gentoo/72_all_PR117192-andn.patch
@@ -1,94 +1,20 @@
https://gcc.gnu.org/PR17192
-
-From 70f59d2a1c51bde085d8fc7df002918851e76c9c Mon Sep 17 00:00:00 2001
-From: "Cui, Lili" <lili.cui@intel.com>
-Date: Thu, 17 Oct 2024 08:50:38 +0800
-Subject: [PATCH] Support andn_optab for x86
-
-Add new andn pattern to match the new optab added by
-r15-1890-gf379596e0ba99d. Only enable 64bit, 128bit and
-256bit vector ANDN, X86-64 has mask mov instruction when
-avx512 is enabled.
-
-gcc/ChangeLog:
-
- * config/i386/sse.md (andn<mode>3): New.
- * config/i386/mmx.md (andn<mode>3): New.
-
-gcc/testsuite/ChangeLog:
-
- * g++.target/i386/vect-cmp.C: New test.
----
- gcc/config/i386/mmx.md | 7 +++++++
- gcc/config/i386/sse.md | 7 +++++++
- gcc/testsuite/g++.target/i386/vect-cmp.C | 23 +++++++++++++++++++++++
- 3 files changed, 37 insertions(+)
- create mode 100644 gcc/testsuite/g++.target/i386/vect-cmp.C
+https://gcc.gnu.org/bugzilla/attachment.cgi?id=59373
diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
-index 9d2a82c598e5..ef4ed8b501a1 100644
+index ef4ed8b501a..506f4cab6a8 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
-@@ -4467,6 +4467,13 @@
- operands[0] = lowpart_subreg (V16QImode, operands[0], <MODE>mode);
- })
+@@ -4470,9 +4470,9 @@ (define_split
+ (define_expand "andn<mode>3"
+ [(set (match_operand:MMXMODEI 0 "register_operand")
+ (and:MMXMODEI
+- (not:MMXMODEI (match_operand:MMXMODEI 1 "register_operand"))
+- (match_operand:MMXMODEI 2 "register_operand")))]
+- "TARGET_SSE2")
++ (not:MMXMODEI (match_operand:MMXMODEI 2 "register_operand"))
++ (match_operand:MMXMODEI 1 "register_operand")))]
++ "TARGET_MMX_WITH_SSE")
-+(define_expand "andn<mode>3"
-+ [(set (match_operand:MMXMODEI 0 "register_operand")
-+ (and:MMXMODEI
-+ (not:MMXMODEI (match_operand:MMXMODEI 1 "register_operand"))
-+ (match_operand:MMXMODEI 2 "register_operand")))]
-+ "TARGET_SSE2")
-+
(define_insn "mmx_andnot<mode>3"
[(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,x,v")
- (and:MMXMODEI
-diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
-index a45b50ad7324..7be313346677 100644
---- a/gcc/config/i386/sse.md
-+++ b/gcc/config/i386/sse.md
-@@ -18438,6 +18438,13 @@
- (match_operand:VI_AVX2 2 "vector_operand")))]
- "TARGET_SSE2")
-
-+(define_expand "andn<mode>3"
-+ [(set (match_operand:VI 0 "register_operand")
-+ (and:VI
-+ (not:VI (match_operand:VI 2 "register_operand"))
-+ (match_operand:VI 1 "register_operand")))]
-+ "TARGET_SSE2")
-+
- (define_expand "<sse2_avx2>_andnot<mode>3_mask"
- [(set (match_operand:VI48_AVX512VL 0 "register_operand")
- (vec_merge:VI48_AVX512VL
-diff --git a/gcc/testsuite/g++.target/i386/vect-cmp.C b/gcc/testsuite/g++.target/i386/vect-cmp.C
-new file mode 100644
-index 000000000000..c154474fa51c
---- /dev/null
-+++ b/gcc/testsuite/g++.target/i386/vect-cmp.C
-@@ -0,0 +1,23 @@
-+/* { dg-do compile } */
-+/* { dg-options "-O2 -march=x86-64-v3 -fdump-tree-optimized" } */
-+
-+#define vect8 __attribute__((vector_size(8) ))
-+#define vect16 __attribute__((vector_size(16) ))
-+#define vect32 __attribute__((vector_size(32) ))
-+
-+vect8 int bar0 (vect8 float a, vect8 float b, vect8 int c)
-+{
-+ return (a > b) ? 0 : c;
-+}
-+
-+vect16 int bar1 (vect16 float a, vect16 float b, vect16 int c)
-+{
-+ return (a > b) ? 0 : c;
-+}
-+
-+vect32 int bar2 (vect32 float a, vect32 float b, vect32 int c)
-+{
-+ return (a > b) ? 0 : c;
-+}
-+
-+/* { dg-final { scan-tree-dump-times ".BIT_ANDN " 3 "optimized" { target { ! ia32 } } } } */
---
-2.43.5
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-18 10:35 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-18 10:35 UTC (permalink / raw
To: gentoo-commits
commit: 462456df6da32e138cdc1e18df6e681cc2dc948a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 18 10:34:47 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 18 10:34:47 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=462456df
15.0.0: revert some embed patches
Do as Jakub suggests at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117190#c3
and revert these for now until a fix can be applied.
Bug: https://gcc.gnu.org/PR117190
Bug: https://gcc.gnu.org/PR117199
Bug: https://gcc.gnu.org/PR117201
Signed-off-by: Sam James <sam <AT> gentoo.org>
...x-up-speed-up-compilation-of-large-char-a.patch | 97 ++++++++++
...eed-up-compilation-of-large-char-array-in.patch | 212 +++++++++++++++++++++
2 files changed, 309 insertions(+)
diff --git a/15.0.0/gentoo/73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch b/15.0.0/gentoo/73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
new file mode 100644
index 0000000..47f26cc
--- /dev/null
+++ b/15.0.0/gentoo/73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
@@ -0,0 +1,97 @@
+From bfec21e6cf88b0b64bfcc30d2f5ae3b3370e36e3 Mon Sep 17 00:00:00 2001
+Message-ID: <bfec21e6cf88b0b64bfcc30d2f5ae3b3370e36e3.1729247640.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Fri, 18 Oct 2024 11:31:20 +0100
+Subject: [PATCH 1/2] Revert "c: Fix up speed up compilation of large char
+ array initializers when not using #embed [PR117177]"
+
+This reverts commit 96ba5e5663d4390a7e69735ce3c9de657fc543fc.
+
+Keep the testcase.
+
+Bug: https://gcc.gnu.org/PR117190
+---
+ gcc/c/c-parser.cc | 35 ++++++++++-------------------------
+ 1 file changed, 10 insertions(+), 25 deletions(-)
+
+diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
+index 090ab1cbc088..e4381044e5cb 100644
+--- a/gcc/c/c-parser.cc
++++ b/gcc/c/c-parser.cc
+@@ -6529,7 +6529,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ unsigned int i;
+ gcc_checking_assert (len >= 64);
+ location_t last_loc = UNKNOWN_LOCATION;
+- location_t prev_loc = UNKNOWN_LOCATION;
+ for (i = 0; i < 64; ++i)
+ {
+ c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
+@@ -6545,7 +6544,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ buf1[i] = (char) tree_to_uhwi (tok->value);
+ if (i == 0)
+ loc = tok->location;
+- prev_loc = last_loc;
+ last_loc = tok->location;
+ }
+ if (i < 64)
+@@ -6569,7 +6567,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ unsigned int max_len = 131072 - offsetof (struct tree_string, str) - 1;
+ unsigned int orig_len = len;
+ unsigned int off = 0, last = 0;
+- unsigned char lastc = 0;
+ if (!wi::neg_p (wi::to_wide (val)) && wi::to_widest (val) <= UCHAR_MAX)
+ off = 1;
+ len = MIN (len, max_len - off);
+@@ -6599,25 +6596,20 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ if (tok2->type != CPP_COMMA && tok2->type != CPP_CLOSE_BRACE)
+ break;
+ buf2[i + off] = (char) tree_to_uhwi (tok->value);
+- prev_loc = last_loc;
++ /* If orig_len is INT_MAX, this can be flexible array member and
++ in that case we need to ensure another element which
++ for CPP_EMBED is normally guaranteed after it. Include
++ that byte in the RAW_DATA_OWNER though, so it can be optimized
++ later. */
++ if (tok2->type == CPP_CLOSE_BRACE && orig_len == INT_MAX)
++ {
++ last = 1;
++ break;
++ }
+ last_loc = tok->location;
+ c_parser_consume_token (parser);
+ c_parser_consume_token (parser);
+ }
+- /* If orig_len is INT_MAX, this can be flexible array member and
+- in that case we need to ensure another element which
+- for CPP_EMBED is normally guaranteed after it. Include
+- that byte in the RAW_DATA_OWNER though, so it can be optimized
+- later. */
+- if (orig_len == INT_MAX
+- && (!c_parser_next_token_is (parser, CPP_COMMA)
+- || c_parser_peek_2nd_token (parser)->type != CPP_NUMBER))
+- {
+- --i;
+- last = 1;
+- std::swap (prev_loc, last_loc);
+- lastc = (unsigned char) buf2[i + off];
+- }
+ val = make_node (RAW_DATA_CST);
+ TREE_TYPE (val) = integer_type_node;
+ RAW_DATA_LENGTH (val) = i;
+@@ -6633,13 +6625,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ init.original_type = integer_type_node;
+ init.m_decimal = 0;
+ process_init_element (loc, init, false, braced_init_obstack);
+- if (last)
+- {
+- init.value = build_int_cst (integer_type_node, lastc);
+- init.original_code = INTEGER_CST;
+- set_c_expr_source_range (&init, prev_loc, prev_loc);
+- process_init_element (prev_loc, init, false, braced_init_obstack);
+- }
+ }
+ }
+
+--
+2.47.0
+
diff --git a/15.0.0/gentoo/74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch b/15.0.0/gentoo/74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch
new file mode 100644
index 0000000..889c961
--- /dev/null
+++ b/15.0.0/gentoo/74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch
@@ -0,0 +1,212 @@
+From ec2844301e40a017a32b4f11f499d6db7629c6bf Mon Sep 17 00:00:00 2001
+Message-ID: <ec2844301e40a017a32b4f11f499d6db7629c6bf.1729247640.git.sam@gentoo.org>
+In-Reply-To: <bfec21e6cf88b0b64bfcc30d2f5ae3b3370e36e3.1729247640.git.sam@gentoo.org>
+References: <bfec21e6cf88b0b64bfcc30d2f5ae3b3370e36e3.1729247640.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Fri, 18 Oct 2024 11:31:27 +0100
+Subject: [PATCH 2/2] Revert "c: Speed up compilation of large char array
+ initializers when not using #embed"
+
+This reverts commit f9bac238840155e1539aa68daf1507ea63c9ed80.
+
+Keep the testcase.
+
+Bug: https://gcc.gnu.org/PR117190
+---
+ gcc/c/c-parser.cc | 118 ----------------------------------------------
+ gcc/c/c-tree.h | 1 -
+ gcc/c/c-typeck.cc | 36 --------------
+ 3 files changed, 155 deletions(-)
+
+diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
+index e4381044e5cb..9518459a0a57 100644
+--- a/gcc/c/c-parser.cc
++++ b/gcc/c/c-parser.cc
+@@ -6507,125 +6507,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ (init.value))))
+ init = convert_lvalue_to_rvalue (loc, init, true, true, true);
+ }
+- tree val = init.value;
+ process_init_element (loc, init, false, braced_init_obstack);
+-
+- /* Attempt to optimize large char array initializers into RAW_DATA_CST
+- to save compile time and memory even when not using #embed. */
+- static unsigned vals_to_ignore;
+- if (vals_to_ignore)
+- /* If earlier call determined there is certain number of CPP_COMMA
+- CPP_NUMBER tokens with 0-255 int values, but not enough for
+- RAW_DATA_CST to be beneficial, don't try to check it again until
+- they are all parsed. */
+- --vals_to_ignore;
+- else if (val
+- && TREE_CODE (val) == INTEGER_CST
+- && TREE_TYPE (val) == integer_type_node
+- && c_parser_next_token_is (parser, CPP_COMMA))
+- if (unsigned int len = c_maybe_optimize_large_byte_initializer ())
+- {
+- char buf1[64];
+- unsigned int i;
+- gcc_checking_assert (len >= 64);
+- location_t last_loc = UNKNOWN_LOCATION;
+- for (i = 0; i < 64; ++i)
+- {
+- c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
+- if (tok->type != CPP_COMMA)
+- break;
+- tok = c_parser_peek_nth_token_raw (parser, 2 + 2 * i);
+- if (tok->type != CPP_NUMBER
+- || TREE_CODE (tok->value) != INTEGER_CST
+- || TREE_TYPE (tok->value) != integer_type_node
+- || wi::neg_p (wi::to_wide (tok->value))
+- || wi::to_widest (tok->value) > UCHAR_MAX)
+- break;
+- buf1[i] = (char) tree_to_uhwi (tok->value);
+- if (i == 0)
+- loc = tok->location;
+- last_loc = tok->location;
+- }
+- if (i < 64)
+- {
+- vals_to_ignore = i;
+- return;
+- }
+- c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
+- /* If 64 CPP_COMMA CPP_NUMBER pairs are followed by CPP_CLOSE_BRACE,
+- punt if len is INT_MAX as that can mean this is a flexible array
+- member and in that case we need one CPP_NUMBER afterwards
+- (as guaranteed for CPP_EMBED). */
+- if (tok->type == CPP_CLOSE_BRACE && len != INT_MAX)
+- len = i;
+- else if (tok->type != CPP_COMMA)
+- {
+- vals_to_ignore = i;
+- return;
+- }
+- /* Ensure the STRING_CST fits into 128K. */
+- unsigned int max_len = 131072 - offsetof (struct tree_string, str) - 1;
+- unsigned int orig_len = len;
+- unsigned int off = 0, last = 0;
+- if (!wi::neg_p (wi::to_wide (val)) && wi::to_widest (val) <= UCHAR_MAX)
+- off = 1;
+- len = MIN (len, max_len - off);
+- char *buf2 = XNEWVEC (char, len + off);
+- if (off)
+- buf2[0] = (char) tree_to_uhwi (val);
+- memcpy (buf2 + off, buf1, i);
+- for (unsigned int j = 0; j < i; ++j)
+- {
+- c_parser_peek_token (parser);
+- c_parser_consume_token (parser);
+- c_parser_peek_token (parser);
+- c_parser_consume_token (parser);
+- }
+- for (; i < len; ++i)
+- {
+- if (!c_parser_next_token_is (parser, CPP_COMMA))
+- break;
+- tok = c_parser_peek_2nd_token (parser);
+- if (tok->type != CPP_NUMBER
+- || TREE_CODE (tok->value) != INTEGER_CST
+- || TREE_TYPE (tok->value) != integer_type_node
+- || wi::neg_p (wi::to_wide (tok->value))
+- || wi::to_widest (tok->value) > UCHAR_MAX)
+- break;
+- c_token *tok2 = c_parser_peek_nth_token (parser, 3);
+- if (tok2->type != CPP_COMMA && tok2->type != CPP_CLOSE_BRACE)
+- break;
+- buf2[i + off] = (char) tree_to_uhwi (tok->value);
+- /* If orig_len is INT_MAX, this can be flexible array member and
+- in that case we need to ensure another element which
+- for CPP_EMBED is normally guaranteed after it. Include
+- that byte in the RAW_DATA_OWNER though, so it can be optimized
+- later. */
+- if (tok2->type == CPP_CLOSE_BRACE && orig_len == INT_MAX)
+- {
+- last = 1;
+- break;
+- }
+- last_loc = tok->location;
+- c_parser_consume_token (parser);
+- c_parser_consume_token (parser);
+- }
+- val = make_node (RAW_DATA_CST);
+- TREE_TYPE (val) = integer_type_node;
+- RAW_DATA_LENGTH (val) = i;
+- tree owner = build_string (i + off + last, buf2);
+- XDELETEVEC (buf2);
+- TREE_TYPE (owner) = build_array_type_nelts (unsigned_char_type_node,
+- i + off + last);
+- RAW_DATA_OWNER (val) = owner;
+- RAW_DATA_POINTER (val) = TREE_STRING_POINTER (owner) + off;
+- init.value = val;
+- set_c_expr_source_range (&init, loc, last_loc);
+- init.original_code = RAW_DATA_CST;
+- init.original_type = integer_type_node;
+- init.m_decimal = 0;
+- process_init_element (loc, init, false, braced_init_obstack);
+- }
+ }
+
+ /* Parse a compound statement (possibly a function body) (C90 6.6.2,
+diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
+index bfdcb78bbcc1..e23d8e59ac4b 100644
+--- a/gcc/c/c-tree.h
++++ b/gcc/c/c-tree.h
+@@ -832,7 +832,6 @@ extern struct c_expr pop_init_level (location_t, int, struct obstack *,
+ location_t);
+ extern void set_init_index (location_t, tree, tree, struct obstack *);
+ extern void set_init_label (location_t, tree, location_t, struct obstack *);
+-unsigned c_maybe_optimize_large_byte_initializer (void);
+ extern void process_init_element (location_t, struct c_expr, bool,
+ struct obstack *);
+ extern tree build_compound_literal (location_t, tree, tree, bool,
+diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
+index 108ea5ca3e8c..36d0b23a3d72 100644
+--- a/gcc/c/c-typeck.cc
++++ b/gcc/c/c-typeck.cc
+@@ -11347,42 +11347,6 @@ maybe_split_raw_data (tree value, tree *raw_data)
+ return value;
+ }
+
+-/* Return non-zero if c_parser_initval should attempt to optimize
+- large initializers into RAW_DATA_CST. In that case return how
+- many elements to optimize at most. */
+-
+-unsigned
+-c_maybe_optimize_large_byte_initializer (void)
+-{
+- if (!constructor_type
+- || TREE_CODE (constructor_type) != ARRAY_TYPE
+- || constructor_stack->implicit)
+- return 0;
+- tree elttype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_type));
+- if (TREE_CODE (elttype) != INTEGER_TYPE
+- && TREE_CODE (elttype) != BITINT_TYPE)
+- return 0;
+- if (TYPE_PRECISION (elttype) != CHAR_BIT
+- || constructor_stack->replacement_value.value
+- || (COMPLETE_TYPE_P (constructor_type)
+- && !poly_int_tree_p (TYPE_SIZE (constructor_type)))
+- || constructor_range_stack)
+- return 0;
+- if (constructor_max_index == NULL_TREE)
+- return INT_MAX;
+- if (tree_int_cst_le (constructor_max_index, constructor_index)
+- || integer_all_onesp (constructor_max_index))
+- return 0;
+- widest_int w = wi::to_widest (constructor_max_index);
+- w -= wi::to_widest (constructor_index);
+- w += 1;
+- if (w < 64)
+- return 0;
+- if (w > INT_MAX)
+- return INT_MAX;
+- return w.to_uhwi ();
+-}
+-
+ /* Add one non-braced element to the current constructor level.
+ This adjusts the current position within the constructor's type.
+ This may also start or terminate implicit levels
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-18 14:05 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-18 14:05 UTC (permalink / raw
To: gentoo-commits
commit: a36914b3932f5ae93d9f18d445be959cd61f1dff
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 18 14:05:27 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 18 14:05:27 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a36914b3
15.0.0: drop 72_all_PR117192-andn.patch
Merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117192-andn.patch | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/15.0.0/gentoo/72_all_PR117192-andn.patch b/15.0.0/gentoo/72_all_PR117192-andn.patch
deleted file mode 100644
index f7706c1..0000000
--- a/15.0.0/gentoo/72_all_PR117192-andn.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-https://gcc.gnu.org/PR17192
-https://gcc.gnu.org/bugzilla/attachment.cgi?id=59373
-
-diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
-index ef4ed8b501a..506f4cab6a8 100644
---- a/gcc/config/i386/mmx.md
-+++ b/gcc/config/i386/mmx.md
-@@ -4470,9 +4470,9 @@ (define_split
- (define_expand "andn<mode>3"
- [(set (match_operand:MMXMODEI 0 "register_operand")
- (and:MMXMODEI
-- (not:MMXMODEI (match_operand:MMXMODEI 1 "register_operand"))
-- (match_operand:MMXMODEI 2 "register_operand")))]
-- "TARGET_SSE2")
-+ (not:MMXMODEI (match_operand:MMXMODEI 2 "register_operand"))
-+ (match_operand:MMXMODEI 1 "register_operand")))]
-+ "TARGET_MMX_WITH_SSE")
-
- (define_insn "mmx_andnot<mode>3"
- [(set (match_operand:MMXMODEI 0 "register_operand" "=y,x,x,v")
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-20 22:42 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-20 22:42 UTC (permalink / raw
To: gentoo-commits
commit: cc3680147a9d8db04f71bb6d4c30a5985e9deefe
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 20 22:42:13 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 20 22:42:13 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=cc368014
15.0.0: cut patchset 17
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 073283d..52ceb20 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+17 20 October 2024
+
+ + 73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
+ + 74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch
+
16 13 October 2024
+ 70_all_PR116506-coro.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-21 11:45 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-21 11:45 UTC (permalink / raw
To: gentoo-commits
commit: 059d75a5509ca0a831a4aebb4f944fb6dc09a205
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 21 11:44:52 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 21 11:44:52 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=059d75a5
15.0.0: add 75_all_PR117220-uninitialized-clang.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../75_all_PR117220-uninitialized-clang.patch | 65 ++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 ++
2 files changed, 69 insertions(+)
diff --git a/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch b/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch
new file mode 100644
index 0000000..f923cbd
--- /dev/null
+++ b/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch
@@ -0,0 +1,65 @@
+From 8974ee300419c422f8d771343263c05af0a53a2a Mon Sep 17 00:00:00 2001
+Message-ID: <8974ee300419c422f8d771343263c05af0a53a2a.1729510984.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Mon, 21 Oct 2024 12:42:16 +0100
+Subject: [PATCH] libstdc++: fix stl_iterator.h for Clang
+
+libstdc++-v3/ChangeLog:
+ PR libstdc++/117220
+
+ * include/bits/stl_iterator.h: Fix attribute order for Clang.
+--- a/libstdc++-v3/include/bits/stl_iterator.h
++++ b/libstdc++-v3/include/bits/stl_iterator.h
+@@ -1077,13 +1077,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ // Forward iterator requirements
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ reference
+ operator*() const _GLIBCXX_NOEXCEPT
+ { return *_M_current; }
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ pointer
+ operator->() const _GLIBCXX_NOEXCEPT
+@@ -1123,7 +1123,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ // Random access iterator requirements
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ reference
+ operator[](difference_type __n) const _GLIBCXX_NOEXCEPT
+@@ -1135,7 +1135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ operator+=(difference_type __n) _GLIBCXX_NOEXCEPT
+ { _M_current += __n; return *this; }
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ __normal_iterator
+ operator+(difference_type __n) const _GLIBCXX_NOEXCEPT
+@@ -1147,13 +1147,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ operator-=(difference_type __n) _GLIBCXX_NOEXCEPT
+ { _M_current -= __n; return *this; }
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ __normal_iterator
+ operator-(difference_type __n) const _GLIBCXX_NOEXCEPT
+ { return __normal_iterator(_M_current - __n); }
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ const _Iterator&
+ base() const _GLIBCXX_NOEXCEPT
+--
+2.47.0
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 52ceb20..7cc59ef 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+18 21 October 2024
+
+ + 75_all_PR117220-uninitialized-clang.patch
+
17 20 October 2024
+ 73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-21 12:26 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-21 12:26 UTC (permalink / raw
To: gentoo-commits
commit: 7aa175a83520bb175c4588301daaa9ab14117bc7
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 21 12:26:03 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 21 12:26:03 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7aa175a8
15.0.0: drop 75_all_PR117220-uninitialized-clang.patch
A variant is now merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../75_all_PR117220-uninitialized-clang.patch | 65 ----------------------
1 file changed, 65 deletions(-)
diff --git a/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch b/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch
deleted file mode 100644
index f923cbd..0000000
--- a/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 8974ee300419c422f8d771343263c05af0a53a2a Mon Sep 17 00:00:00 2001
-Message-ID: <8974ee300419c422f8d771343263c05af0a53a2a.1729510984.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Mon, 21 Oct 2024 12:42:16 +0100
-Subject: [PATCH] libstdc++: fix stl_iterator.h for Clang
-
-libstdc++-v3/ChangeLog:
- PR libstdc++/117220
-
- * include/bits/stl_iterator.h: Fix attribute order for Clang.
---- a/libstdc++-v3/include/bits/stl_iterator.h
-+++ b/libstdc++-v3/include/bits/stl_iterator.h
-@@ -1077,13 +1077,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- // Forward iterator requirements
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- reference
- operator*() const _GLIBCXX_NOEXCEPT
- { return *_M_current; }
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- pointer
- operator->() const _GLIBCXX_NOEXCEPT
-@@ -1123,7 +1123,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- // Random access iterator requirements
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- reference
- operator[](difference_type __n) const _GLIBCXX_NOEXCEPT
-@@ -1135,7 +1135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- operator+=(difference_type __n) _GLIBCXX_NOEXCEPT
- { _M_current += __n; return *this; }
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- __normal_iterator
- operator+(difference_type __n) const _GLIBCXX_NOEXCEPT
-@@ -1147,13 +1147,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- operator-=(difference_type __n) _GLIBCXX_NOEXCEPT
- { _M_current -= __n; return *this; }
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- __normal_iterator
- operator-(difference_type __n) const _GLIBCXX_NOEXCEPT
- { return __normal_iterator(_M_current - __n); }
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- const _Iterator&
- base() const _GLIBCXX_NOEXCEPT
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-21 12:27 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-21 12:27 UTC (permalink / raw
To: gentoo-commits
commit: 5ecbc3c9e907f74fa12599e0fa5672553cc8db15
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 21 12:27:28 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 21 12:27:28 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5ecbc3c9
15.0.0: update 75_all_PR117220-uninitialized-clang.patch
... to roll one more patchset with it in, then we can drop it for live.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../75_all_PR117220-uninitialized-clang.patch | 223 +++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +
2 files changed, 227 insertions(+)
diff --git a/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch b/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch
new file mode 100644
index 0000000..a6acc09
--- /dev/null
+++ b/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch
@@ -0,0 +1,223 @@
+From cba80691251efccf44ab9aecb26558319605c9ea Mon Sep 17 00:00:00 2001
+Message-ID: <cba80691251efccf44ab9aecb26558319605c9ea.1729513605.git.sam@gentoo.org>
+From: Jonathan Wakely <jwakely@redhat.com>
+Date: Mon, 21 Oct 2024 12:09:36 +0100
+Subject: [PATCH] libstdc++: Fix order of [[...]] and __attribute__((...))
+ attrs [PR117220]
+
+GCC allows these in either order, but Clang doesn't like the C++11-style
+[[__nodiscard__]] coming after __attribute__((__always_inline__)).
+
+libstdc++-v3/ChangeLog:
+
+ PR libstdc++/117220
+ * include/bits/stl_iterator.h: Move _GLIBCXX_NODISCARD
+ annotations after __attribute__((__always_inline__)).
+--- a/libstdc++-v3/include/bits/stl_iterator.h
++++ b/libstdc++-v3/include/bits/stl_iterator.h
+@@ -1077,13 +1077,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ // Forward iterator requirements
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ reference
+ operator*() const _GLIBCXX_NOEXCEPT
+ { return *_M_current; }
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ pointer
+ operator->() const _GLIBCXX_NOEXCEPT
+@@ -1123,7 +1123,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ // Random access iterator requirements
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ reference
+ operator[](difference_type __n) const _GLIBCXX_NOEXCEPT
+@@ -1135,7 +1135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ operator+=(difference_type __n) _GLIBCXX_NOEXCEPT
+ { _M_current += __n; return *this; }
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ __normal_iterator
+ operator+(difference_type __n) const _GLIBCXX_NOEXCEPT
+@@ -1147,13 +1147,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ operator-=(difference_type __n) _GLIBCXX_NOEXCEPT
+ { _M_current -= __n; return *this; }
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ __normal_iterator
+ operator-(difference_type __n) const _GLIBCXX_NOEXCEPT
+ { return __normal_iterator(_M_current - __n); }
+
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX_CONSTEXPR
+ const _Iterator&
+ base() const _GLIBCXX_NOEXCEPT
+@@ -1209,7 +1209,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ #else
+ // Forward iterator requirements
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+@@ -1217,7 +1217,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() == __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+@@ -1225,7 +1225,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() == __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+@@ -1233,7 +1233,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() != __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+@@ -1242,7 +1242,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ // Random access iterator requirements
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+@@ -1250,7 +1250,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() < __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
+ inline bool
+ operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+@@ -1258,7 +1258,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() < __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+@@ -1266,7 +1266,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() > __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+@@ -1274,7 +1274,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() > __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+@@ -1282,7 +1282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() <= __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+@@ -1290,7 +1290,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() <= __rhs.base(); }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
+ const __normal_iterator<_IteratorR, _Container>& __rhs)
+@@ -1298,7 +1298,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() >= __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline bool
+ operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+@@ -1326,7 +1326,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() - __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline typename __normal_iterator<_Iterator, _Container>::difference_type
+ operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
+ const __normal_iterator<_Iterator, _Container>& __rhs)
+@@ -1334,7 +1334,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ { return __lhs.base() - __rhs.base(); }
+
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
+ inline __normal_iterator<_Iterator, _Container>
+ operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
+ __n, const __normal_iterator<_Iterator, _Container>& __i)
+@@ -2990,7 +2990,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ // Unwrap a __normal_iterator to get the underlying iterator
+ // (usually a pointer). See uses in std::copy, std::fill, etc.
+ template<typename _Iterator, typename _Container>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX20_CONSTEXPR
+ inline _Iterator
+ __niter_base(__gnu_cxx::__normal_iterator<_Iterator, _Container> __it)
+@@ -2999,7 +2999,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ // Fallback implementation used for iterators that can't be unwrapped.
+ template<typename _Iterator>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX20_CONSTEXPR
+ inline _Iterator
+ __niter_base(_Iterator __it)
+@@ -3071,7 +3071,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ // No need to wrap, iterator already has the right type.
+ template<typename _Iterator>
+- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
++ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
+ _GLIBCXX20_CONSTEXPR
+ inline _Iterator
+ __niter_wrap(const _Iterator&, _Iterator __res)
+--
+2.47.0
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 7cc59ef..da76e70 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+19 21 October 2024
+
+ U 75_all_PR117220-uninitialized-clang.patch
+
18 21 October 2024
+ 75_all_PR117220-uninitialized-clang.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-21 12:33 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-21 12:33 UTC (permalink / raw
To: gentoo-commits
commit: cea84be3fb8da9cc115f6fd5a4836c45356f6dc3
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 21 12:32:54 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 21 12:32:54 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=cea84be3
15.0.0: drop 75_all_PR117220-uninitialized-clang.patch
Merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../75_all_PR117220-uninitialized-clang.patch | 223 ---------------------
1 file changed, 223 deletions(-)
diff --git a/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch b/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch
deleted file mode 100644
index a6acc09..0000000
--- a/15.0.0/gentoo/75_all_PR117220-uninitialized-clang.patch
+++ /dev/null
@@ -1,223 +0,0 @@
-From cba80691251efccf44ab9aecb26558319605c9ea Mon Sep 17 00:00:00 2001
-Message-ID: <cba80691251efccf44ab9aecb26558319605c9ea.1729513605.git.sam@gentoo.org>
-From: Jonathan Wakely <jwakely@redhat.com>
-Date: Mon, 21 Oct 2024 12:09:36 +0100
-Subject: [PATCH] libstdc++: Fix order of [[...]] and __attribute__((...))
- attrs [PR117220]
-
-GCC allows these in either order, but Clang doesn't like the C++11-style
-[[__nodiscard__]] coming after __attribute__((__always_inline__)).
-
-libstdc++-v3/ChangeLog:
-
- PR libstdc++/117220
- * include/bits/stl_iterator.h: Move _GLIBCXX_NODISCARD
- annotations after __attribute__((__always_inline__)).
---- a/libstdc++-v3/include/bits/stl_iterator.h
-+++ b/libstdc++-v3/include/bits/stl_iterator.h
-@@ -1077,13 +1077,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- // Forward iterator requirements
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- reference
- operator*() const _GLIBCXX_NOEXCEPT
- { return *_M_current; }
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- pointer
- operator->() const _GLIBCXX_NOEXCEPT
-@@ -1123,7 +1123,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- // Random access iterator requirements
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- reference
- operator[](difference_type __n) const _GLIBCXX_NOEXCEPT
-@@ -1135,7 +1135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- operator+=(difference_type __n) _GLIBCXX_NOEXCEPT
- { _M_current += __n; return *this; }
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- __normal_iterator
- operator+(difference_type __n) const _GLIBCXX_NOEXCEPT
-@@ -1147,13 +1147,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- operator-=(difference_type __n) _GLIBCXX_NOEXCEPT
- { _M_current -= __n; return *this; }
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- __normal_iterator
- operator-(difference_type __n) const _GLIBCXX_NOEXCEPT
- { return __normal_iterator(_M_current - __n); }
-
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX_CONSTEXPR
- const _Iterator&
- base() const _GLIBCXX_NOEXCEPT
-@@ -1209,7 +1209,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- #else
- // Forward iterator requirements
- template<typename _IteratorL, typename _IteratorR, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-@@ -1217,7 +1217,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() == __rhs.base(); }
-
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
- const __normal_iterator<_Iterator, _Container>& __rhs)
-@@ -1225,7 +1225,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() == __rhs.base(); }
-
- template<typename _IteratorL, typename _IteratorR, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-@@ -1233,7 +1233,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() != __rhs.base(); }
-
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
- const __normal_iterator<_Iterator, _Container>& __rhs)
-@@ -1242,7 +1242,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- // Random access iterator requirements
- template<typename _IteratorL, typename _IteratorR, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-@@ -1250,7 +1250,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() < __rhs.base(); }
-
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX20_CONSTEXPR
- inline bool
- operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
- const __normal_iterator<_Iterator, _Container>& __rhs)
-@@ -1258,7 +1258,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() < __rhs.base(); }
-
- template<typename _IteratorL, typename _IteratorR, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-@@ -1266,7 +1266,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() > __rhs.base(); }
-
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
- const __normal_iterator<_Iterator, _Container>& __rhs)
-@@ -1274,7 +1274,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() > __rhs.base(); }
-
- template<typename _IteratorL, typename _IteratorR, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-@@ -1282,7 +1282,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() <= __rhs.base(); }
-
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
- const __normal_iterator<_Iterator, _Container>& __rhs)
-@@ -1290,7 +1290,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() <= __rhs.base(); }
-
- template<typename _IteratorL, typename _IteratorR, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
- const __normal_iterator<_IteratorR, _Container>& __rhs)
-@@ -1298,7 +1298,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() >= __rhs.base(); }
-
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline bool
- operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
- const __normal_iterator<_Iterator, _Container>& __rhs)
-@@ -1326,7 +1326,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() - __rhs.base(); }
-
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline typename __normal_iterator<_Iterator, _Container>::difference_type
- operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
- const __normal_iterator<_Iterator, _Container>& __rhs)
-@@ -1334,7 +1334,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- { return __lhs.base() - __rhs.base(); }
-
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD _GLIBCXX_CONSTEXPR
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__)) _GLIBCXX_CONSTEXPR
- inline __normal_iterator<_Iterator, _Container>
- operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
- __n, const __normal_iterator<_Iterator, _Container>& __i)
-@@ -2990,7 +2990,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
- // Unwrap a __normal_iterator to get the underlying iterator
- // (usually a pointer). See uses in std::copy, std::fill, etc.
- template<typename _Iterator, typename _Container>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX20_CONSTEXPR
- inline _Iterator
- __niter_base(__gnu_cxx::__normal_iterator<_Iterator, _Container> __it)
-@@ -2999,7 +2999,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- // Fallback implementation used for iterators that can't be unwrapped.
- template<typename _Iterator>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX20_CONSTEXPR
- inline _Iterator
- __niter_base(_Iterator __it)
-@@ -3071,7 +3071,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- // No need to wrap, iterator already has the right type.
- template<typename _Iterator>
-- __attribute__((__always_inline__)) _GLIBCXX_NODISCARD
-+ _GLIBCXX_NODISCARD __attribute__((__always_inline__))
- _GLIBCXX20_CONSTEXPR
- inline _Iterator
- __niter_wrap(const _Iterator&, _Iterator __res)
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-22 18:34 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-22 18:34 UTC (permalink / raw
To: gentoo-commits
commit: a243737dd99899c96fa69256022d1d94a1d91c92
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 22 18:33:44 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct 22 18:33:44 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a243737d
15.0.0: drop obsolete embed patches
It's fixed now so no need for reverts.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...x-up-speed-up-compilation-of-large-char-a.patch | 97 ----------
...eed-up-compilation-of-large-char-array-in.patch | 212 ---------------------
15.0.0/gentoo/README.history | 5 +
3 files changed, 5 insertions(+), 309 deletions(-)
diff --git a/15.0.0/gentoo/73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch b/15.0.0/gentoo/73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
deleted file mode 100644
index 47f26cc..0000000
--- a/15.0.0/gentoo/73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From bfec21e6cf88b0b64bfcc30d2f5ae3b3370e36e3 Mon Sep 17 00:00:00 2001
-Message-ID: <bfec21e6cf88b0b64bfcc30d2f5ae3b3370e36e3.1729247640.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Fri, 18 Oct 2024 11:31:20 +0100
-Subject: [PATCH 1/2] Revert "c: Fix up speed up compilation of large char
- array initializers when not using #embed [PR117177]"
-
-This reverts commit 96ba5e5663d4390a7e69735ce3c9de657fc543fc.
-
-Keep the testcase.
-
-Bug: https://gcc.gnu.org/PR117190
----
- gcc/c/c-parser.cc | 35 ++++++++++-------------------------
- 1 file changed, 10 insertions(+), 25 deletions(-)
-
-diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
-index 090ab1cbc088..e4381044e5cb 100644
---- a/gcc/c/c-parser.cc
-+++ b/gcc/c/c-parser.cc
-@@ -6529,7 +6529,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- unsigned int i;
- gcc_checking_assert (len >= 64);
- location_t last_loc = UNKNOWN_LOCATION;
-- location_t prev_loc = UNKNOWN_LOCATION;
- for (i = 0; i < 64; ++i)
- {
- c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
-@@ -6545,7 +6544,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- buf1[i] = (char) tree_to_uhwi (tok->value);
- if (i == 0)
- loc = tok->location;
-- prev_loc = last_loc;
- last_loc = tok->location;
- }
- if (i < 64)
-@@ -6569,7 +6567,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- unsigned int max_len = 131072 - offsetof (struct tree_string, str) - 1;
- unsigned int orig_len = len;
- unsigned int off = 0, last = 0;
-- unsigned char lastc = 0;
- if (!wi::neg_p (wi::to_wide (val)) && wi::to_widest (val) <= UCHAR_MAX)
- off = 1;
- len = MIN (len, max_len - off);
-@@ -6599,25 +6596,20 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- if (tok2->type != CPP_COMMA && tok2->type != CPP_CLOSE_BRACE)
- break;
- buf2[i + off] = (char) tree_to_uhwi (tok->value);
-- prev_loc = last_loc;
-+ /* If orig_len is INT_MAX, this can be flexible array member and
-+ in that case we need to ensure another element which
-+ for CPP_EMBED is normally guaranteed after it. Include
-+ that byte in the RAW_DATA_OWNER though, so it can be optimized
-+ later. */
-+ if (tok2->type == CPP_CLOSE_BRACE && orig_len == INT_MAX)
-+ {
-+ last = 1;
-+ break;
-+ }
- last_loc = tok->location;
- c_parser_consume_token (parser);
- c_parser_consume_token (parser);
- }
-- /* If orig_len is INT_MAX, this can be flexible array member and
-- in that case we need to ensure another element which
-- for CPP_EMBED is normally guaranteed after it. Include
-- that byte in the RAW_DATA_OWNER though, so it can be optimized
-- later. */
-- if (orig_len == INT_MAX
-- && (!c_parser_next_token_is (parser, CPP_COMMA)
-- || c_parser_peek_2nd_token (parser)->type != CPP_NUMBER))
-- {
-- --i;
-- last = 1;
-- std::swap (prev_loc, last_loc);
-- lastc = (unsigned char) buf2[i + off];
-- }
- val = make_node (RAW_DATA_CST);
- TREE_TYPE (val) = integer_type_node;
- RAW_DATA_LENGTH (val) = i;
-@@ -6633,13 +6625,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- init.original_type = integer_type_node;
- init.m_decimal = 0;
- process_init_element (loc, init, false, braced_init_obstack);
-- if (last)
-- {
-- init.value = build_int_cst (integer_type_node, lastc);
-- init.original_code = INTEGER_CST;
-- set_c_expr_source_range (&init, prev_loc, prev_loc);
-- process_init_element (prev_loc, init, false, braced_init_obstack);
-- }
- }
- }
-
---
-2.47.0
-
diff --git a/15.0.0/gentoo/74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch b/15.0.0/gentoo/74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch
deleted file mode 100644
index 889c961..0000000
--- a/15.0.0/gentoo/74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-From ec2844301e40a017a32b4f11f499d6db7629c6bf Mon Sep 17 00:00:00 2001
-Message-ID: <ec2844301e40a017a32b4f11f499d6db7629c6bf.1729247640.git.sam@gentoo.org>
-In-Reply-To: <bfec21e6cf88b0b64bfcc30d2f5ae3b3370e36e3.1729247640.git.sam@gentoo.org>
-References: <bfec21e6cf88b0b64bfcc30d2f5ae3b3370e36e3.1729247640.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Fri, 18 Oct 2024 11:31:27 +0100
-Subject: [PATCH 2/2] Revert "c: Speed up compilation of large char array
- initializers when not using #embed"
-
-This reverts commit f9bac238840155e1539aa68daf1507ea63c9ed80.
-
-Keep the testcase.
-
-Bug: https://gcc.gnu.org/PR117190
----
- gcc/c/c-parser.cc | 118 ----------------------------------------------
- gcc/c/c-tree.h | 1 -
- gcc/c/c-typeck.cc | 36 --------------
- 3 files changed, 155 deletions(-)
-
-diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
-index e4381044e5cb..9518459a0a57 100644
---- a/gcc/c/c-parser.cc
-+++ b/gcc/c/c-parser.cc
-@@ -6507,125 +6507,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- (init.value))))
- init = convert_lvalue_to_rvalue (loc, init, true, true, true);
- }
-- tree val = init.value;
- process_init_element (loc, init, false, braced_init_obstack);
--
-- /* Attempt to optimize large char array initializers into RAW_DATA_CST
-- to save compile time and memory even when not using #embed. */
-- static unsigned vals_to_ignore;
-- if (vals_to_ignore)
-- /* If earlier call determined there is certain number of CPP_COMMA
-- CPP_NUMBER tokens with 0-255 int values, but not enough for
-- RAW_DATA_CST to be beneficial, don't try to check it again until
-- they are all parsed. */
-- --vals_to_ignore;
-- else if (val
-- && TREE_CODE (val) == INTEGER_CST
-- && TREE_TYPE (val) == integer_type_node
-- && c_parser_next_token_is (parser, CPP_COMMA))
-- if (unsigned int len = c_maybe_optimize_large_byte_initializer ())
-- {
-- char buf1[64];
-- unsigned int i;
-- gcc_checking_assert (len >= 64);
-- location_t last_loc = UNKNOWN_LOCATION;
-- for (i = 0; i < 64; ++i)
-- {
-- c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
-- if (tok->type != CPP_COMMA)
-- break;
-- tok = c_parser_peek_nth_token_raw (parser, 2 + 2 * i);
-- if (tok->type != CPP_NUMBER
-- || TREE_CODE (tok->value) != INTEGER_CST
-- || TREE_TYPE (tok->value) != integer_type_node
-- || wi::neg_p (wi::to_wide (tok->value))
-- || wi::to_widest (tok->value) > UCHAR_MAX)
-- break;
-- buf1[i] = (char) tree_to_uhwi (tok->value);
-- if (i == 0)
-- loc = tok->location;
-- last_loc = tok->location;
-- }
-- if (i < 64)
-- {
-- vals_to_ignore = i;
-- return;
-- }
-- c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
-- /* If 64 CPP_COMMA CPP_NUMBER pairs are followed by CPP_CLOSE_BRACE,
-- punt if len is INT_MAX as that can mean this is a flexible array
-- member and in that case we need one CPP_NUMBER afterwards
-- (as guaranteed for CPP_EMBED). */
-- if (tok->type == CPP_CLOSE_BRACE && len != INT_MAX)
-- len = i;
-- else if (tok->type != CPP_COMMA)
-- {
-- vals_to_ignore = i;
-- return;
-- }
-- /* Ensure the STRING_CST fits into 128K. */
-- unsigned int max_len = 131072 - offsetof (struct tree_string, str) - 1;
-- unsigned int orig_len = len;
-- unsigned int off = 0, last = 0;
-- if (!wi::neg_p (wi::to_wide (val)) && wi::to_widest (val) <= UCHAR_MAX)
-- off = 1;
-- len = MIN (len, max_len - off);
-- char *buf2 = XNEWVEC (char, len + off);
-- if (off)
-- buf2[0] = (char) tree_to_uhwi (val);
-- memcpy (buf2 + off, buf1, i);
-- for (unsigned int j = 0; j < i; ++j)
-- {
-- c_parser_peek_token (parser);
-- c_parser_consume_token (parser);
-- c_parser_peek_token (parser);
-- c_parser_consume_token (parser);
-- }
-- for (; i < len; ++i)
-- {
-- if (!c_parser_next_token_is (parser, CPP_COMMA))
-- break;
-- tok = c_parser_peek_2nd_token (parser);
-- if (tok->type != CPP_NUMBER
-- || TREE_CODE (tok->value) != INTEGER_CST
-- || TREE_TYPE (tok->value) != integer_type_node
-- || wi::neg_p (wi::to_wide (tok->value))
-- || wi::to_widest (tok->value) > UCHAR_MAX)
-- break;
-- c_token *tok2 = c_parser_peek_nth_token (parser, 3);
-- if (tok2->type != CPP_COMMA && tok2->type != CPP_CLOSE_BRACE)
-- break;
-- buf2[i + off] = (char) tree_to_uhwi (tok->value);
-- /* If orig_len is INT_MAX, this can be flexible array member and
-- in that case we need to ensure another element which
-- for CPP_EMBED is normally guaranteed after it. Include
-- that byte in the RAW_DATA_OWNER though, so it can be optimized
-- later. */
-- if (tok2->type == CPP_CLOSE_BRACE && orig_len == INT_MAX)
-- {
-- last = 1;
-- break;
-- }
-- last_loc = tok->location;
-- c_parser_consume_token (parser);
-- c_parser_consume_token (parser);
-- }
-- val = make_node (RAW_DATA_CST);
-- TREE_TYPE (val) = integer_type_node;
-- RAW_DATA_LENGTH (val) = i;
-- tree owner = build_string (i + off + last, buf2);
-- XDELETEVEC (buf2);
-- TREE_TYPE (owner) = build_array_type_nelts (unsigned_char_type_node,
-- i + off + last);
-- RAW_DATA_OWNER (val) = owner;
-- RAW_DATA_POINTER (val) = TREE_STRING_POINTER (owner) + off;
-- init.value = val;
-- set_c_expr_source_range (&init, loc, last_loc);
-- init.original_code = RAW_DATA_CST;
-- init.original_type = integer_type_node;
-- init.m_decimal = 0;
-- process_init_element (loc, init, false, braced_init_obstack);
-- }
- }
-
- /* Parse a compound statement (possibly a function body) (C90 6.6.2,
-diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
-index bfdcb78bbcc1..e23d8e59ac4b 100644
---- a/gcc/c/c-tree.h
-+++ b/gcc/c/c-tree.h
-@@ -832,7 +832,6 @@ extern struct c_expr pop_init_level (location_t, int, struct obstack *,
- location_t);
- extern void set_init_index (location_t, tree, tree, struct obstack *);
- extern void set_init_label (location_t, tree, location_t, struct obstack *);
--unsigned c_maybe_optimize_large_byte_initializer (void);
- extern void process_init_element (location_t, struct c_expr, bool,
- struct obstack *);
- extern tree build_compound_literal (location_t, tree, tree, bool,
-diff --git a/gcc/c/c-typeck.cc b/gcc/c/c-typeck.cc
-index 108ea5ca3e8c..36d0b23a3d72 100644
---- a/gcc/c/c-typeck.cc
-+++ b/gcc/c/c-typeck.cc
-@@ -11347,42 +11347,6 @@ maybe_split_raw_data (tree value, tree *raw_data)
- return value;
- }
-
--/* Return non-zero if c_parser_initval should attempt to optimize
-- large initializers into RAW_DATA_CST. In that case return how
-- many elements to optimize at most. */
--
--unsigned
--c_maybe_optimize_large_byte_initializer (void)
--{
-- if (!constructor_type
-- || TREE_CODE (constructor_type) != ARRAY_TYPE
-- || constructor_stack->implicit)
-- return 0;
-- tree elttype = TYPE_MAIN_VARIANT (TREE_TYPE (constructor_type));
-- if (TREE_CODE (elttype) != INTEGER_TYPE
-- && TREE_CODE (elttype) != BITINT_TYPE)
-- return 0;
-- if (TYPE_PRECISION (elttype) != CHAR_BIT
-- || constructor_stack->replacement_value.value
-- || (COMPLETE_TYPE_P (constructor_type)
-- && !poly_int_tree_p (TYPE_SIZE (constructor_type)))
-- || constructor_range_stack)
-- return 0;
-- if (constructor_max_index == NULL_TREE)
-- return INT_MAX;
-- if (tree_int_cst_le (constructor_max_index, constructor_index)
-- || integer_all_onesp (constructor_max_index))
-- return 0;
-- widest_int w = wi::to_widest (constructor_max_index);
-- w -= wi::to_widest (constructor_index);
-- w += 1;
-- if (w < 64)
-- return 0;
-- if (w > INT_MAX)
-- return INT_MAX;
-- return w.to_uhwi ();
--}
--
- /* Add one non-braced element to the current constructor level.
- This adjusts the current position within the constructor's type.
- This may also start or terminate implicit levels
---
-2.47.0
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index da76e70..bc7c1e6 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+20 ????
+
+ - 73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
+ - 74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch
+
19 21 October 2024
U 75_all_PR117220-uninitialized-clang.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-22 19:09 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-22 19:09 UTC (permalink / raw
To: gentoo-commits
commit: 52de78302a3c40e11a16185917bf8bb4bccfd199
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 22 19:09:05 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct 22 19:09:05 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=52de7830
15.0.0: add 72_all_PR117190.patch
This patch isn't yet merged but should be soon.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117190.patch | 179 ++++++++++++++++++++++++++++++++++++
1 file changed, 179 insertions(+)
diff --git a/15.0.0/gentoo/72_all_PR117190.patch b/15.0.0/gentoo/72_all_PR117190.patch
new file mode 100644
index 0000000..497d788
--- /dev/null
+++ b/15.0.0/gentoo/72_all_PR117190.patch
@@ -0,0 +1,179 @@
+From 756a3f3aad7200052d9aee207717c9766dce8be1 Mon Sep 17 00:00:00 2001
+Message-ID: <756a3f3aad7200052d9aee207717c9766dce8be1.1729624110.git.sam@gentoo.org>
+From: Jakub Jelinek <jakub@redhat.com>
+Date: Tue, 22 Oct 2024 20:03:35 +0200
+Subject: [PATCH] c: Better fix for speed up compilation of large char array
+ initializers when not using #embed [PR117190]
+
+On Wed, Oct 16, 2024 at 11:09:32PM +0200, Jakub Jelinek wrote:
+> Apparently my
+> c: Speed up compilation of large char array initializers when not using #embed
+> patch broke building glibc.
+>
+> The issue is that when using CPP_EMBED, we are guaranteed by the
+> preprocessor that there is CPP_NUMBER CPP_COMMA before it and
+> CPP_COMMA CPP_NUMBER after it (or CPP_COMMA CPP_EMBED), so RAW_DATA_CST
+> never ends up at the end of arrays of unknown length.
+> Now, the c_parser_initval optimization attempted to preserve that property
+> rather than changing everything that e.g. inferes array number of elements
+> from the initializer etc. to deal with RAW_DATA_CST at the end, but
+> it didn't take into account the possibility that there could be
+> CPP_COMMA followed by CPP_CLOSE_BRACE (where the CPP_COMMA is redundant).
+>
+> As we are peaking already at 4 tokens in that code, peeking more would
+> require using raw tokens and that seems to be expensive doing it for
+> every pair of tokens due to vec_free done when we are out of raw tokens.
+
+Sorry for rushing the previous patch too much, turns out I was wrong,
+given that the c_parser_peek_nth_token numbering is 1 based, we can peek
+also with c_parser_peek_nth_token (parser, 4) and the loop actually peeked
+just at 3 tokens, not 4.
+
+So, I think it is better to revert the previous patch (but keep the new
+test) and instead peek the 4th non-raw token, which is what the following
+patch does.
+
+Additionally, PR117190 shows one further spot which missed the peek of
+the token after CPP_COMMA, in case it is incomplete array with exactly 65
+elements with redundant comma after it, which this patch handles too.
+
+Bootstrapped/regtested on x86_64-linux, i686-linux, powerpc64le-linux
+and powerpc64-linux, ok for trunk?
+
+2024-10-22 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/117190
+gcc/c/
+ * c-parser.cc (c_parser_initval): Revert 2024-10-17 changes.
+ Instead peek the 4th token and if it is not CPP_NUMBER,
+ handle it like 3rd token CPP_CLOSE_BRACE for orig_len == INT_MAX.
+ Also, check (2 + 2 * i)th raw token for the orig_len == INT_MAX
+ case and punt if it is not CPP_NUMBER.
+gcc/testsuite/
+ * c-c++-common/init-5.c: New test.
+---
+ gcc/c/c-parser.cc | 42 +++++++++++------------------
+ gcc/testsuite/c-c++-common/init-5.c | 19 +++++++++++++
+ 2 files changed, 35 insertions(+), 26 deletions(-)
+ create mode 100644 gcc/testsuite/c-c++-common/init-5.c
+
+diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
+index 090ab1cbc088..3f2d7ddc5c42 100644
+--- a/gcc/c/c-parser.cc
++++ b/gcc/c/c-parser.cc
+@@ -6529,7 +6529,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ unsigned int i;
+ gcc_checking_assert (len >= 64);
+ location_t last_loc = UNKNOWN_LOCATION;
+- location_t prev_loc = UNKNOWN_LOCATION;
+ for (i = 0; i < 64; ++i)
+ {
+ c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
+@@ -6545,7 +6544,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ buf1[i] = (char) tree_to_uhwi (tok->value);
+ if (i == 0)
+ loc = tok->location;
+- prev_loc = last_loc;
+ last_loc = tok->location;
+ }
+ if (i < 64)
+@@ -6560,7 +6558,9 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ (as guaranteed for CPP_EMBED). */
+ if (tok->type == CPP_CLOSE_BRACE && len != INT_MAX)
+ len = i;
+- else if (tok->type != CPP_COMMA)
++ else if (tok->type != CPP_COMMA
++ || (c_parser_peek_nth_token_raw (parser, 2 + 2 * i)->type
++ != CPP_NUMBER))
+ {
+ vals_to_ignore = i;
+ return;
+@@ -6569,7 +6569,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ unsigned int max_len = 131072 - offsetof (struct tree_string, str) - 1;
+ unsigned int orig_len = len;
+ unsigned int off = 0, last = 0;
+- unsigned char lastc = 0;
+ if (!wi::neg_p (wi::to_wide (val)) && wi::to_widest (val) <= UCHAR_MAX)
+ off = 1;
+ len = MIN (len, max_len - off);
+@@ -6599,25 +6598,23 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ if (tok2->type != CPP_COMMA && tok2->type != CPP_CLOSE_BRACE)
+ break;
+ buf2[i + off] = (char) tree_to_uhwi (tok->value);
+- prev_loc = last_loc;
++ /* If orig_len is INT_MAX, this can be flexible array member and
++ in that case we need to ensure another element which
++ for CPP_EMBED is normally guaranteed after it. Include
++ that byte in the RAW_DATA_OWNER though, so it can be optimized
++ later. */
++ if (orig_len == INT_MAX
++ && (tok2->type == CPP_CLOSE_BRACE
++ || (c_parser_peek_nth_token (parser, 4)->type
++ != CPP_NUMBER)))
++ {
++ last = 1;
++ break;
++ }
+ last_loc = tok->location;
+ c_parser_consume_token (parser);
+ c_parser_consume_token (parser);
+ }
+- /* If orig_len is INT_MAX, this can be flexible array member and
+- in that case we need to ensure another element which
+- for CPP_EMBED is normally guaranteed after it. Include
+- that byte in the RAW_DATA_OWNER though, so it can be optimized
+- later. */
+- if (orig_len == INT_MAX
+- && (!c_parser_next_token_is (parser, CPP_COMMA)
+- || c_parser_peek_2nd_token (parser)->type != CPP_NUMBER))
+- {
+- --i;
+- last = 1;
+- std::swap (prev_loc, last_loc);
+- lastc = (unsigned char) buf2[i + off];
+- }
+ val = make_node (RAW_DATA_CST);
+ TREE_TYPE (val) = integer_type_node;
+ RAW_DATA_LENGTH (val) = i;
+@@ -6633,13 +6630,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
+ init.original_type = integer_type_node;
+ init.m_decimal = 0;
+ process_init_element (loc, init, false, braced_init_obstack);
+- if (last)
+- {
+- init.value = build_int_cst (integer_type_node, lastc);
+- init.original_code = INTEGER_CST;
+- set_c_expr_source_range (&init, prev_loc, prev_loc);
+- process_init_element (prev_loc, init, false, braced_init_obstack);
+- }
+ }
+ }
+
+diff --git a/gcc/testsuite/c-c++-common/init-5.c b/gcc/testsuite/c-c++-common/init-5.c
+new file mode 100644
+index 000000000000..61b6cdb97e2f
+--- /dev/null
++++ b/gcc/testsuite/c-c++-common/init-5.c
+@@ -0,0 +1,19 @@
++/* PR c/117190 */
++/* { dg-do run } */
++/* { dg-options "-O2" } */
++
++struct S { char d[]; } v = {
++{ 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
++ 0, }
++};
++
++int
++main ()
++{
++ for (int i = 0; i < 65; ++i)
++ if (v.d[i] != (i == 0 ? 8 : 0))
++ __builtin_abort ();
++}
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-23 15:40 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-23 15:40 UTC (permalink / raw
To: gentoo-commits
commit: d4278761ff6c0c703c8cf4d105cac664e15a0df8
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 23 15:39:45 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 23 15:39:45 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d4278761
15.0.0: drop 72_all_PR117190.patch
Merged upstream now.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117190.patch | 179 ------------------------------------
1 file changed, 179 deletions(-)
diff --git a/15.0.0/gentoo/72_all_PR117190.patch b/15.0.0/gentoo/72_all_PR117190.patch
deleted file mode 100644
index 497d788..0000000
--- a/15.0.0/gentoo/72_all_PR117190.patch
+++ /dev/null
@@ -1,179 +0,0 @@
-From 756a3f3aad7200052d9aee207717c9766dce8be1 Mon Sep 17 00:00:00 2001
-Message-ID: <756a3f3aad7200052d9aee207717c9766dce8be1.1729624110.git.sam@gentoo.org>
-From: Jakub Jelinek <jakub@redhat.com>
-Date: Tue, 22 Oct 2024 20:03:35 +0200
-Subject: [PATCH] c: Better fix for speed up compilation of large char array
- initializers when not using #embed [PR117190]
-
-On Wed, Oct 16, 2024 at 11:09:32PM +0200, Jakub Jelinek wrote:
-> Apparently my
-> c: Speed up compilation of large char array initializers when not using #embed
-> patch broke building glibc.
->
-> The issue is that when using CPP_EMBED, we are guaranteed by the
-> preprocessor that there is CPP_NUMBER CPP_COMMA before it and
-> CPP_COMMA CPP_NUMBER after it (or CPP_COMMA CPP_EMBED), so RAW_DATA_CST
-> never ends up at the end of arrays of unknown length.
-> Now, the c_parser_initval optimization attempted to preserve that property
-> rather than changing everything that e.g. inferes array number of elements
-> from the initializer etc. to deal with RAW_DATA_CST at the end, but
-> it didn't take into account the possibility that there could be
-> CPP_COMMA followed by CPP_CLOSE_BRACE (where the CPP_COMMA is redundant).
->
-> As we are peaking already at 4 tokens in that code, peeking more would
-> require using raw tokens and that seems to be expensive doing it for
-> every pair of tokens due to vec_free done when we are out of raw tokens.
-
-Sorry for rushing the previous patch too much, turns out I was wrong,
-given that the c_parser_peek_nth_token numbering is 1 based, we can peek
-also with c_parser_peek_nth_token (parser, 4) and the loop actually peeked
-just at 3 tokens, not 4.
-
-So, I think it is better to revert the previous patch (but keep the new
-test) and instead peek the 4th non-raw token, which is what the following
-patch does.
-
-Additionally, PR117190 shows one further spot which missed the peek of
-the token after CPP_COMMA, in case it is incomplete array with exactly 65
-elements with redundant comma after it, which this patch handles too.
-
-Bootstrapped/regtested on x86_64-linux, i686-linux, powerpc64le-linux
-and powerpc64-linux, ok for trunk?
-
-2024-10-22 Jakub Jelinek <jakub@redhat.com>
-
- PR c/117190
-gcc/c/
- * c-parser.cc (c_parser_initval): Revert 2024-10-17 changes.
- Instead peek the 4th token and if it is not CPP_NUMBER,
- handle it like 3rd token CPP_CLOSE_BRACE for orig_len == INT_MAX.
- Also, check (2 + 2 * i)th raw token for the orig_len == INT_MAX
- case and punt if it is not CPP_NUMBER.
-gcc/testsuite/
- * c-c++-common/init-5.c: New test.
----
- gcc/c/c-parser.cc | 42 +++++++++++------------------
- gcc/testsuite/c-c++-common/init-5.c | 19 +++++++++++++
- 2 files changed, 35 insertions(+), 26 deletions(-)
- create mode 100644 gcc/testsuite/c-c++-common/init-5.c
-
-diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
-index 090ab1cbc088..3f2d7ddc5c42 100644
---- a/gcc/c/c-parser.cc
-+++ b/gcc/c/c-parser.cc
-@@ -6529,7 +6529,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- unsigned int i;
- gcc_checking_assert (len >= 64);
- location_t last_loc = UNKNOWN_LOCATION;
-- location_t prev_loc = UNKNOWN_LOCATION;
- for (i = 0; i < 64; ++i)
- {
- c_token *tok = c_parser_peek_nth_token_raw (parser, 1 + 2 * i);
-@@ -6545,7 +6544,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- buf1[i] = (char) tree_to_uhwi (tok->value);
- if (i == 0)
- loc = tok->location;
-- prev_loc = last_loc;
- last_loc = tok->location;
- }
- if (i < 64)
-@@ -6560,7 +6558,9 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- (as guaranteed for CPP_EMBED). */
- if (tok->type == CPP_CLOSE_BRACE && len != INT_MAX)
- len = i;
-- else if (tok->type != CPP_COMMA)
-+ else if (tok->type != CPP_COMMA
-+ || (c_parser_peek_nth_token_raw (parser, 2 + 2 * i)->type
-+ != CPP_NUMBER))
- {
- vals_to_ignore = i;
- return;
-@@ -6569,7 +6569,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- unsigned int max_len = 131072 - offsetof (struct tree_string, str) - 1;
- unsigned int orig_len = len;
- unsigned int off = 0, last = 0;
-- unsigned char lastc = 0;
- if (!wi::neg_p (wi::to_wide (val)) && wi::to_widest (val) <= UCHAR_MAX)
- off = 1;
- len = MIN (len, max_len - off);
-@@ -6599,25 +6598,23 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- if (tok2->type != CPP_COMMA && tok2->type != CPP_CLOSE_BRACE)
- break;
- buf2[i + off] = (char) tree_to_uhwi (tok->value);
-- prev_loc = last_loc;
-+ /* If orig_len is INT_MAX, this can be flexible array member and
-+ in that case we need to ensure another element which
-+ for CPP_EMBED is normally guaranteed after it. Include
-+ that byte in the RAW_DATA_OWNER though, so it can be optimized
-+ later. */
-+ if (orig_len == INT_MAX
-+ && (tok2->type == CPP_CLOSE_BRACE
-+ || (c_parser_peek_nth_token (parser, 4)->type
-+ != CPP_NUMBER)))
-+ {
-+ last = 1;
-+ break;
-+ }
- last_loc = tok->location;
- c_parser_consume_token (parser);
- c_parser_consume_token (parser);
- }
-- /* If orig_len is INT_MAX, this can be flexible array member and
-- in that case we need to ensure another element which
-- for CPP_EMBED is normally guaranteed after it. Include
-- that byte in the RAW_DATA_OWNER though, so it can be optimized
-- later. */
-- if (orig_len == INT_MAX
-- && (!c_parser_next_token_is (parser, CPP_COMMA)
-- || c_parser_peek_2nd_token (parser)->type != CPP_NUMBER))
-- {
-- --i;
-- last = 1;
-- std::swap (prev_loc, last_loc);
-- lastc = (unsigned char) buf2[i + off];
-- }
- val = make_node (RAW_DATA_CST);
- TREE_TYPE (val) = integer_type_node;
- RAW_DATA_LENGTH (val) = i;
-@@ -6633,13 +6630,6 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
- init.original_type = integer_type_node;
- init.m_decimal = 0;
- process_init_element (loc, init, false, braced_init_obstack);
-- if (last)
-- {
-- init.value = build_int_cst (integer_type_node, lastc);
-- init.original_code = INTEGER_CST;
-- set_c_expr_source_range (&init, prev_loc, prev_loc);
-- process_init_element (prev_loc, init, false, braced_init_obstack);
-- }
- }
- }
-
-diff --git a/gcc/testsuite/c-c++-common/init-5.c b/gcc/testsuite/c-c++-common/init-5.c
-new file mode 100644
-index 000000000000..61b6cdb97e2f
---- /dev/null
-+++ b/gcc/testsuite/c-c++-common/init-5.c
-@@ -0,0 +1,19 @@
-+/* PR c/117190 */
-+/* { dg-do run } */
-+/* { dg-options "-O2" } */
-+
-+struct S { char d[]; } v = {
-+{ 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-+ 0, }
-+};
-+
-+int
-+main ()
-+{
-+ for (int i = 0; i < 65; ++i)
-+ if (v.d[i] != (i == 0 ? 8 : 0))
-+ __builtin_abort ();
-+}
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-28 8:09 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-28 8:09 UTC (permalink / raw
To: gentoo-commits
commit: a7fcb7ce0f8bf2b60e3988d30acb999eb4eb03d3
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 28 08:09:04 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 28 08:09:04 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a7fcb7ce
15.0.0: cut patchset 20
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index bc7c1e6..92e1e14 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-20 ????
+20 28 October 2024
- 73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
- 74_all_PR117190-Revert-c-Speed-up-compilation-of-large-char-array-in.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-28 21:32 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-28 21:32 UTC (permalink / raw
To: gentoo-commits
commit: a0691e3578dcab1c745e963bb4f9ffe2a3889cf3
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 28 21:32:18 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 28 21:32:18 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a0691e35
15.0.0: add 72_all_PR117313-linux.patch
Bug: https://gcc.gnu.org/PR117313
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117313-linux.patch | 104 ++++++++++++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/15.0.0/gentoo/72_all_PR117313-linux.patch b/15.0.0/gentoo/72_all_PR117313-linux.patch
new file mode 100644
index 0000000..c8cb2e8
--- /dev/null
+++ b/15.0.0/gentoo/72_all_PR117313-linux.patch
@@ -0,0 +1,104 @@
+2024-10-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/117313
+gcc/c-family/
+ * c-common.cc (complete_array_type): For RAW_DATA_CST elements
+ advance curindex by RAW_DATA_LENGTH or one less than that if
+ ce->index is non-NULL. Handle even the first element if
+ it is RAW_DATA_CST. Formatting fix.
+gcc/testsuite/
+ * c-c++-common/init-6.c: New test.
+
+--- a/gcc/c-family/c-common.cc 2024-10-27 16:39:55.090871381 +0100
++++ b/gcc/c-family/c-common.cc 2024-10-28 12:30:01.215814079 +0100
+@@ -7044,7 +7044,8 @@ complete_array_type (tree *ptype, tree i
+ {
+ int eltsize
+ = int_size_in_bytes (TREE_TYPE (TREE_TYPE (initial_value)));
+- maxindex = size_int (TREE_STRING_LENGTH (initial_value)/eltsize - 1);
++ maxindex = size_int (TREE_STRING_LENGTH (initial_value) / eltsize
++ - 1);
+ }
+ else if (TREE_CODE (initial_value) == CONSTRUCTOR)
+ {
+@@ -7059,23 +7060,25 @@ complete_array_type (tree *ptype, tree i
+ else
+ {
+ tree curindex;
+- unsigned HOST_WIDE_INT cnt;
++ unsigned HOST_WIDE_INT cnt = 1;
+ constructor_elt *ce;
+ bool fold_p = false;
+
+ if ((*v)[0].index)
+ maxindex = (*v)[0].index, fold_p = true;
++ if (TREE_CODE ((*v)[0].value) == RAW_DATA_CST)
++ cnt = 0;
+
+ curindex = maxindex;
+
+- for (cnt = 1; vec_safe_iterate (v, cnt, &ce); cnt++)
++ for (; vec_safe_iterate (v, cnt, &ce); cnt++)
+ {
+ bool curfold_p = false;
+ if (ce->index)
+ curindex = ce->index, curfold_p = true;
+- else
++ if (!ce->index || TREE_CODE (ce->value) == RAW_DATA_CST)
+ {
+- if (fold_p)
++ if (fold_p || curfold_p)
+ {
+ /* Since we treat size types now as ordinary
+ unsigned types, we need an explicit overflow
+@@ -7083,9 +7086,16 @@ complete_array_type (tree *ptype, tree i
+ tree orig = curindex;
+ curindex = fold_convert (sizetype, curindex);
+ overflow_p |= tree_int_cst_lt (curindex, orig);
++ curfold_p = false;
+ }
+- curindex = size_binop (PLUS_EXPR, curindex,
+- size_one_node);
++ if (TREE_CODE (ce->value) == RAW_DATA_CST)
++ curindex
++ = size_binop (PLUS_EXPR, curindex,
++ size_int (RAW_DATA_LENGTH (ce->value)
++ - (ce->index ? 1 : 0)));
++ else
++ curindex = size_binop (PLUS_EXPR, curindex,
++ size_one_node);
+ }
+ if (tree_int_cst_lt (maxindex, curindex))
+ maxindex = curindex, fold_p = curfold_p;
+--- a/gcc/testsuite/c-c++-common/init-6.c 2024-10-28 12:35:59.526803017 +0100
++++ b/gcc/testsuite/c-c++-common/init-6.c 2024-10-28 12:35:50.394930729 +0100
+@@ -0,0 +1,29 @@
++/* PR c/117313 */
++/* { dg-do compile } */
++/* { dg-options "-O2" } */
++
++struct S { unsigned a; const unsigned char b[]; };
++struct S s = {
++ 1,
++ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5,
++ 0x81, 0xbd, 0x99, 0x81, 0x7e, 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7,
++ 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x10,
++ 0x38, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x18, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x3c,
++ }
++};
++struct S t = {
++ 2,
++ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5,
++ 0x81, 0xbd, 0x99, 0x81, 0x7e, 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7,
++ 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x10,
++ 0x38, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x18, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x3c,
++ 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x10,
++ 0x38, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
++ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
++ 0x18, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x3c
++ }
++};
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-29 19:17 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-29 19:17 UTC (permalink / raw
To: gentoo-commits
commit: cf73522a8c586ea07421892617463fe80a3f05ae
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 29 19:17:04 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Oct 29 19:17:04 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=cf73522a
15.0.0: drop 72_all_PR117313-linux.patch
Merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117313-linux.patch | 104 ------------------------------
1 file changed, 104 deletions(-)
diff --git a/15.0.0/gentoo/72_all_PR117313-linux.patch b/15.0.0/gentoo/72_all_PR117313-linux.patch
deleted file mode 100644
index c8cb2e8..0000000
--- a/15.0.0/gentoo/72_all_PR117313-linux.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-2024-10-28 Jakub Jelinek <jakub@redhat.com>
-
- PR c/117313
-gcc/c-family/
- * c-common.cc (complete_array_type): For RAW_DATA_CST elements
- advance curindex by RAW_DATA_LENGTH or one less than that if
- ce->index is non-NULL. Handle even the first element if
- it is RAW_DATA_CST. Formatting fix.
-gcc/testsuite/
- * c-c++-common/init-6.c: New test.
-
---- a/gcc/c-family/c-common.cc 2024-10-27 16:39:55.090871381 +0100
-+++ b/gcc/c-family/c-common.cc 2024-10-28 12:30:01.215814079 +0100
-@@ -7044,7 +7044,8 @@ complete_array_type (tree *ptype, tree i
- {
- int eltsize
- = int_size_in_bytes (TREE_TYPE (TREE_TYPE (initial_value)));
-- maxindex = size_int (TREE_STRING_LENGTH (initial_value)/eltsize - 1);
-+ maxindex = size_int (TREE_STRING_LENGTH (initial_value) / eltsize
-+ - 1);
- }
- else if (TREE_CODE (initial_value) == CONSTRUCTOR)
- {
-@@ -7059,23 +7060,25 @@ complete_array_type (tree *ptype, tree i
- else
- {
- tree curindex;
-- unsigned HOST_WIDE_INT cnt;
-+ unsigned HOST_WIDE_INT cnt = 1;
- constructor_elt *ce;
- bool fold_p = false;
-
- if ((*v)[0].index)
- maxindex = (*v)[0].index, fold_p = true;
-+ if (TREE_CODE ((*v)[0].value) == RAW_DATA_CST)
-+ cnt = 0;
-
- curindex = maxindex;
-
-- for (cnt = 1; vec_safe_iterate (v, cnt, &ce); cnt++)
-+ for (; vec_safe_iterate (v, cnt, &ce); cnt++)
- {
- bool curfold_p = false;
- if (ce->index)
- curindex = ce->index, curfold_p = true;
-- else
-+ if (!ce->index || TREE_CODE (ce->value) == RAW_DATA_CST)
- {
-- if (fold_p)
-+ if (fold_p || curfold_p)
- {
- /* Since we treat size types now as ordinary
- unsigned types, we need an explicit overflow
-@@ -7083,9 +7086,16 @@ complete_array_type (tree *ptype, tree i
- tree orig = curindex;
- curindex = fold_convert (sizetype, curindex);
- overflow_p |= tree_int_cst_lt (curindex, orig);
-+ curfold_p = false;
- }
-- curindex = size_binop (PLUS_EXPR, curindex,
-- size_one_node);
-+ if (TREE_CODE (ce->value) == RAW_DATA_CST)
-+ curindex
-+ = size_binop (PLUS_EXPR, curindex,
-+ size_int (RAW_DATA_LENGTH (ce->value)
-+ - (ce->index ? 1 : 0)));
-+ else
-+ curindex = size_binop (PLUS_EXPR, curindex,
-+ size_one_node);
- }
- if (tree_int_cst_lt (maxindex, curindex))
- maxindex = curindex, fold_p = curfold_p;
---- a/gcc/testsuite/c-c++-common/init-6.c 2024-10-28 12:35:59.526803017 +0100
-+++ b/gcc/testsuite/c-c++-common/init-6.c 2024-10-28 12:35:50.394930729 +0100
-@@ -0,0 +1,29 @@
-+/* PR c/117313 */
-+/* { dg-do compile } */
-+/* { dg-options "-O2" } */
-+
-+struct S { unsigned a; const unsigned char b[]; };
-+struct S s = {
-+ 1,
-+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5,
-+ 0x81, 0xbd, 0x99, 0x81, 0x7e, 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7,
-+ 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x10,
-+ 0x38, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
-+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x3c,
-+ }
-+};
-+struct S t = {
-+ 2,
-+ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5,
-+ 0x81, 0xbd, 0x99, 0x81, 0x7e, 0x7e, 0xff, 0xdb, 0xff, 0xc3, 0xe7,
-+ 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x10,
-+ 0x38, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
-+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x3c,
-+ 0xff, 0x7e, 0x6c, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x10,
-+ 0x38, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
-+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-+ 0x18, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x3c
-+ }
-+};
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-30 16:03 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-10-30 16:03 UTC (permalink / raw
To: gentoo-commits
commit: e644776e934d664aae0b55d6ec4230327607934e
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 30 16:03:30 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 30 16:03:30 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e644776e
15.0.0: revert bad pattern causing ICE
Bug: https://gcc.gnu.org/PR117363
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117363-revert.patch | 106 +++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)
diff --git a/15.0.0/gentoo/72_all_PR117363-revert.patch b/15.0.0/gentoo/72_all_PR117363-revert.patch
new file mode 100644
index 0000000..3e5be35
--- /dev/null
+++ b/15.0.0/gentoo/72_all_PR117363-revert.patch
@@ -0,0 +1,106 @@
+From a7df875788d7303639123771af1f4238e207f442 Mon Sep 17 00:00:00 2001
+Message-ID: <a7df875788d7303639123771af1f4238e207f442.1730304104.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Wed, 30 Oct 2024 15:59:01 +0000
+Subject: [PATCH] Revert "Match: Simplify (x != 0 ? x + ~0 : 0) to (x - x !=
+ 0)."
+
+This reverts commit 4af8db3eca12b2db3753ce4b098cbd0ae32b4796.
+
+Bug: https://gcc.gnu.org/PR117363
+---
+ gcc/match.pd | 10 ---------
+ gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c | 26 ----------------------
+ gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c | 26 ----------------------
+ 3 files changed, 62 deletions(-)
+ delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
+ delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
+
+diff --git a/gcc/match.pd b/gcc/match.pd
+index c851ac56e37c..809c717bc862 100644
+--- a/gcc/match.pd
++++ b/gcc/match.pd
+@@ -3391,16 +3391,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
+ }
+ (if (wi::eq_p (sum, wi::uhwi (0, precision)))))))
+
+-/* The boundary condition for case 10: IMM = 1:
+- SAT_U_SUB = X >= IMM ? (X - IMM) : 0.
+- simplify (X != 0 ? X + ~0 : 0) to (X - X != 0). */
+-(simplify
+- (cond (ne@1 @0 integer_zerop)
+- (nop_convert? (plus (nop_convert? @0) integer_all_onesp))
+- integer_zerop)
+- (if (INTEGRAL_TYPE_P (type))
+- (minus @0 (convert @1))))
+-
+ /* Signed saturation sub, case 1:
+ T minus = (T)((UT)X - (UT)Y);
+ SAT_S_SUB = (X ^ Y) & (X ^ minus) < 0 ? (-(T)(X < 0) ^ MAX) : minus;
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
+deleted file mode 100644
+index 962bf0954f62..000000000000
+--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
++++ /dev/null
+@@ -1,26 +0,0 @@
+-/* { dg-do compile } */
+-/* { dg-options "-O2 -fdump-tree-phiopt1" } */
+-
+-#include <stdint.h>
+-
+-uint8_t f1 (uint8_t x)
+-{
+- return x >= (uint8_t)1 ? x - (uint8_t)1 : 0;
+-}
+-
+-uint16_t f2 (uint16_t x)
+-{
+- return x >= (uint16_t)1 ? x - (uint16_t)1 : 0;
+-}
+-
+-uint32_t f3 (uint32_t x)
+-{
+- return x >= (uint32_t)1 ? x - (uint32_t)1 : 0;
+-}
+-
+-uint64_t f4 (uint64_t x)
+-{
+- return x >= (uint64_t)1 ? x - (uint64_t)1 : 0;
+-}
+-
+-/* { dg-final { scan-tree-dump-not "goto" "phiopt1" } } */
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
+deleted file mode 100644
+index 62a2ab631846..000000000000
+--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
++++ /dev/null
+@@ -1,26 +0,0 @@
+-/* { dg-do compile } */
+-/* { dg-options "-O2 -fdump-tree-phiopt1" } */
+-
+-#include <stdint.h>
+-
+-int8_t f1 (int8_t x)
+-{
+- return x != 0 ? x - (int8_t)1 : 0;
+-}
+-
+-int16_t f2 (int16_t x)
+-{
+- return x != 0 ? x - (int16_t)1 : 0;
+-}
+-
+-int32_t f3 (int32_t x)
+-{
+- return x != 0 ? x - (int32_t)1 : 0;
+-}
+-
+-int64_t f4 (int64_t x)
+-{
+- return x != 0 ? x - (int64_t)1 : 0;
+-}
+-
+-/* { dg-final { scan-tree-dump-not "goto" "phiopt1" } } */
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-01 8:17 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-01 8:17 UTC (permalink / raw
To: gentoo-commits
commit: e7cf23fa4728ef5ab8ab1e0bde2c1475d91cb7ed
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 1 08:17:03 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 1 08:17:03 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e7cf23fa
15.0.0: add time64 patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/31_all_time64.patch | 39 +++++++++++++++++++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 ++++
2 files changed, 43 insertions(+)
diff --git a/15.0.0/gentoo/31_all_time64.patch b/15.0.0/gentoo/31_all_time64.patch
new file mode 100644
index 0000000..ac972b9
--- /dev/null
+++ b/15.0.0/gentoo/31_all_time64.patch
@@ -0,0 +1,39 @@
+From b2ee3846dfcea638e0fbf2d550234f1c7594fcdb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 1 Nov 2024 07:48:37 +0100
+Subject: [PATCH] Support forcing _TIME_BITS=64 for time64 profiles
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Support forcing _TIME_BITS=64 and _FILE_OFFSET_BITS=64
+via -D_GENTOO_TIME64_FORCE=1, for time64 profiles.
+
+Signed-off-by: Michał Górny <mgorny@gentoo.org>
+---
+ gcc/c-family/c-cppbuiltin.cc | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc
+index 8bbfe84b2..962cbd414 100644
+--- a/gcc/c-family/c-cppbuiltin.cc
++++ b/gcc/c-family/c-cppbuiltin.cc
+@@ -1593,6 +1593,15 @@ c_cpp_builtins (cpp_reader *pfile)
+ builtin_define_with_int_value ("_FORTIFY_SOURCE", GENTOO_FORTIFY_SOURCE_LEVEL);
+ #endif
+
++#ifndef _GENTOO_TIME64_FORCE
++ #define _GENTOO_TIME64_FORCE 0
++#endif
++
++ if (_GENTOO_TIME64_FORCE) {
++ cpp_define (pfile, "_FILE_OFFSET_BITS=64");
++ cpp_define (pfile, "_TIME_BITS=64");
++ }
++
+ /* Misc. */
+ if (flag_gnu89_inline)
+ cpp_define (pfile, "__GNUC_GNU_INLINE__");
+--
+2.47.0
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 92e1e14..39a708d 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+21 ????
+
+ + 31_all_time64.patch
+
20 28 October 2024
- 73_all_PR117190-Revert-c-Fix-up-speed-up-compilation-of-large-char-a.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-01 8:18 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-01 8:18 UTC (permalink / raw
To: gentoo-commits
commit: 0460c30910a6114b6ad106633bad7a0a25b87535
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 1 08:18:28 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 1 08:18:28 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=0460c309
15.00.: cut patchset 21
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 39a708d..2d6aaf8 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-21 ????
+21 1 November 2024
+ 31_all_time64.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-01 8:24 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-01 8:24 UTC (permalink / raw
To: gentoo-commits
commit: 5c6f5f3e37e314c90dc54d7e04483378df7a558e
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 1 08:23:59 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 1 08:24:06 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5c6f5f3e
Revert "15.0.0: respin patchset 2 to drop 72 revert patch"
This reverts commit 1da292bbeff6151ecb983ee5552d6ab8305bb4e7.
Still needed for live. Already spun 21 so we can onw put this back.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117363-revert.patch | 106 +++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)
diff --git a/15.0.0/gentoo/72_all_PR117363-revert.patch b/15.0.0/gentoo/72_all_PR117363-revert.patch
new file mode 100644
index 0000000..3e5be35
--- /dev/null
+++ b/15.0.0/gentoo/72_all_PR117363-revert.patch
@@ -0,0 +1,106 @@
+From a7df875788d7303639123771af1f4238e207f442 Mon Sep 17 00:00:00 2001
+Message-ID: <a7df875788d7303639123771af1f4238e207f442.1730304104.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Wed, 30 Oct 2024 15:59:01 +0000
+Subject: [PATCH] Revert "Match: Simplify (x != 0 ? x + ~0 : 0) to (x - x !=
+ 0)."
+
+This reverts commit 4af8db3eca12b2db3753ce4b098cbd0ae32b4796.
+
+Bug: https://gcc.gnu.org/PR117363
+---
+ gcc/match.pd | 10 ---------
+ gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c | 26 ----------------------
+ gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c | 26 ----------------------
+ 3 files changed, 62 deletions(-)
+ delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
+ delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
+
+diff --git a/gcc/match.pd b/gcc/match.pd
+index c851ac56e37c..809c717bc862 100644
+--- a/gcc/match.pd
++++ b/gcc/match.pd
+@@ -3391,16 +3391,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
+ }
+ (if (wi::eq_p (sum, wi::uhwi (0, precision)))))))
+
+-/* The boundary condition for case 10: IMM = 1:
+- SAT_U_SUB = X >= IMM ? (X - IMM) : 0.
+- simplify (X != 0 ? X + ~0 : 0) to (X - X != 0). */
+-(simplify
+- (cond (ne@1 @0 integer_zerop)
+- (nop_convert? (plus (nop_convert? @0) integer_all_onesp))
+- integer_zerop)
+- (if (INTEGRAL_TYPE_P (type))
+- (minus @0 (convert @1))))
+-
+ /* Signed saturation sub, case 1:
+ T minus = (T)((UT)X - (UT)Y);
+ SAT_S_SUB = (X ^ Y) & (X ^ minus) < 0 ? (-(T)(X < 0) ^ MAX) : minus;
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
+deleted file mode 100644
+index 962bf0954f62..000000000000
+--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
++++ /dev/null
+@@ -1,26 +0,0 @@
+-/* { dg-do compile } */
+-/* { dg-options "-O2 -fdump-tree-phiopt1" } */
+-
+-#include <stdint.h>
+-
+-uint8_t f1 (uint8_t x)
+-{
+- return x >= (uint8_t)1 ? x - (uint8_t)1 : 0;
+-}
+-
+-uint16_t f2 (uint16_t x)
+-{
+- return x >= (uint16_t)1 ? x - (uint16_t)1 : 0;
+-}
+-
+-uint32_t f3 (uint32_t x)
+-{
+- return x >= (uint32_t)1 ? x - (uint32_t)1 : 0;
+-}
+-
+-uint64_t f4 (uint64_t x)
+-{
+- return x >= (uint64_t)1 ? x - (uint64_t)1 : 0;
+-}
+-
+-/* { dg-final { scan-tree-dump-not "goto" "phiopt1" } } */
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
+deleted file mode 100644
+index 62a2ab631846..000000000000
+--- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
++++ /dev/null
+@@ -1,26 +0,0 @@
+-/* { dg-do compile } */
+-/* { dg-options "-O2 -fdump-tree-phiopt1" } */
+-
+-#include <stdint.h>
+-
+-int8_t f1 (int8_t x)
+-{
+- return x != 0 ? x - (int8_t)1 : 0;
+-}
+-
+-int16_t f2 (int16_t x)
+-{
+- return x != 0 ? x - (int16_t)1 : 0;
+-}
+-
+-int32_t f3 (int32_t x)
+-{
+- return x != 0 ? x - (int32_t)1 : 0;
+-}
+-
+-int64_t f4 (int64_t x)
+-{
+- return x != 0 ? x - (int64_t)1 : 0;
+-}
+-
+-/* { dg-final { scan-tree-dump-not "goto" "phiopt1" } } */
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-01 8:24 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-01 8:24 UTC (permalink / raw
To: gentoo-commits
commit: 1da292bbeff6151ecb983ee5552d6ab8305bb4e7
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 1 08:21:55 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 1 08:21:55 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=1da292bb
15.0.0: respin patchset 2 to drop 72 revert patch
That didn't land in the last snapshot, oops.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117363-revert.patch | 106 -----------------------------
1 file changed, 106 deletions(-)
diff --git a/15.0.0/gentoo/72_all_PR117363-revert.patch b/15.0.0/gentoo/72_all_PR117363-revert.patch
deleted file mode 100644
index 3e5be35..0000000
--- a/15.0.0/gentoo/72_all_PR117363-revert.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From a7df875788d7303639123771af1f4238e207f442 Mon Sep 17 00:00:00 2001
-Message-ID: <a7df875788d7303639123771af1f4238e207f442.1730304104.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Wed, 30 Oct 2024 15:59:01 +0000
-Subject: [PATCH] Revert "Match: Simplify (x != 0 ? x + ~0 : 0) to (x - x !=
- 0)."
-
-This reverts commit 4af8db3eca12b2db3753ce4b098cbd0ae32b4796.
-
-Bug: https://gcc.gnu.org/PR117363
----
- gcc/match.pd | 10 ---------
- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c | 26 ----------------------
- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c | 26 ----------------------
- 3 files changed, 62 deletions(-)
- delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
- delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
-
-diff --git a/gcc/match.pd b/gcc/match.pd
-index c851ac56e37c..809c717bc862 100644
---- a/gcc/match.pd
-+++ b/gcc/match.pd
-@@ -3391,16 +3391,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
- }
- (if (wi::eq_p (sum, wi::uhwi (0, precision)))))))
-
--/* The boundary condition for case 10: IMM = 1:
-- SAT_U_SUB = X >= IMM ? (X - IMM) : 0.
-- simplify (X != 0 ? X + ~0 : 0) to (X - X != 0). */
--(simplify
-- (cond (ne@1 @0 integer_zerop)
-- (nop_convert? (plus (nop_convert? @0) integer_all_onesp))
-- integer_zerop)
-- (if (INTEGRAL_TYPE_P (type))
-- (minus @0 (convert @1))))
--
- /* Signed saturation sub, case 1:
- T minus = (T)((UT)X - (UT)Y);
- SAT_S_SUB = (X ^ Y) & (X ^ minus) < 0 ? (-(T)(X < 0) ^ MAX) : minus;
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
-deleted file mode 100644
-index 962bf0954f62..000000000000
---- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
-+++ /dev/null
-@@ -1,26 +0,0 @@
--/* { dg-do compile } */
--/* { dg-options "-O2 -fdump-tree-phiopt1" } */
--
--#include <stdint.h>
--
--uint8_t f1 (uint8_t x)
--{
-- return x >= (uint8_t)1 ? x - (uint8_t)1 : 0;
--}
--
--uint16_t f2 (uint16_t x)
--{
-- return x >= (uint16_t)1 ? x - (uint16_t)1 : 0;
--}
--
--uint32_t f3 (uint32_t x)
--{
-- return x >= (uint32_t)1 ? x - (uint32_t)1 : 0;
--}
--
--uint64_t f4 (uint64_t x)
--{
-- return x >= (uint64_t)1 ? x - (uint64_t)1 : 0;
--}
--
--/* { dg-final { scan-tree-dump-not "goto" "phiopt1" } } */
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
-deleted file mode 100644
-index 62a2ab631846..000000000000
---- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
-+++ /dev/null
-@@ -1,26 +0,0 @@
--/* { dg-do compile } */
--/* { dg-options "-O2 -fdump-tree-phiopt1" } */
--
--#include <stdint.h>
--
--int8_t f1 (int8_t x)
--{
-- return x != 0 ? x - (int8_t)1 : 0;
--}
--
--int16_t f2 (int16_t x)
--{
-- return x != 0 ? x - (int16_t)1 : 0;
--}
--
--int32_t f3 (int32_t x)
--{
-- return x != 0 ? x - (int32_t)1 : 0;
--}
--
--int64_t f4 (int64_t x)
--{
-- return x != 0 ? x - (int64_t)1 : 0;
--}
--
--/* { dg-final { scan-tree-dump-not "goto" "phiopt1" } } */
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-03 23:16 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-03 23:16 UTC (permalink / raw
To: gentoo-commits
commit: 4857e834cefe40cf6c07def1aa9eac45d0021653
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 3 23:15:59 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 3 23:16:09 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4857e834
15.0.0: drop 72_all_PR117363-revert.patch
Fixed upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117363-revert.patch | 106 -----------------------------
1 file changed, 106 deletions(-)
diff --git a/15.0.0/gentoo/72_all_PR117363-revert.patch b/15.0.0/gentoo/72_all_PR117363-revert.patch
deleted file mode 100644
index 3e5be35..0000000
--- a/15.0.0/gentoo/72_all_PR117363-revert.patch
+++ /dev/null
@@ -1,106 +0,0 @@
-From a7df875788d7303639123771af1f4238e207f442 Mon Sep 17 00:00:00 2001
-Message-ID: <a7df875788d7303639123771af1f4238e207f442.1730304104.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Wed, 30 Oct 2024 15:59:01 +0000
-Subject: [PATCH] Revert "Match: Simplify (x != 0 ? x + ~0 : 0) to (x - x !=
- 0)."
-
-This reverts commit 4af8db3eca12b2db3753ce4b098cbd0ae32b4796.
-
-Bug: https://gcc.gnu.org/PR117363
----
- gcc/match.pd | 10 ---------
- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c | 26 ----------------------
- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c | 26 ----------------------
- 3 files changed, 62 deletions(-)
- delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
- delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
-
-diff --git a/gcc/match.pd b/gcc/match.pd
-index c851ac56e37c..809c717bc862 100644
---- a/gcc/match.pd
-+++ b/gcc/match.pd
-@@ -3391,16 +3391,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
- }
- (if (wi::eq_p (sum, wi::uhwi (0, precision)))))))
-
--/* The boundary condition for case 10: IMM = 1:
-- SAT_U_SUB = X >= IMM ? (X - IMM) : 0.
-- simplify (X != 0 ? X + ~0 : 0) to (X - X != 0). */
--(simplify
-- (cond (ne@1 @0 integer_zerop)
-- (nop_convert? (plus (nop_convert? @0) integer_all_onesp))
-- integer_zerop)
-- (if (INTEGRAL_TYPE_P (type))
-- (minus @0 (convert @1))))
--
- /* Signed saturation sub, case 1:
- T minus = (T)((UT)X - (UT)Y);
- SAT_S_SUB = (X ^ Y) & (X ^ minus) < 0 ? (-(T)(X < 0) ^ MAX) : minus;
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
-deleted file mode 100644
-index 962bf0954f62..000000000000
---- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-44.c
-+++ /dev/null
-@@ -1,26 +0,0 @@
--/* { dg-do compile } */
--/* { dg-options "-O2 -fdump-tree-phiopt1" } */
--
--#include <stdint.h>
--
--uint8_t f1 (uint8_t x)
--{
-- return x >= (uint8_t)1 ? x - (uint8_t)1 : 0;
--}
--
--uint16_t f2 (uint16_t x)
--{
-- return x >= (uint16_t)1 ? x - (uint16_t)1 : 0;
--}
--
--uint32_t f3 (uint32_t x)
--{
-- return x >= (uint32_t)1 ? x - (uint32_t)1 : 0;
--}
--
--uint64_t f4 (uint64_t x)
--{
-- return x >= (uint64_t)1 ? x - (uint64_t)1 : 0;
--}
--
--/* { dg-final { scan-tree-dump-not "goto" "phiopt1" } } */
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c b/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
-deleted file mode 100644
-index 62a2ab631846..000000000000
---- a/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-45.c
-+++ /dev/null
-@@ -1,26 +0,0 @@
--/* { dg-do compile } */
--/* { dg-options "-O2 -fdump-tree-phiopt1" } */
--
--#include <stdint.h>
--
--int8_t f1 (int8_t x)
--{
-- return x != 0 ? x - (int8_t)1 : 0;
--}
--
--int16_t f2 (int16_t x)
--{
-- return x != 0 ? x - (int16_t)1 : 0;
--}
--
--int32_t f3 (int32_t x)
--{
-- return x != 0 ? x - (int32_t)1 : 0;
--}
--
--int64_t f4 (int64_t x)
--{
-- return x != 0 ? x - (int64_t)1 : 0;
--}
--
--/* { dg-final { scan-tree-dump-not "goto" "phiopt1" } } */
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-07 16:13 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-07 16:13 UTC (permalink / raw
To: gentoo-commits
commit: 5f55e0a35a6595391420057c748c94110a41cacd
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 7 16:13:27 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 7 16:13:27 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5f55e0a3
15.0.0: add 72_all_PR117476-revert.patch
Bug: https://gcc.gnu.org/PR117476
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117476-revert.patch | 74 ++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
diff --git a/15.0.0/gentoo/72_all_PR117476-revert.patch b/15.0.0/gentoo/72_all_PR117476-revert.patch
new file mode 100644
index 0000000..c073213
--- /dev/null
+++ b/15.0.0/gentoo/72_all_PR117476-revert.patch
@@ -0,0 +1,74 @@
+From 7f98f96e02bd3b5cac35655d933382f9225fef59 Mon Sep 17 00:00:00 2001
+Message-ID: <7f98f96e02bd3b5cac35655d933382f9225fef59.1730995976.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Thu, 7 Nov 2024 16:12:40 +0000
+Subject: [PATCH] Revert "[PATCH v2] RISC-V: zero_extend(not) -> xor
+ optimization [PR112398]"
+
+This reverts commit 69bd93c167fefbdff0cb88614275358b7a2b2941.
+
+Bug: https://gcc.gnu.org/PR117476
+---
+ gcc/simplify-rtx.cc | 22 ----------------------
+ gcc/testsuite/gcc.target/riscv/pr112398.c | 14 --------------
+ 2 files changed, 36 deletions(-)
+ delete mode 100644 gcc/testsuite/gcc.target/riscv/pr112398.c
+
+diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
+index d05efac20dc8..893c5f6e1ae0 100644
+--- a/gcc/simplify-rtx.cc
++++ b/gcc/simplify-rtx.cc
+@@ -1842,28 +1842,6 @@ simplify_context::simplify_unary_operation_1 (rtx_code code, machine_mode mode,
+ & ~GET_MODE_MASK (op_mode)) == 0)
+ return SUBREG_REG (op);
+
+- /* Trying to optimize:
+- (zero_extend:M (subreg:N (not:M (X:M)))) ->
+- (xor:M (zero_extend:M (subreg:N (X:M)), mask))
+- where the mask is GET_MODE_MASK (N).
+- For the cases when X:M doesn't have any non-zero bits
+- outside of mode N, (zero_extend:M (subreg:N (X:M))
+- will be simplified to just (X:M)
+- and whole optimization will be -> (xor:M (X:M, mask)). */
+- if (SUBREG_P (op)
+- && GET_CODE (XEXP (op, 0)) == NOT
+- && GET_MODE (XEXP (op, 0)) == mode
+- && subreg_lowpart_p (op)
+- && GET_MODE_SIZE (GET_MODE (op)).is_constant ()
+- && (nonzero_bits (XEXP (XEXP (op, 0), 0), mode)
+- & ~GET_MODE_MASK (mode)) == 0)
+- {
+- const uint64_t mask = GET_MODE_MASK (GET_MODE (op));
+- return simplify_gen_binary (XOR, mode,
+- XEXP (XEXP (op, 0), 0),
+- gen_int_mode (mask, mode));
+- }
+-
+ #if defined(POINTERS_EXTEND_UNSIGNED)
+ /* As we do not know which address space the pointer is referring to,
+ we can do this only if the target does not support different pointer
+diff --git a/gcc/testsuite/gcc.target/riscv/pr112398.c b/gcc/testsuite/gcc.target/riscv/pr112398.c
+deleted file mode 100644
+index 624a665b76c9..000000000000
+--- a/gcc/testsuite/gcc.target/riscv/pr112398.c
++++ /dev/null
+@@ -1,14 +0,0 @@
+-/* { dg-do compile } */
+-/* { dg-options "-march=rv64gc -mabi=lp64d" } */
+-/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" } } */
+-
+-#include <stdint.h>
+-
+-uint8_t neg_u8 (const uint8_t src)
+-{
+- return ~src;
+-}
+-
+-/* { dg-final { scan-assembler-times "xori\t" 1 } } */
+-/* { dg-final { scan-assembler-not "not\t" } } */
+-/* { dg-final { scan-assembler-not "andi\t" } } */
+
+base-commit: 6a6b8b847bce78a909379f3b9d3365c4ac4f0ff5
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-08 8:22 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-08 8:22 UTC (permalink / raw
To: gentoo-commits
commit: d233b7b4ed5b56b7f0291ae3c59c9d6f84120692
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 8 08:22:01 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 8 08:22:40 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d233b7b4
15.0.0: add workaround for recursion in sccvn
Bug: https://gcc.gnu.org/PR117493
Bug: https://gcc.gnu.org/PR117496
Signed-off-by: Sam James <sam <AT> gentoo.org>
...93-sccvn-insert_predicates_for_cond-limit.patch | 41 ++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch b/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
new file mode 100644
index 0000000..2000754
--- /dev/null
+++ b/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
@@ -0,0 +1,41 @@
+https://gcc.gnu.org/PR117493
+https://gcc.gnu.org/PR117496
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117493#c5
+--- a/gcc/tree-ssa-sccvn.cc
++++ b/gcc/tree-ssa-sccvn.cc
+@@ -7902,8 +7902,11 @@ insert_related_predicates_on_edge (enum tree_code code, tree *ops, edge pred_e)
+ derived from LHS CODE RHS. */
+ static void
+ insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
+- edge true_e, edge false_e)
++ edge true_e, edge false_e, int n = 0)
+ {
++ if (n > 5)
++ return;
++
+ /* If both edges are null, then there is nothing to be done. */
+ if (!true_e && !false_e)
+ return;
+@@ -7964,7 +7967,7 @@ insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
+ edge nf = false_e;
+ if (code == EQ_EXPR)
+ std::swap (nt, nf);
+- insert_predicates_for_cond (nc, nlhs, nrhs, nt, nf);
++ insert_predicates_for_cond (nc, nlhs, nrhs, nt, nf, n + 1);
+ }
+ /* (a | b) == 0 ->
+ on true edge assert: a == 0 & b == 0. */
+@@ -7977,10 +7980,10 @@ insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
+ tree nlhs;
+
+ nlhs = vn_valueize (gimple_assign_rhs1 (def_stmt));
+- insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
++ insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr, n + 1);
+
+ nlhs = vn_valueize (gimple_assign_rhs2 (def_stmt));
+- insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
++ insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr, n + 1);
+ }
+ }
+ }
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-09 7:55 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-09 7:55 UTC (permalink / raw
To: gentoo-commits
commit: a6cc1808601268d37a0c43ad67b5c116d9678c4d
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 9 07:55:37 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 9 07:55:37 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a6cc1808
15.0.0: update 73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
This version will be committed shortly.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...93-sccvn-insert_predicates_for_cond-limit.patch | 107 ++++++++++++++++-----
1 file changed, 82 insertions(+), 25 deletions(-)
diff --git a/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch b/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
index 2000754..9816e52 100644
--- a/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
+++ b/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
@@ -1,41 +1,98 @@
-https://gcc.gnu.org/PR117493
-https://gcc.gnu.org/PR117496
+From a49a60790ae2032dfeee617ba9488fc80e09b3a8 Mon Sep 17 00:00:00 2001
+Message-ID: <a49a60790ae2032dfeee617ba9488fc80e09b3a8.1731138919.git.sam@gentoo.org>
+From: Andrew Pinski <quic_apinski@quicinc.com>
+Date: Fri, 8 Nov 2024 17:35:02 -0800
+Subject: [PATCH] VN: Don't recurse on for the same value of `a | b` [PR117496]
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117493#c5
+After adding vn_valueize to the handle the `a | b ==/!= 0` case
+of insert_predicates_for_cond, it would go into an infinite loop
+as the Value number for either a or b could be the same as what it
+is for the whole expression. This avoids that recursion so there is
+no infinite loop here.
+
+Bootstrapped and tested on x86_64-linux.
+
+ PR tree-optimization/117496
+
+gcc/ChangeLog:
+
+ * tree-ssa-sccvn.cc (insert_predicates_for_cond): If the
+ valueization for the new lhs is the same as the old one,
+ don't recurse.
+
+gcc/testsuite/ChangeLog:
+
+ * gcc.dg/torture/pr117496-1.c: New test.
+
+Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
+---
+ gcc/testsuite/gcc.dg/torture/pr117496-1.c | 25 +++++++++++++++++++++++
+ gcc/tree-ssa-sccvn.cc | 11 ++++++++--
+ 2 files changed, 34 insertions(+), 2 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/torture/pr117496-1.c
+
+diff --git a/gcc/testsuite/gcc.dg/torture/pr117496-1.c b/gcc/testsuite/gcc.dg/torture/pr117496-1.c
+new file mode 100644
+index 000000000000..f35d13dfa85d
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr117496-1.c
+@@ -0,0 +1,25 @@
++/* { dg-do compile } */
++
++
++/* PR tree-optimization/117496 */
++/* This would go into an infinite loop into VN while recording
++ the predicates for the `tracks == 0 && wm == 0` GIMPLE_COND.
++ As wm_N and tracks_N would valueize back to `tracks | wm`. */
++
++int main_argc, gargs_preemp, gargs_nopreemp;
++static void gargs();
++void main_argv() {
++ int tracks = 0;
++ gargs(main_argc, main_argv, &tracks);
++}
++void gargs(int, char *, int *tracksp) {
++ int tracks = *tracksp, wm;
++ for (;;) {
++ if (tracks == 0)
++ wm |= 4;
++ if (gargs_nopreemp)
++ gargs_preemp = 0;
++ if (tracks == 0 && wm == 0)
++ tracks++;
++ }
++}
+diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
+index 1967bbdca84d..9c460fc1bdb3 100644
--- a/gcc/tree-ssa-sccvn.cc
+++ b/gcc/tree-ssa-sccvn.cc
-@@ -7902,8 +7902,11 @@ insert_related_predicates_on_edge (enum tree_code code, tree *ops, edge pred_e)
+@@ -7897,6 +7897,7 @@ insert_related_predicates_on_edge (enum tree_code code, tree *ops, edge pred_e)
+
+ /* Insert on the TRUE_E true and FALSE_E false predicates
derived from LHS CODE RHS. */
++
static void
insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
-- edge true_e, edge false_e)
-+ edge true_e, edge false_e, int n = 0)
- {
-+ if (n > 5)
-+ return;
-+
- /* If both edges are null, then there is nothing to be done. */
- if (!true_e && !false_e)
- return;
-@@ -7964,7 +7967,7 @@ insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
- edge nf = false_e;
- if (code == EQ_EXPR)
- std::swap (nt, nf);
-- insert_predicates_for_cond (nc, nlhs, nrhs, nt, nf);
-+ insert_predicates_for_cond (nc, nlhs, nrhs, nt, nf, n + 1);
- }
- /* (a | b) == 0 ->
- on true edge assert: a == 0 & b == 0. */
-@@ -7977,10 +7980,10 @@ insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
+ edge true_e, edge false_e)
+@@ -7973,10 +7974,16 @@ insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
tree nlhs;
nlhs = vn_valueize (gimple_assign_rhs1 (def_stmt));
- insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
-+ insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr, n + 1);
++ /* A valueization of the `a` might return the old lhs
++ which is already handled above. */
++ if (nlhs != lhs)
++ insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
++ /* A valueization of the `b` might return the old lhs
++ which is already handled above. */
nlhs = vn_valueize (gimple_assign_rhs2 (def_stmt));
- insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
-+ insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr, n + 1);
++ if (nlhs != lhs)
++ insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
}
}
}
+--
+2.47.0
+
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-09 16:24 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-09 16:24 UTC (permalink / raw
To: gentoo-commits
commit: 58deeb29d8c568e8e0a633a8b6410d3a70b2808d
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 9 16:24:14 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 9 16:24:42 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=58deeb29
15.0.0: drop 73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
Merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...93-sccvn-insert_predicates_for_cond-limit.patch | 98 ----------------------
1 file changed, 98 deletions(-)
diff --git a/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch b/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
deleted file mode 100644
index 9816e52..0000000
--- a/15.0.0/gentoo/73_all_PR117493-sccvn-insert_predicates_for_cond-limit.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From a49a60790ae2032dfeee617ba9488fc80e09b3a8 Mon Sep 17 00:00:00 2001
-Message-ID: <a49a60790ae2032dfeee617ba9488fc80e09b3a8.1731138919.git.sam@gentoo.org>
-From: Andrew Pinski <quic_apinski@quicinc.com>
-Date: Fri, 8 Nov 2024 17:35:02 -0800
-Subject: [PATCH] VN: Don't recurse on for the same value of `a | b` [PR117496]
-
-After adding vn_valueize to the handle the `a | b ==/!= 0` case
-of insert_predicates_for_cond, it would go into an infinite loop
-as the Value number for either a or b could be the same as what it
-is for the whole expression. This avoids that recursion so there is
-no infinite loop here.
-
-Bootstrapped and tested on x86_64-linux.
-
- PR tree-optimization/117496
-
-gcc/ChangeLog:
-
- * tree-ssa-sccvn.cc (insert_predicates_for_cond): If the
- valueization for the new lhs is the same as the old one,
- don't recurse.
-
-gcc/testsuite/ChangeLog:
-
- * gcc.dg/torture/pr117496-1.c: New test.
-
-Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
----
- gcc/testsuite/gcc.dg/torture/pr117496-1.c | 25 +++++++++++++++++++++++
- gcc/tree-ssa-sccvn.cc | 11 ++++++++--
- 2 files changed, 34 insertions(+), 2 deletions(-)
- create mode 100644 gcc/testsuite/gcc.dg/torture/pr117496-1.c
-
-diff --git a/gcc/testsuite/gcc.dg/torture/pr117496-1.c b/gcc/testsuite/gcc.dg/torture/pr117496-1.c
-new file mode 100644
-index 000000000000..f35d13dfa85d
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr117496-1.c
-@@ -0,0 +1,25 @@
-+/* { dg-do compile } */
-+
-+
-+/* PR tree-optimization/117496 */
-+/* This would go into an infinite loop into VN while recording
-+ the predicates for the `tracks == 0 && wm == 0` GIMPLE_COND.
-+ As wm_N and tracks_N would valueize back to `tracks | wm`. */
-+
-+int main_argc, gargs_preemp, gargs_nopreemp;
-+static void gargs();
-+void main_argv() {
-+ int tracks = 0;
-+ gargs(main_argc, main_argv, &tracks);
-+}
-+void gargs(int, char *, int *tracksp) {
-+ int tracks = *tracksp, wm;
-+ for (;;) {
-+ if (tracks == 0)
-+ wm |= 4;
-+ if (gargs_nopreemp)
-+ gargs_preemp = 0;
-+ if (tracks == 0 && wm == 0)
-+ tracks++;
-+ }
-+}
-diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc
-index 1967bbdca84d..9c460fc1bdb3 100644
---- a/gcc/tree-ssa-sccvn.cc
-+++ b/gcc/tree-ssa-sccvn.cc
-@@ -7897,6 +7897,7 @@ insert_related_predicates_on_edge (enum tree_code code, tree *ops, edge pred_e)
-
- /* Insert on the TRUE_E true and FALSE_E false predicates
- derived from LHS CODE RHS. */
-+
- static void
- insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
- edge true_e, edge false_e)
-@@ -7973,10 +7974,16 @@ insert_predicates_for_cond (tree_code code, tree lhs, tree rhs,
- tree nlhs;
-
- nlhs = vn_valueize (gimple_assign_rhs1 (def_stmt));
-- insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
-+ /* A valueization of the `a` might return the old lhs
-+ which is already handled above. */
-+ if (nlhs != lhs)
-+ insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
-
-+ /* A valueization of the `b` might return the old lhs
-+ which is already handled above. */
- nlhs = vn_valueize (gimple_assign_rhs2 (def_stmt));
-- insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
-+ if (nlhs != lhs)
-+ insert_predicates_for_cond (EQ_EXPR, nlhs, rhs, e, nullptr);
- }
- }
- }
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-10 22:41 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-10 22:41 UTC (permalink / raw
To: gentoo-commits
commit: eebe373c98a3d9a22f3dadab26f1fadb7220f60c
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 10 22:40:37 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 10 22:40:37 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=eebe373c
15.0.0: cut patchset 22
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 2d6aaf8..25ab12b 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+22 10 November 2024
+
+ + 72_all_PR117476-revert.patch
+
21 1 November 2024
+ 31_all_time64.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-11 19:46 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-11 19:46 UTC (permalink / raw
To: gentoo-commits
commit: 9bb90d6a35c8ab572372dfcff42a0ecd7dd53952
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 11 19:44:42 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 11 19:44:42 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9bb90d6a
15.0.0: add 33_all_PR80677-cross-limits.patch
I needed this with a cross from amd64->s390 after doing crossdev as
normal but then upgrading them to 15 snapshots.
Bug: https://gcc.gnu.org/PR80677
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/33_all_PR80677-cross-limits.patch | 38 +++++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +++
2 files changed, 42 insertions(+)
diff --git a/15.0.0/gentoo/33_all_PR80677-cross-limits.patch b/15.0.0/gentoo/33_all_PR80677-cross-limits.patch
new file mode 100644
index 0000000..3cbef01
--- /dev/null
+++ b/15.0.0/gentoo/33_all_PR80677-cross-limits.patch
@@ -0,0 +1,38 @@
+https://gcc.gnu.org/PR80677
+--- a/gcc/limitx.h
++++ b/gcc/limitx.h
+@@ -29,7 +29,7 @@
+ #ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
+ #define _GCC_LIMITS_H_
+
+-#ifndef _LIBC_LIMITS_H_
++#if !defined(_LIBC_LIMITS_H_) && __has_include_next(<limits.h>)
+ /* Use "..." so that we find syslimits.h only in this same directory. */
+ #include "syslimits.h"
+ #endif
+--- a/gcc/limity.h
++++ b/gcc/limity.h
+@@ -3,7 +3,7 @@
+
+ #else /* not _GCC_LIMITS_H_ */
+
+-#ifdef _GCC_NEXT_LIMITS_H
++#if defined(_GCC_NEXT_LIMITS_H) && __has_include_next(<limits.h>)
+ #include_next <limits.h> /* recurse down to the real one */
+ #endif
+
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3344,11 +3344,7 @@ stmp-int-hdrs: $(STMP_FIXINC) $(T_GLIMITS_H) $(T_STDINT_GCC_H) $(USER_H) fixinc_
+ sysroot_headers_suffix=`echo $${ml} | sed -e 's/;.*$$//'`; \
+ multi_dir=`echo $${ml} | sed -e 's/^[^;]*;//'`; \
+ include_dir=include$${multi_dir}; \
+- if $(LIMITS_H_TEST) ; then \
+- cat $(srcdir)/limitx.h $(T_GLIMITS_H) $(srcdir)/limity.h > tmp-xlimits.h; \
+- else \
+- cat $(T_GLIMITS_H) > tmp-xlimits.h; \
+- fi; \
++ cat $(srcdir)/limitx.h $(T_GLIMITS_H) $(srcdir)/limity.h > tmp-xlimits.h; \
+ $(mkinstalldirs) $${include_dir}; \
+ chmod a+rx $${include_dir} || true; \
+ $(SHELL) $(srcdir)/../move-if-change \
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 25ab12b..dbf2b56 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+23 11 November 2024
+
+ + 33_all_PR80677-cross-limits.patch
+
22 10 November 2024
+ 72_all_PR117476-revert.patch
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-11 19:46 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-11 19:46 UTC (permalink / raw
To: gentoo-commits
commit: c19b98e5b8997c997dbde31fe6d6db895b37dca7
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 11 19:45:15 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 11 19:45:15 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c19b98e5
15.0.0: rename 31_all_time64.patch -> 32_all_time64.patch
Numbering conflict.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/{31_all_time64.patch => 32_all_time64.patch} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
diff --git a/15.0.0/gentoo/31_all_time64.patch b/15.0.0/gentoo/32_all_time64.patch
similarity index 100%
rename from 15.0.0/gentoo/31_all_time64.patch
rename to 15.0.0/gentoo/32_all_time64.patch
^ permalink raw reply [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-12 2:33 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-12 2:33 UTC (permalink / raw
To: gentoo-commits
commit: 8209a4e7304772b31beca172c0397c76bcee4876
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 12 02:33:40 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov 12 02:33:40 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=8209a4e7
15.0.0: rebase 26_all_enable-cet.patch
-fmodules-ts was renamed to -fmodules.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/26_all_enable-cet.patch | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/15.0.0/gentoo/26_all_enable-cet.patch b/15.0.0/gentoo/26_all_enable-cet.patch
index b9bbbf0..85591e9 100644
--- a/15.0.0/gentoo/26_all_enable-cet.patch
+++ b/15.0.0/gentoo/26_all_enable-cet.patch
@@ -11,34 +11,34 @@ Needs:
Only supported on amd64.
--- a/gcc/cp/lang-specs.h
+++ b/gcc/cp/lang-specs.h
-@@ -51,7 +51,7 @@ along with GCC; see the file COPYING3. If not see
+@@ -57,7 +57,7 @@ along with GCC; see the file COPYING3. If not see
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
- " %{fmodules-ts:-fmodule-header %{fpreprocessed:-fdirectives-only}}"
+ " %{fmodules*:-fmodule-header %{fpreprocessed:-fdirectives-only}}"
- " %(cc1_options) %2"
+ " %(cc1_options) %(default_flag_cf_spec) %2"
" %{!fsyntax-only:"
" %{!S:-o %g.s}"
- " %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
-@@ -72,7 +72,7 @@ along with GCC; see the file COPYING3. If not see
+ " %{!fmodule-*:%{!fmodules*:%{!fdump-ada-spec*:"
+@@ -78,7 +78,7 @@ along with GCC; see the file COPYING3. If not see
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
- " %{fmodules-ts:-fmodule-header=system"
+ " %{fmodules*:-fmodule-header=system"
" %{fpreprocessed:-fdirectives-only}}"
- " %(cc1_options) %2"
+ " %(cc1_options) %(default_flag_cf_spec) %2"
" %{!fsyntax-only:"
" %{!S:-o %g.s}"
- " %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
-@@ -92,7 +92,7 @@ along with GCC; see the file COPYING3. If not see
+ " %{!fmodule-*:%{!fmodules*:%{!fdump-ada-spec*:"
+@@ -98,7 +98,7 @@ along with GCC; see the file COPYING3. If not see
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
- " %{fmodules-ts:-fmodule-header=user %{fpreprocessed:-fdirectives-only}}"
+ " %{fmodules*:-fmodule-header=user %{fpreprocessed:-fdirectives-only}}"
- " %(cc1_options) %2"
+ " %(cc1_options) %(default_flag_cf_spec) %2"
" %{!fsyntax-only:"
" %{!S:-o %g.s}"
- " %{!fmodule-*:%{!fmodules-*:%{!fdump-ada-spec*:"
-@@ -107,7 +107,7 @@ along with GCC; see the file COPYING3. If not see
+ " %{!fmodule-*:%{!fmodules*:%{!fdump-ada-spec*:"
+@@ -113,7 +113,7 @@ along with GCC; see the file COPYING3. If not see
" cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed"
" %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}"
" %{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}"
@@ -47,7 +47,7 @@ Only supported on amd64.
" %{!fsyntax-only:"
" %{fmodule-only:%{!S:-o %g.s%V}}"
" %{!fmodule-only:%(invoke_as)}}"
-@@ -116,7 +116,7 @@ along with GCC; see the file COPYING3. If not see
+@@ -122,7 +122,7 @@ along with GCC; see the file COPYING3. If not see
{".ii", "@c++-cpp-output", 0, 0, 0},
{"@c++-cpp-output",
"%{!E:%{!M:%{!MM:"
@@ -58,7 +58,7 @@ Only supported on amd64.
" %{!fmodule-only:%{!fmodule-header*:%(invoke_as)}}}"
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
-@@ -999,6 +999,18 @@ proper position among the other output files. */
+@@ -1011,6 +1011,18 @@ proper position among the other output files. */
#define LINK_NOW_SPEC ""
#endif
@@ -77,7 +77,7 @@ Only supported on amd64.
#ifdef ENABLE_DEFAULT_PIE
#define PIE_SPEC "!no-pie"
#define NO_FPIE1_SPEC "fno-pie"
-@@ -1201,6 +1213,7 @@ static const char *cpp_spec = CPP_SPEC;
+@@ -1217,6 +1229,7 @@ static const char *cpp_spec = CPP_SPEC;
static const char *cc1_spec = CC1_SPEC OS_CC1_SPEC;
static const char *cc1plus_spec = CC1PLUS_SPEC;
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
@@ -85,7 +85,7 @@ Only supported on amd64.
static const char *link_ssp_spec = LINK_SSP_SPEC;
static const char *asm_spec = ASM_SPEC;
static const char *asm_final_spec = ASM_FINAL_SPEC;
-@@ -1261,7 +1274,7 @@ static const char *cpp_options =
+@@ -1277,7 +1290,7 @@ static const char *cpp_options =
"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
%{f*} %{g*:%{%:debug-level-gt(0):%{g*}\
%{!fno-working-directory:-fworking-directory}}} %{O*}\
@@ -94,7 +94,7 @@ Only supported on amd64.
/* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al.
-@@ -1455,9 +1468,9 @@ static const struct compiler default_compilers[] =
+@@ -1471,9 +1484,9 @@ static const struct compiler default_compilers[] =
%{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\
cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \
@@ -106,7 +106,7 @@ Only supported on amd64.
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1},
{"-",
"%{!E:%e-E or -x required when input is from standard input}\
-@@ -1482,7 +1495,7 @@ static const struct compiler default_compilers[] =
+@@ -1498,7 +1511,7 @@ static const struct compiler default_compilers[] =
%W{o*:--output-pch %w%*}}%{!S:%V}}}}}}}}", 0, 0, 0},
{".i", "@cpp-output", 0, 0, 0},
{"@cpp-output",
@@ -115,7 +115,7 @@ Only supported on amd64.
{".s", "@assembler", 0, 0, 0},
{"@assembler",
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
-@@ -1714,6 +1727,7 @@ static struct spec_list static_specs[] =
+@@ -1730,6 +1743,7 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("cc1_options", &cc1_options),
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec),
^ permalink raw reply related [flat|nested] 77+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-11-13 0:16 Sam James
0 siblings, 0 replies; 77+ messages in thread
From: Sam James @ 2024-11-13 0:16 UTC (permalink / raw
To: gentoo-commits
commit: dc56acd66a2e3cbbc1f1a62f02538d668f4a843b
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 13 00:16:04 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Nov 13 00:16:04 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=dc56acd6
15.0.0: drop 72_all_PR117476-revert.patch
The revert has landed upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/72_all_PR117476-revert.patch | 74 ------------------------------
1 file changed, 74 deletions(-)
diff --git a/15.0.0/gentoo/72_all_PR117476-revert.patch b/15.0.0/gentoo/72_all_PR117476-revert.patch
deleted file mode 100644
index c073213..0000000
--- a/15.0.0/gentoo/72_all_PR117476-revert.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 7f98f96e02bd3b5cac35655d933382f9225fef59 Mon Sep 17 00:00:00 2001
-Message-ID: <7f98f96e02bd3b5cac35655d933382f9225fef59.1730995976.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Thu, 7 Nov 2024 16:12:40 +0000
-Subject: [PATCH] Revert "[PATCH v2] RISC-V: zero_extend(not) -> xor
- optimization [PR112398]"
-
-This reverts commit 69bd93c167fefbdff0cb88614275358b7a2b2941.
-
-Bug: https://gcc.gnu.org/PR117476
----
- gcc/simplify-rtx.cc | 22 ----------------------
- gcc/testsuite/gcc.target/riscv/pr112398.c | 14 --------------
- 2 files changed, 36 deletions(-)
- delete mode 100644 gcc/testsuite/gcc.target/riscv/pr112398.c
-
-diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
-index d05efac20dc8..893c5f6e1ae0 100644
---- a/gcc/simplify-rtx.cc
-+++ b/gcc/simplify-rtx.cc
-@@ -1842,28 +1842,6 @@ simplify_context::simplify_unary_operation_1 (rtx_code code, machine_mode mode,
- & ~GET_MODE_MASK (op_mode)) == 0)
- return SUBREG_REG (op);
-
-- /* Trying to optimize:
-- (zero_extend:M (subreg:N (not:M (X:M)))) ->
-- (xor:M (zero_extend:M (subreg:N (X:M)), mask))
-- where the mask is GET_MODE_MASK (N).
-- For the cases when X:M doesn't have any non-zero bits
-- outside of mode N, (zero_extend:M (subreg:N (X:M))
-- will be simplified to just (X:M)
-- and whole optimization will be -> (xor:M (X:M, mask)). */
-- if (SUBREG_P (op)
-- && GET_CODE (XEXP (op, 0)) == NOT
-- && GET_MODE (XEXP (op, 0)) == mode
-- && subreg_lowpart_p (op)
-- && GET_MODE_SIZE (GET_MODE (op)).is_constant ()
-- && (nonzero_bits (XEXP (XEXP (op, 0), 0), mode)
-- & ~GET_MODE_MASK (mode)) == 0)
-- {
-- const uint64_t mask = GET_MODE_MASK (GET_MODE (op));
-- return simplify_gen_binary (XOR, mode,
-- XEXP (XEXP (op, 0), 0),
-- gen_int_mode (mask, mode));
-- }
--
- #if defined(POINTERS_EXTEND_UNSIGNED)
- /* As we do not know which address space the pointer is referring to,
- we can do this only if the target does not support different pointer
-diff --git a/gcc/testsuite/gcc.target/riscv/pr112398.c b/gcc/testsuite/gcc.target/riscv/pr112398.c
-deleted file mode 100644
-index 624a665b76c9..000000000000
---- a/gcc/testsuite/gcc.target/riscv/pr112398.c
-+++ /dev/null
-@@ -1,14 +0,0 @@
--/* { dg-do compile } */
--/* { dg-options "-march=rv64gc -mabi=lp64d" } */
--/* { dg-skip-if "" { *-*-* } { "-O0" "-Og" } } */
--
--#include <stdint.h>
--
--uint8_t neg_u8 (const uint8_t src)
--{
-- return ~src;
--}
--
--/* { dg-final { scan-assembler-times "xori\t" 1 } } */
--/* { dg-final { scan-assembler-not "not\t" } } */
--/* { dg-final { scan-assembler-not "andi\t" } } */
-
-base-commit: 6a6b8b847bce78a909379f3b9d3365c4ac4f0ff5
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 77+ messages in thread
end of thread, other threads:[~2024-11-13 0:16 UTC | newest]
Thread overview: 77+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 0:02 [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-11-13 0:16 Sam James
2024-11-12 2:33 Sam James
2024-11-11 19:46 Sam James
2024-11-11 19:46 Sam James
2024-11-10 22:41 Sam James
2024-11-09 16:24 Sam James
2024-11-09 7:55 Sam James
2024-11-08 8:22 Sam James
2024-11-07 16:13 Sam James
2024-11-03 23:16 Sam James
2024-11-01 8:24 Sam James
2024-11-01 8:24 Sam James
2024-11-01 8:18 Sam James
2024-11-01 8:17 Sam James
2024-10-30 16:03 Sam James
2024-10-29 19:17 Sam James
2024-10-28 21:32 Sam James
2024-10-28 8:09 Sam James
2024-10-23 15:40 Sam James
2024-10-22 19:09 Sam James
2024-10-22 18:34 Sam James
2024-10-21 12:33 Sam James
2024-10-21 12:27 Sam James
2024-10-21 12:26 Sam James
2024-10-21 11:45 Sam James
2024-10-20 22:42 Sam James
2024-10-18 14:05 Sam James
2024-10-18 10:35 Sam James
2024-10-17 23:33 Sam James
2024-10-17 23:03 Sam James
2024-10-17 5:01 Sam James
2024-10-17 4:15 Sam James
2024-10-13 22:48 Sam James
2024-10-07 2:45 Sam James
2024-10-04 10:37 Sam James
2024-10-04 9:28 Sam James
2024-10-02 19:45 Sam James
2024-09-30 14:05 Sam James
2024-09-29 22:56 Sam James
2024-09-24 1:41 Sam James
2024-09-23 15:23 Sam James
2024-09-02 2:28 Sam James
2024-08-26 13:44 Sam James
2024-08-26 6:24 Sam James
2024-08-23 13:51 Sam James
2024-08-20 20:31 Sam James
2024-08-19 18:43 Sam James
2024-08-14 9:48 Sam James
2024-08-14 2:57 Sam James
2024-08-11 22:40 Sam James
2024-08-09 19:54 Sam James
2024-08-09 19:54 Sam James
2024-08-09 19:47 Sam James
2024-08-09 19:25 Sam James
2024-08-08 11:10 Sam James
2024-08-08 11:06 Sam James
2024-08-08 11:03 Sam James
2024-08-05 9:09 Sam James
2024-08-05 1:54 Sam James
2024-08-05 1:51 Sam James
2024-08-02 20:39 Sam James
2024-08-01 14:40 Sam James
2024-07-28 23:34 Sam James
2024-07-22 1:11 Sam James
2024-07-19 11:14 Sam James
2024-07-18 0:45 Sam James
2024-07-14 23:36 Sam James
2024-06-28 12:49 Sam James
2024-06-26 23:57 Sam James
2024-06-16 22:45 Sam James
2024-06-10 20:18 Sam James
2024-06-10 17:28 Sam James
2024-06-10 17:28 Sam James
2024-06-10 2:08 Sam James
2024-06-08 17:03 Sam James
2024-06-08 17:03 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox