public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gcc-patches:master commit in: 16.0.0/gentoo/
Date: Wed, 30 Jul 2025 00:44:58 +0000 (UTC)	[thread overview]
Message-ID: <1753836288.8cda62318174b911a7cba57fcf70efd38f265f0e.sam@gentoo> (raw)

commit:     8cda62318174b911a7cba57fcf70efd38f265f0e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 30 00:44:05 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 30 00:44:48 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=8cda6231

16.0.0: update patches

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...sufficient-alignment-requirement-for-spec.patch | 55 ++++++++--------------
 ...ssing-skip-vector-check-for-peeling-with-.patch | 28 ++++++-----
 16.0.0/gentoo/README.history                       |  5 ++
 3 files changed, 39 insertions(+), 49 deletions(-)

diff --git a/16.0.0/gentoo/86_all_PR121190-vect-Fix-insufficient-alignment-requirement-for-spec.patch b/16.0.0/gentoo/86_all_PR121190-vect-Fix-insufficient-alignment-requirement-for-spec.patch
index 9a03cdd..f05e749 100644
--- a/16.0.0/gentoo/86_all_PR121190-vect-Fix-insufficient-alignment-requirement-for-spec.patch
+++ b/16.0.0/gentoo/86_all_PR121190-vect-Fix-insufficient-alignment-requirement-for-spec.patch
@@ -1,10 +1,10 @@
 https://bugs.gentoo.org/959698
-https://inbox.sourceware.org/gcc-patches/20250721110232.186244-1-Pengfei.Li2@arm.com/T/#u
+https://inbox.sourceware.org/gcc-patches/DB3PR08MB89626FA52FEA5FB7ACE33B19A425A@DB3PR08MB8962.eurprd08.prod.outlook.com/
 
-From e120f6cb794a4d104b37913c918aabe0ae6b2c64 Mon Sep 17 00:00:00 2001
-Message-ID: <e120f6cb794a4d104b37913c918aabe0ae6b2c64.1753106388.git.sam@gentoo.org>
+From f91a62751e8198e6f02c21dffa35ac803b46d048 Mon Sep 17 00:00:00 2001
+Message-ID: <f91a62751e8198e6f02c21dffa35ac803b46d048.1753836047.git.sam@gentoo.org>
 From: Pengfei Li <Pengfei.Li2@arm.com>
-Date: Mon, 21 Jul 2025 11:02:32 +0000
+Date: Tue, 29 Jul 2025 14:58:18 +0000
 Subject: [PATCH 1/2] vect: Fix insufficient alignment requirement for
  speculative loads [PR121190]
 
@@ -42,9 +42,9 @@ alignment, but the following ones (at offset 32) may not be safe because
 they could read from the beginning of the next memory page, potentially
 leading to segmentation faults.
 
-To avoid the issue, this patch increases the alignment requirement for
-speculative loads to DR_TARGET_ALIGNMENT. It ensures all vector loads in
-the same vector iteration access memory within the same page.
+To avoid the issue, this patch increases the alignment requirement to
+DR_TARGET_ALIGNMENT. It ensures all vector loads in the same vector
+iteration access memory within the same page.
 
 This patch is bootstrapped and regression-tested on x86_64-linux-gnu,
 arm-linux-gnueabihf and aarch64-linux-gnu.
@@ -61,20 +61,19 @@ gcc/testsuite/ChangeLog:
 * gcc.dg/vect/vect-early-break_52.c: Update an unsafe test.
 	* gcc.dg/vect/vect-early-break_137.c-pr121190: New test.
 ---
- .../vect/vect-early-break_137-pr121190.c      | 60 +++++++++++++++++++
+ .../vect/vect-early-break_137-pr121190.c      | 62 +++++++++++++++++++
  .../gcc.dg/vect/vect-early-break_52.c         |  2 +-
- gcc/tree-vect-data-refs.cc                    | 15 ++++-
- 3 files changed, 75 insertions(+), 2 deletions(-)
+ gcc/tree-vect-data-refs.cc                    |  3 +-
+ 3 files changed, 65 insertions(+), 2 deletions(-)
  create mode 100644 gcc/testsuite/gcc.dg/vect/vect-early-break_137-pr121190.c
 
 diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_137-pr121190.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_137-pr121190.c
 new file mode 100644
-index 000000000000..da11146c578e
+index 000000000000..e6b071c411cf
 --- /dev/null
 +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_137-pr121190.c
-@@ -0,0 +1,60 @@
+@@ -0,0 +1,62 @@
 +/* PR tree-optimization/121190 */
-+/* { dg-do run } */
 +/* { dg-options "-O3" } */
 +/* { dg-additional-options "-march=znver2" { target x86_64-*-* i?86-*-* } } */
 +/* { dg-require-effective-target mmap } */
@@ -85,6 +84,7 @@ index 000000000000..da11146c578e
 +#include <stdio.h>
 +#include <sys/mman.h>
 +#include <unistd.h>
++#include "tree-vect.h"
 +
 +#define MAX_COMPARE 5000
 +
@@ -102,6 +102,8 @@ index 000000000000..da11146c578e
 +
 +int main ()
 +{
++  check_vect ();
++
 +  long pgsz = sysconf (_SC_PAGESIZE);
 +  if (pgsz == -1) {
 +    fprintf (stderr, "sysconf failed\n");
@@ -144,38 +146,19 @@ index 86a632f2a822..6abfcd6580e4 100644
 -/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target { ! "x86_64-*-* i?86-*-*" } } } } */
 +/* { dg-final { scan-tree-dump "vectorized 1 loops in function" "vect" { target { ! "x86_64-*-* i?86-*-* arm*-*-*" } } } } */
 diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc
-index a24ddfbc3841..24048086857f 100644
+index e7919b73c258..66217c54b050 100644
 --- a/gcc/tree-vect-data-refs.cc
 +++ b/gcc/tree-vect-data-refs.cc
-@@ -2964,12 +2964,25 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
-                   break;
-                 }
- 
-+	      /* Normally, we require DRs to be aligned to the vector mode size.
-+		 However, this is not sufficient when a statement involves safe
-+		 speculative read.  In such cases, a single scalar load can be
-+		 vectorized into multiple vector loads in one loop iteration.
-+		 Even if the first vector load is safe, subsequent loads might
-+		 still access an invalid memory page.  We increase the alignment
-+		 requirement to prevent this.  */
-+	      poly_uint64 required_align_size;
-+	      if (dr_safe_speculative_read_required (stmt_info))
-+		required_align_size = DR_TARGET_ALIGNMENT (dr_info);
-+	      else
-+		required_align_size = GET_MODE_SIZE (TYPE_MODE (vectype));
-+
- 	      /* At present we don't support versioning for alignment
- 		 with variable VF, since there's no guarantee that the
+@@ -2969,7 +2969,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
  		 VF is a power of two.  We could relax this if we added
  		 a way of enforcing a power-of-two size.  */
  	      unsigned HOST_WIDE_INT size;
 -	      if (!GET_MODE_SIZE (TYPE_MODE (vectype)).is_constant (&size))
-+	      if (!required_align_size.is_constant (&size))
++	      if (!LOOP_VINFO_VECT_FACTOR (loop_vinfo).is_constant ()
++		  || !DR_TARGET_ALIGNMENT (dr_info).is_constant (&size))
  		{
  		  do_versioning = false;
  		  break;
-
-base-commit: b441d735c092f5d60c4a9c7167ed9153003d49fa
 -- 
 2.50.1
 

diff --git a/16.0.0/gentoo/87_all_PR121020-vect-Add-missing-skip-vector-check-for-peeling-with-.patch b/16.0.0/gentoo/87_all_PR121020-vect-Add-missing-skip-vector-check-for-peeling-with-.patch
index 5aae3a5..c472d5d 100644
--- a/16.0.0/gentoo/87_all_PR121020-vect-Add-missing-skip-vector-check-for-peeling-with-.patch
+++ b/16.0.0/gentoo/87_all_PR121020-vect-Add-missing-skip-vector-check-for-peeling-with-.patch
@@ -1,12 +1,12 @@
 https://bugs.gentoo.org/959698
-https://inbox.sourceware.org/gcc-patches/20250721110642.186287-1-Pengfei.Li2@arm.com/T/#u
+https://inbox.sourceware.org/gcc-patches/DB3PR08MB8962138B27178069736147E5A425A@DB3PR08MB8962.eurprd08.prod.outlook.com/
 
-From f66323025c47ba09cee296a8a638cfe63d1bdad3 Mon Sep 17 00:00:00 2001
-Message-ID: <f66323025c47ba09cee296a8a638cfe63d1bdad3.1753106388.git.sam@gentoo.org>
-In-Reply-To: <e120f6cb794a4d104b37913c918aabe0ae6b2c64.1753106388.git.sam@gentoo.org>
-References: <e120f6cb794a4d104b37913c918aabe0ae6b2c64.1753106388.git.sam@gentoo.org>
+From 652f42c43949e64961721b7c78758030a8b9b1e0 Mon Sep 17 00:00:00 2001
+Message-ID: <652f42c43949e64961721b7c78758030a8b9b1e0.1753836047.git.sam@gentoo.org>
+In-Reply-To: <f91a62751e8198e6f02c21dffa35ac803b46d048.1753836047.git.sam@gentoo.org>
+References: <f91a62751e8198e6f02c21dffa35ac803b46d048.1753836047.git.sam@gentoo.org>
 From: Pengfei Li <Pengfei.Li2@arm.com>
-Date: Mon, 21 Jul 2025 11:06:42 +0000
+Date: Tue, 29 Jul 2025 14:53:46 +0000
 Subject: [PATCH 2/2] vect: Add missing skip-vector check for peeling with
  versioning [PR121020]
 
@@ -45,20 +45,19 @@ gcc/testsuite/ChangeLog:
 
 * gcc.dg/vect/vect-early-break_138-pr121020.c: New test.
 ---
- .../vect/vect-early-break_138-pr121020.c      | 52 +++++++++++++++++++
+ .../vect/vect-early-break_138-pr121020.c      | 54 +++++++++++++++++++
  gcc/tree-vect-loop-manip.cc                   |  2 +-
  gcc/tree-vectorizer.h                         |  4 ++
- 3 files changed, 57 insertions(+), 1 deletion(-)
+ 3 files changed, 59 insertions(+), 1 deletion(-)
  create mode 100644 gcc/testsuite/gcc.dg/vect/vect-early-break_138-pr121020.c
 
 diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_138-pr121020.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_138-pr121020.c
 new file mode 100644
-index 000000000000..86661e445a83
+index 000000000000..8cb62bf5bc93
 --- /dev/null
 +++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_138-pr121020.c
-@@ -0,0 +1,52 @@
+@@ -0,0 +1,54 @@
 +/* PR tree-optimization/121020 */
-+/* { dg-do run } */
 +/* { dg-options "-O3 --vect-cost-model=unlimited" } */
 +/* { dg-additional-options "-march=znver2" { target x86_64-*-* i?86-*-* } } */
 +/* { dg-require-effective-target mmap } */
@@ -68,6 +67,7 @@ index 000000000000..86661e445a83
 +#include <stdio.h>
 +#include <sys/mman.h>
 +#include <unistd.h>
++#include "tree-vect.h"
 +
 +__attribute__((noipa))
 +bool equal (uint64_t *restrict p, uint64_t *restrict q, int length)
@@ -81,6 +81,8 @@ index 000000000000..86661e445a83
 +
 +int main ()
 +{
++  check_vect ();
++
 +  long pgsz = sysconf (_SC_PAGESIZE);
 +  if (pgsz == -1) {
 +    fprintf (stderr, "sysconf failed\n");
@@ -123,10 +125,10 @@ index 2d01a4b0ed1c..7fcbc1ad2eb8 100644
  
    /* Epilog loop must be executed if the number of iterations for epilog
 diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
-index 80f8853733de..69428f1747cb 100644
+index 203e5ad964a6..e19002794324 100644
 --- a/gcc/tree-vectorizer.h
 +++ b/gcc/tree-vectorizer.h
-@@ -1168,6 +1168,10 @@ public:
+@@ -1197,6 +1197,10 @@ public:
     || LOOP_REQUIRES_VERSIONING_FOR_NITERS (L)		\
     || LOOP_REQUIRES_VERSIONING_FOR_SIMD_IF_COND (L))
  

diff --git a/16.0.0/gentoo/README.history b/16.0.0/gentoo/README.history
index 89b8363..c0dd40f 100644
--- a/16.0.0/gentoo/README.history
+++ b/16.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+9	????
+
+	U 86_all_PR121190-vect-Fix-insufficient-alignment-requirement-for-spec.patch
+	U 87_all_PR121020-vect-Add-missing-skip-vector-check-for-peeling-with-.patch
+
 8	30 July 2025
 
 	+ 86_all_PR121190-vect-Fix-insufficient-alignment-requirement-for-spec.patch


             reply	other threads:[~2025-07-30  0:45 UTC|newest]

Thread overview: 107+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30  0:44 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-10-27  1:46 [gentoo-commits] proj/gcc-patches:master commit in: 16.0.0/gentoo/ Sam James
2025-10-23 15:58 Sam James
2025-10-21  0:33 Sam James
2025-10-19 22:41 Sam James
2025-10-18 18:22 Sam James
2025-10-13  2:49 Sam James
2025-10-09  7:31 Sam James
2025-10-09  2:26 Sam James
2025-10-09  2:26 Sam James
2025-10-05 23:05 Sam James
2025-10-05 22:50 Sam James
2025-10-02 11:05 Sam James
2025-10-02 11:04 Sam James
2025-10-02  4:55 Sam James
2025-10-02  1:18 Sam James
2025-10-02  0:40 Sam James
2025-10-02  0:36 Sam James
2025-10-02  0:30 Sam James
2025-09-17 18:41 Sam James
2025-09-17  3:04 Sam James
2025-09-16 19:23 Sam James
2025-09-14 11:26 Sam James
2025-09-13 13:16 Sam James
2025-09-07 22:42 Sam James
2025-09-06  2:42 Sam James
2025-09-05 12:44 Sam James
2025-09-01  8:04 Sam James
2025-08-31 22:43 Sam James
2025-08-30 14:06 Sam James
2025-08-30  8:05 Sam James
2025-08-30  6:57 Sam James
2025-08-30  0:12 Sam James
2025-08-29 21:26 Sam James
2025-08-29 21:02 Sam James
2025-08-29 20:24 Sam James
2025-08-29 20:18 Sam James
2025-08-29 18:38 Sam James
2025-08-29 12:15 Sam James
2025-08-28 17:57 Sam James
2025-08-28  5:27 Sam James
2025-08-27  4:19 Sam James
2025-08-26 23:42 Sam James
2025-08-26  4:48 Sam James
2025-08-26  0:56 Sam James
2025-08-25  3:55 Sam James
2025-08-24 23:42 Sam James
2025-08-21 16:11 Sam James
2025-08-20 20:45 Sam James
2025-08-20 14:10 Sam James
2025-08-20  1:16 Sam James
2025-08-20  1:10 Sam James
2025-08-19 16:30 Sam James
2025-08-18 23:52 Sam James
2025-08-18 23:08 Sam James
2025-08-17 22:45 Sam James
2025-08-17 21:01 Sam James
2025-08-17 16:30 Sam James
2025-08-17 15:44 Sam James
2025-08-17 15:10 Sam James
2025-08-16 23:06 Sam James
2025-08-05  0:23 Sam James
2025-07-30 22:35 Sam James
2025-07-30  0:44 Sam James
2025-07-25 18:49 Sam James
2025-07-23 11:22 Sam James
2025-07-22 23:56 Sam James
2025-07-21 14:02 Sam James
2025-07-21  1:12 Sam James
2025-07-14 16:03 Sam James
2025-07-14  4:09 Sam James
2025-07-14  2:55 Sam James
2025-07-14  2:55 Sam James
2025-07-14  2:40 Sam James
2025-07-13 23:11 Sam James
2025-07-13  1:09 Sam James
2025-07-12 15:24 Sam James
2025-07-12 15:23 Sam James
2025-07-10 12:34 Sam James
2025-07-10  1:22 Sam James
2025-07-10  0:50 Sam James
2025-07-07 20:49 Sam James
2025-07-06 22:41 Sam James
2025-07-03  1:29 Sam James
2025-06-30  6:26 Sam James
2025-06-29 23:49 Sam James
2025-06-29  0:29 Sam James
2025-06-19 16:59 Sam James
2025-06-19  0:58 Sam James
2025-06-19  0:58 Sam James
2025-06-18 21:17 Sam James
2025-06-18  9:53 Sam James
2025-06-18  9:06 Sam James
2025-06-13 12:03 Sam James
2025-06-12 20:34 Sam James
2025-06-12 14:05 Sam James
2025-06-12  7:27 Sam James
2025-06-12  5:46 Sam James
2025-06-11  5:05 Sam James
2025-06-11  3:19 Sam James
2025-06-01 22:39 Sam James
2025-05-31 18:48 Sam James
2025-05-11 22:52 Sam James
2025-05-10 15:28 Sam James
2025-05-09 23:29 Sam James
2025-05-05 14:39 Sam James
2025-05-05 13:05 Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1753836288.8cda62318174b911a7cba57fcf70efd38f265f0e.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox