* [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/
@ 2025-05-07 11:21 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-05-07 11:21 UTC (permalink / raw
To: gentoo-commits
commit: 485d5bafcc11703825cb6c3cf7ce2cdd246fb7b1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed May 7 11:19:38 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 7 11:19:38 2025 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=485d5baf
15.1.0: fix libsanitizer build on riscv/musl
Bug: https://gcc.gnu.org/PR119356
Bug: https://bugs.gentoo.org/945920
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../85_all_PR119356-riscv-libsanitizer.patch | 102 +++++++++++++++++++++
15.1.0/gentoo/README.history | 1 +
2 files changed, 103 insertions(+)
diff --git a/15.1.0/gentoo/85_all_PR119356-riscv-libsanitizer.patch b/15.1.0/gentoo/85_all_PR119356-riscv-libsanitizer.patch
new file mode 100644
index 0000000..d5cc246
--- /dev/null
+++ b/15.1.0/gentoo/85_all_PR119356-riscv-libsanitizer.patch
@@ -0,0 +1,102 @@
+https://bugs.gentoo.org/945920
+https://github.com/llvm/llvm-project/pull/120036
+https://gcc.gnu.org/PR119356
+
+From 534b3ef77c6df932e532c4b63d8c506cda26d4a4 Mon Sep 17 00:00:00 2001
+From: mojyack <mojyack@gmail.com>
+Date: Mon, 16 Dec 2024 13:42:04 +0900
+Subject: [PATCH] [sanitizer_common] Fix build on ppc64+musl
+
+In powerpc64-unknown-linux-musl, signal.h does not include asm/ptrace.h,
+which causes "member access into incomplete type 'struct pt_regs'" errors.
+Include the header explicitly to fix this.
+
+Also in sanitizer_linux_libcdep.cpp, there is a usage of
+TlsPreTcbSize which is not defined in such a platform.
+Guard the branch with macro.
+
+---
+ libsanitizer/sanitizer_common/sanitizer_linux.cpp | 4 ++++
+ .../sanitizer_common/sanitizer_linux_libcdep.cpp | 13 +++++++------
+ .../sanitizer_platform_limits_posix.cpp | 2 +-
+ .../sanitizer_stoptheworld_linux_libcdep.cpp | 3 ++-
+ 4 files changed, 14 insertions(+), 8 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cpp b/libsanitizer/sanitizer_common/sanitizer_linux.cpp
+index 8b1850f85010..6331c26c0a92 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_linux.cpp
+@@ -86,6 +86,10 @@
+ # include <sys/sysmacros.h>
+ # endif
+
++# if SANITIZER_LINUX && defined(__powerpc64__)
++# include <asm/ptrace.h>
++# endif
++
+ # if SANITIZER_FREEBSD
+ # include <machine/atomic.h>
+ # include <sys/exec.h>
+diff --git a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
+index ed19e4031a53..9d01a97af5f4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
+@@ -619,21 +619,22 @@ static void GetTls(uptr *addr, uptr *size) {
+ *addr = tp - RoundUpTo(*size, align);
+ *size = tp - *addr + ThreadDescriptorSize();
+ # else
+- if (SANITIZER_GLIBC)
+- *size += 1664;
+- else if (SANITIZER_FREEBSD)
+- *size += 128; // RTLD_STATIC_TLS_EXTRA
+-# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
++# if SANITIZER_GLIBC
++ *size += 1664;
++# elif SANITIZER_FREEBSD
++ *size += 128; // RTLD_STATIC_TLS_EXTRA
++# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
+ const uptr pre_tcb_size = TlsPreTcbSize();
+ *addr -= pre_tcb_size;
+ *size += pre_tcb_size;
+-# else
++# else
+ // arm and aarch64 reserve two words at TP, so this underestimates the range.
+ // However, this is sufficient for the purpose of finding the pointers to
+ // thread-specific data keys.
+ const uptr tcb_size = ThreadDescriptorSize();
+ *addr -= tcb_size;
+ *size += tcb_size;
++# endif
+ # endif
+ # endif
+ # elif SANITIZER_NETBSD
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 7bbc6f2edac2..490e75fe8f65 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -96,7 +96,7 @@
+ # include <sys/ptrace.h>
+ # if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
+ defined(__hexagon__) || defined(__loongarch__) || SANITIZER_RISCV64 || \
+- defined(__sparc__)
++ defined(__sparc__) || defined(__powerpc64__)
+ # include <asm/ptrace.h>
+ # ifdef __arm__
+ typedef struct user_fpregs elf_fpregset_t;
+diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+index 945da99d41f4..58d17d90c343 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
+@@ -31,7 +31,8 @@
+ #include <sys/types.h> // for pid_t
+ #include <sys/uio.h> // for iovec
+ #include <elf.h> // for NT_PRSTATUS
+-#if (defined(__aarch64__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
++#if (defined(__aarch64__) || defined(__powerpc64__) || \
++ SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
+ !SANITIZER_ANDROID
+ // GLIBC 2.20+ sys/user does not include asm/ptrace.h
+ # include <asm/ptrace.h>
+--
+2.49.0
+
diff --git a/15.1.0/gentoo/README.history b/15.1.0/gentoo/README.history
index 47c0ad0..06c2ba7 100644
--- a/15.1.0/gentoo/README.history
+++ b/15.1.0/gentoo/README.history
@@ -27,3 +27,4 @@
+ 35_all_checking-gc-use-heuristics.patch
+ 76_all_PR117854-config-nvptx-fix-bashisms-with-gen-copyright.sh-use.patch
+ 84_all_PR116975-GDCFLAGS.patch
+ + 85_all_PR119356-riscv-libsanitizer.patch
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/
@ 2025-07-08 18:43 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-07-08 18:43 UTC (permalink / raw
To: gentoo-commits
commit: 9dd46ee2eb01d30892f1c6db1599e82a9c6e8b04
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 8 18:41:29 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul 8 18:41:29 2025 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9dd46ee2
15.1.0: fix Qt vs PTA
Bug: https://bugs.gentoo.org/956308
Bug: https://gcc.gnu.org/PR120358
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.1.0/gentoo/86_all_PR120358-qt-pta.patch | 47 ++++++++++++++++++++++++++++++
15.1.0/gentoo/README.history | 4 +++
2 files changed, 51 insertions(+)
diff --git a/15.1.0/gentoo/86_all_PR120358-qt-pta.patch b/15.1.0/gentoo/86_all_PR120358-qt-pta.patch
new file mode 100644
index 0000000..1a9c974
--- /dev/null
+++ b/15.1.0/gentoo/86_all_PR120358-qt-pta.patch
@@ -0,0 +1,47 @@
+https://bugs.gentoo.org/956308
+https://gcc.gnu.org/PR120358
+https://gcc.gnu.org/cgit/gcc/commit/?id=aa5ae523e84a97bf3a582ea0fa73d959afa9b9c7
+
+From aa5ae523e84a97bf3a582ea0fa73d959afa9b9c7 Mon Sep 17 00:00:00 2001
+Message-ID: <aa5ae523e84a97bf3a582ea0fa73d959afa9b9c7.1751999489.git.sam@gentoo.org>
+From: Richard Biener <rguenther@suse.de>
+Date: Mon, 7 Jul 2025 15:13:38 +0200
+Subject: [PATCH] tree-optimization/120358 - bogus PTA with structure access
+
+When we compute the constraint for something like
+MEM[(const struct QStringView &)&tok2 + 32] we go and compute
+what (const struct QStringView &)&tok2 + 32 points to and then
+add subvariables to its dereference that possibly fall in the
+range of the access according to the original refs size. In
+doing that we disregarded that the subvariable the starting
+address points to might not be aligned to it and thus the
+access might start at any point within that variable. The following
+conservatively adjusts the pruning of adjacent sub-variables to
+honor this.
+
+ PR tree-optimization/120358
+ * tree-ssa-structalias.cc (get_constraint_for_1): Adjust
+ pruning of sub-variables according to the imprecise
+ known start offset.
+---
+ gcc/tree-ssa-structalias.cc | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc
+index deca44ae0bf3..0215243d5be9 100644
+--- a/gcc/tree-ssa-structalias.cc
++++ b/gcc/tree-ssa-structalias.cc
+@@ -3690,7 +3690,10 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p,
+ size = -1;
+ for (; curr; curr = vi_next (curr))
+ {
+- if (curr->offset - vi->offset < size)
++ /* The start of the access might happen anywhere
++ within vi, so conservatively assume it was
++ at its end. */
++ if (curr->offset - (vi->offset + vi->size - 1) < size)
+ {
+ cs.var = curr->id;
+ results->safe_push (cs);
+--
+2.50.0
diff --git a/15.1.0/gentoo/README.history b/15.1.0/gentoo/README.history
index 06c2ba7..c55fe4f 100644
--- a/15.1.0/gentoo/README.history
+++ b/15.1.0/gentoo/README.history
@@ -1,3 +1,7 @@
+2 7 July 2025
+
+ + 86_all_PR120358-qt-pta.patch
+
1 7 May 2025
+ 01_all_default-fortify-source.patch
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/
@ 2025-07-13 0:48 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-07-13 0:48 UTC (permalink / raw
To: gentoo-commits
commit: eb83d0f61f296ec1802125b3c055bc62ef463864
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 13 00:47:30 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 13 00:47:30 2025 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=eb83d0f6
15.1.0: drop now-backported Qt PTA patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.1.0/gentoo/README.history | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/15.1.0/gentoo/README.history b/15.1.0/gentoo/README.history
index c55fe4f..d89a94a 100644
--- a/15.1.0/gentoo/README.history
+++ b/15.1.0/gentoo/README.history
@@ -1,3 +1,7 @@
+3 13 July 2025
+
+ - 86_all_PR120358-qt-pta.patch
+
2 7 July 2025
+ 86_all_PR120358-qt-pta.patch
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/
@ 2025-07-13 0:49 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-07-13 0:49 UTC (permalink / raw
To: gentoo-commits
commit: e3ff29faac746bd9cb936a02a07f43b49d505b8a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 13 00:49:21 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 13 00:49:32 2025 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e3ff29fa
15.1.0: actually drop the patch
Fixes: eb83d0f61f296ec1802125b3c055bc62ef463864
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.1.0/gentoo/86_all_PR120358-qt-pta.patch | 47 ------------------------------
1 file changed, 47 deletions(-)
diff --git a/15.1.0/gentoo/86_all_PR120358-qt-pta.patch b/15.1.0/gentoo/86_all_PR120358-qt-pta.patch
deleted file mode 100644
index 1a9c974..0000000
--- a/15.1.0/gentoo/86_all_PR120358-qt-pta.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-https://bugs.gentoo.org/956308
-https://gcc.gnu.org/PR120358
-https://gcc.gnu.org/cgit/gcc/commit/?id=aa5ae523e84a97bf3a582ea0fa73d959afa9b9c7
-
-From aa5ae523e84a97bf3a582ea0fa73d959afa9b9c7 Mon Sep 17 00:00:00 2001
-Message-ID: <aa5ae523e84a97bf3a582ea0fa73d959afa9b9c7.1751999489.git.sam@gentoo.org>
-From: Richard Biener <rguenther@suse.de>
-Date: Mon, 7 Jul 2025 15:13:38 +0200
-Subject: [PATCH] tree-optimization/120358 - bogus PTA with structure access
-
-When we compute the constraint for something like
-MEM[(const struct QStringView &)&tok2 + 32] we go and compute
-what (const struct QStringView &)&tok2 + 32 points to and then
-add subvariables to its dereference that possibly fall in the
-range of the access according to the original refs size. In
-doing that we disregarded that the subvariable the starting
-address points to might not be aligned to it and thus the
-access might start at any point within that variable. The following
-conservatively adjusts the pruning of adjacent sub-variables to
-honor this.
-
- PR tree-optimization/120358
- * tree-ssa-structalias.cc (get_constraint_for_1): Adjust
- pruning of sub-variables according to the imprecise
- known start offset.
----
- gcc/tree-ssa-structalias.cc | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc
-index deca44ae0bf3..0215243d5be9 100644
---- a/gcc/tree-ssa-structalias.cc
-+++ b/gcc/tree-ssa-structalias.cc
-@@ -3690,7 +3690,10 @@ get_constraint_for_1 (tree t, vec<ce_s> *results, bool address_p,
- size = -1;
- for (; curr; curr = vi_next (curr))
- {
-- if (curr->offset - vi->offset < size)
-+ /* The start of the access might happen anywhere
-+ within vi, so conservatively assume it was
-+ at its end. */
-+ if (curr->offset - (vi->offset + vi->size - 1) < size)
- {
- cs.var = curr->id;
- results->safe_push (cs);
---
-2.50.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/
@ 2025-07-27 1:03 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-07-27 1:03 UTC (permalink / raw
To: gentoo-commits
commit: 45d4820445bee14f31c0f6381504c67ebc5d0c52
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 27 01:00:15 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 27 01:01:24 2025 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=45d48204
15.1.0: backport SRA fix, cut patchset 4
Note that the fix for the related https://gcc.gnu.org/PR117423 is already
on the 15 branch.
Bug: https://bugs.gentoo.org/941225
Bug: https://gcc.gnu.org/PR119085
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.1.0/gentoo/86_all_PR119085.patch | 98 +++++++++++++++++++++++++++++++++++++
15.1.0/gentoo/README.history | 4 ++
2 files changed, 102 insertions(+)
diff --git a/15.1.0/gentoo/86_all_PR119085.patch b/15.1.0/gentoo/86_all_PR119085.patch
new file mode 100644
index 0000000..cf145a6
--- /dev/null
+++ b/15.1.0/gentoo/86_all_PR119085.patch
@@ -0,0 +1,98 @@
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=171fcc80ede596442712e559c4fc787aa4636694
+
+From 171fcc80ede596442712e559c4fc787aa4636694 Mon Sep 17 00:00:00 2001
+From: Martin Jambor <mjambor@suse.cz>
+Date: Wed, 23 Jul 2025 11:22:33 +0200
+Subject: [PATCH] tree-sra: Avoid total SRA if there are incompat. aggregate
+ accesses (PR119085)
+
+We currently use the types encountered in the function body and not in
+type declaration to perform total scalarization. Bug PR 119085
+uncovered that we miss a check that when the same data is accessed
+with aggregate types that those are actually compatible. Without it,
+we can base total scalarization on a type that does not "cover" all
+live data in a different part of the function. This patch adds the
+check.
+
+gcc/ChangeLog:
+
+2025-07-21 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/119085
+ * tree-sra.cc (sort_and_splice_var_accesses): Prevent total
+ scalarization if two incompatible aggregates access the same place.
+
+gcc/testsuite/ChangeLog:
+
+2025-07-21 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/119085
+ * gcc.dg/tree-ssa/pr119085.c: New test.
+---
+ gcc/testsuite/gcc.dg/tree-ssa/pr119085.c | 37 ++++++++++++++++++++++++
+ gcc/tree-sra.cc | 6 ++++
+ 2 files changed, 43 insertions(+)
+ create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr119085.c
+
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr119085.c b/gcc/testsuite/gcc.dg/tree-ssa/pr119085.c
+new file mode 100644
+index 000000000000..e9811ce12b58
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/tree-ssa/pr119085.c
+@@ -0,0 +1,37 @@
++/* { dg-do run } */
++/* { dg-options "-O1" } */
++
++struct with_hole {
++ int x;
++ long y;
++};
++struct without_hole {
++ int x;
++ int y;
++};
++union u {
++ struct with_hole with_hole;
++ struct without_hole without_hole;
++};
++
++void __attribute__((noinline))
++test (union u *up, union u u)
++{
++ union u u2;
++ volatile int f = 0;
++ u2 = u;
++ if (f)
++ u2.with_hole = u.with_hole;
++ *up = u2;
++}
++
++int main(void)
++{
++ union u u;
++ union u u2;
++ u2.without_hole.y = -1;
++ test (&u, u2);
++ if (u.without_hole.y != -1)
++ __builtin_abort ();
++ return 0;
++}
+diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc
+index 240af676ea33..032f27704847 100644
+--- a/gcc/tree-sra.cc
++++ b/gcc/tree-sra.cc
+@@ -2504,6 +2504,12 @@ sort_and_splice_var_accesses (tree var)
+ }
+ unscalarizable_region = true;
+ }
++ /* If there the same place is accessed with two incompatible
++ aggregate types, trying to base total scalarization on either of
++ them can be wrong. */
++ if (!first_scalar && !types_compatible_p (access->type, ac2->type))
++ bitmap_set_bit (cannot_scalarize_away_bitmap,
++ DECL_UID (access->base));
+
+ if (grp_same_access_path
+ && (!ac2->grp_same_access_path
+--
+2.43.7
diff --git a/15.1.0/gentoo/README.history b/15.1.0/gentoo/README.history
index d89a94a..2b37a49 100644
--- a/15.1.0/gentoo/README.history
+++ b/15.1.0/gentoo/README.history
@@ -1,3 +1,7 @@
+4 27 July 2025
+
+ + 86_all_PR119085.patch
+
3 13 July 2025
- 86_all_PR120358-qt-pta.patch
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/
@ 2025-07-29 9:05 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-07-29 9:05 UTC (permalink / raw
To: gentoo-commits
commit: cbb4add2a9c66e08fac062c186d869ed668a5b46
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 29 09:05:17 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jul 29 09:05:17 2025 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=cbb4add2
15.1.0: drop patch now upstream
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.1.0/gentoo/86_all_PR119085.patch | 98 -------------------------------------
15.1.0/gentoo/README.history | 4 ++
2 files changed, 4 insertions(+), 98 deletions(-)
diff --git a/15.1.0/gentoo/86_all_PR119085.patch b/15.1.0/gentoo/86_all_PR119085.patch
deleted file mode 100644
index cf145a6..0000000
--- a/15.1.0/gentoo/86_all_PR119085.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=171fcc80ede596442712e559c4fc787aa4636694
-
-From 171fcc80ede596442712e559c4fc787aa4636694 Mon Sep 17 00:00:00 2001
-From: Martin Jambor <mjambor@suse.cz>
-Date: Wed, 23 Jul 2025 11:22:33 +0200
-Subject: [PATCH] tree-sra: Avoid total SRA if there are incompat. aggregate
- accesses (PR119085)
-
-We currently use the types encountered in the function body and not in
-type declaration to perform total scalarization. Bug PR 119085
-uncovered that we miss a check that when the same data is accessed
-with aggregate types that those are actually compatible. Without it,
-we can base total scalarization on a type that does not "cover" all
-live data in a different part of the function. This patch adds the
-check.
-
-gcc/ChangeLog:
-
-2025-07-21 Martin Jambor <mjambor@suse.cz>
-
- PR tree-optimization/119085
- * tree-sra.cc (sort_and_splice_var_accesses): Prevent total
- scalarization if two incompatible aggregates access the same place.
-
-gcc/testsuite/ChangeLog:
-
-2025-07-21 Martin Jambor <mjambor@suse.cz>
-
- PR tree-optimization/119085
- * gcc.dg/tree-ssa/pr119085.c: New test.
----
- gcc/testsuite/gcc.dg/tree-ssa/pr119085.c | 37 ++++++++++++++++++++++++
- gcc/tree-sra.cc | 6 ++++
- 2 files changed, 43 insertions(+)
- create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr119085.c
-
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr119085.c b/gcc/testsuite/gcc.dg/tree-ssa/pr119085.c
-new file mode 100644
-index 000000000000..e9811ce12b58
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr119085.c
-@@ -0,0 +1,37 @@
-+/* { dg-do run } */
-+/* { dg-options "-O1" } */
-+
-+struct with_hole {
-+ int x;
-+ long y;
-+};
-+struct without_hole {
-+ int x;
-+ int y;
-+};
-+union u {
-+ struct with_hole with_hole;
-+ struct without_hole without_hole;
-+};
-+
-+void __attribute__((noinline))
-+test (union u *up, union u u)
-+{
-+ union u u2;
-+ volatile int f = 0;
-+ u2 = u;
-+ if (f)
-+ u2.with_hole = u.with_hole;
-+ *up = u2;
-+}
-+
-+int main(void)
-+{
-+ union u u;
-+ union u u2;
-+ u2.without_hole.y = -1;
-+ test (&u, u2);
-+ if (u.without_hole.y != -1)
-+ __builtin_abort ();
-+ return 0;
-+}
-diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc
-index 240af676ea33..032f27704847 100644
---- a/gcc/tree-sra.cc
-+++ b/gcc/tree-sra.cc
-@@ -2504,6 +2504,12 @@ sort_and_splice_var_accesses (tree var)
- }
- unscalarizable_region = true;
- }
-+ /* If there the same place is accessed with two incompatible
-+ aggregate types, trying to base total scalarization on either of
-+ them can be wrong. */
-+ if (!first_scalar && !types_compatible_p (access->type, ac2->type))
-+ bitmap_set_bit (cannot_scalarize_away_bitmap,
-+ DECL_UID (access->base));
-
- if (grp_same_access_path
- && (!ac2->grp_same_access_path
---
-2.43.7
diff --git a/15.1.0/gentoo/README.history b/15.1.0/gentoo/README.history
index 2b37a49..85c3d19 100644
--- a/15.1.0/gentoo/README.history
+++ b/15.1.0/gentoo/README.history
@@ -1,3 +1,7 @@
+5 ????
+
+ - 86_all_PR119085.patch
+
4 27 July 2025
+ 86_all_PR119085.patch
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/
@ 2025-07-31 14:41 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-07-31 14:41 UTC (permalink / raw
To: gentoo-commits
commit: 6340fdda4e4e07d0ec6db43fca026c5b9d7164ca
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 31 14:41:08 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul 31 14:41:08 2025 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6340fdda
15.1.0: drop upstreamed libsanitizer patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../85_all_PR119356-riscv-libsanitizer.patch | 102 ---------------------
15.1.0/gentoo/README.history | 1 +
2 files changed, 1 insertion(+), 102 deletions(-)
diff --git a/15.1.0/gentoo/85_all_PR119356-riscv-libsanitizer.patch b/15.1.0/gentoo/85_all_PR119356-riscv-libsanitizer.patch
deleted file mode 100644
index d5cc246..0000000
--- a/15.1.0/gentoo/85_all_PR119356-riscv-libsanitizer.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-https://bugs.gentoo.org/945920
-https://github.com/llvm/llvm-project/pull/120036
-https://gcc.gnu.org/PR119356
-
-From 534b3ef77c6df932e532c4b63d8c506cda26d4a4 Mon Sep 17 00:00:00 2001
-From: mojyack <mojyack@gmail.com>
-Date: Mon, 16 Dec 2024 13:42:04 +0900
-Subject: [PATCH] [sanitizer_common] Fix build on ppc64+musl
-
-In powerpc64-unknown-linux-musl, signal.h does not include asm/ptrace.h,
-which causes "member access into incomplete type 'struct pt_regs'" errors.
-Include the header explicitly to fix this.
-
-Also in sanitizer_linux_libcdep.cpp, there is a usage of
-TlsPreTcbSize which is not defined in such a platform.
-Guard the branch with macro.
-
----
- libsanitizer/sanitizer_common/sanitizer_linux.cpp | 4 ++++
- .../sanitizer_common/sanitizer_linux_libcdep.cpp | 13 +++++++------
- .../sanitizer_platform_limits_posix.cpp | 2 +-
- .../sanitizer_stoptheworld_linux_libcdep.cpp | 3 ++-
- 4 files changed, 14 insertions(+), 8 deletions(-)
-
-diff --git a/libsanitizer/sanitizer_common/sanitizer_linux.cpp b/libsanitizer/sanitizer_common/sanitizer_linux.cpp
-index 8b1850f85010..6331c26c0a92 100644
---- a/libsanitizer/sanitizer_common/sanitizer_linux.cpp
-+++ b/libsanitizer/sanitizer_common/sanitizer_linux.cpp
-@@ -86,6 +86,10 @@
- # include <sys/sysmacros.h>
- # endif
-
-+# if SANITIZER_LINUX && defined(__powerpc64__)
-+# include <asm/ptrace.h>
-+# endif
-+
- # if SANITIZER_FREEBSD
- # include <machine/atomic.h>
- # include <sys/exec.h>
-diff --git a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
-index ed19e4031a53..9d01a97af5f4 100644
---- a/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
-+++ b/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cpp
-@@ -619,21 +619,22 @@ static void GetTls(uptr *addr, uptr *size) {
- *addr = tp - RoundUpTo(*size, align);
- *size = tp - *addr + ThreadDescriptorSize();
- # else
-- if (SANITIZER_GLIBC)
-- *size += 1664;
-- else if (SANITIZER_FREEBSD)
-- *size += 128; // RTLD_STATIC_TLS_EXTRA
--# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
-+# if SANITIZER_GLIBC
-+ *size += 1664;
-+# elif SANITIZER_FREEBSD
-+ *size += 128; // RTLD_STATIC_TLS_EXTRA
-+# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
- const uptr pre_tcb_size = TlsPreTcbSize();
- *addr -= pre_tcb_size;
- *size += pre_tcb_size;
--# else
-+# else
- // arm and aarch64 reserve two words at TP, so this underestimates the range.
- // However, this is sufficient for the purpose of finding the pointers to
- // thread-specific data keys.
- const uptr tcb_size = ThreadDescriptorSize();
- *addr -= tcb_size;
- *size += tcb_size;
-+# endif
- # endif
- # endif
- # elif SANITIZER_NETBSD
-diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-index 7bbc6f2edac2..490e75fe8f65 100644
---- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-+++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
-@@ -96,7 +96,7 @@
- # include <sys/ptrace.h>
- # if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
- defined(__hexagon__) || defined(__loongarch__) || SANITIZER_RISCV64 || \
-- defined(__sparc__)
-+ defined(__sparc__) || defined(__powerpc64__)
- # include <asm/ptrace.h>
- # ifdef __arm__
- typedef struct user_fpregs elf_fpregset_t;
-diff --git a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
-index 945da99d41f4..58d17d90c343 100644
---- a/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
-+++ b/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cpp
-@@ -31,7 +31,8 @@
- #include <sys/types.h> // for pid_t
- #include <sys/uio.h> // for iovec
- #include <elf.h> // for NT_PRSTATUS
--#if (defined(__aarch64__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
-+#if (defined(__aarch64__) || defined(__powerpc64__) || \
-+ SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
- !SANITIZER_ANDROID
- // GLIBC 2.20+ sys/user does not include asm/ptrace.h
- # include <asm/ptrace.h>
---
-2.49.0
-
diff --git a/15.1.0/gentoo/README.history b/15.1.0/gentoo/README.history
index 85c3d19..53d05f8 100644
--- a/15.1.0/gentoo/README.history
+++ b/15.1.0/gentoo/README.history
@@ -1,5 +1,6 @@
5 ????
+ - 85_all_PR119356-riscv-libsanitizer.patch
- 86_all_PR119085.patch
4 27 July 2025
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/
@ 2025-08-01 13:08 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2025-08-01 13:08 UTC (permalink / raw
To: gentoo-commits
commit: abb37548524e18009e5632a9098b2c239a42c358
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 1 13:08:28 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 1 13:08:28 2025 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=abb37548
15.1.0: cut patchset 5
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.1.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.1.0/gentoo/README.history b/15.1.0/gentoo/README.history
index 53d05f8..49b3137 100644
--- a/15.1.0/gentoo/README.history
+++ b/15.1.0/gentoo/README.history
@@ -1,4 +1,4 @@
-5 ????
+5 1 August 2025
- 85_all_PR119356-riscv-libsanitizer.patch
- 86_all_PR119085.patch
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-08-01 13:09 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 13:08 [gentoo-commits] proj/gcc-patches:master commit in: 15.1.0/gentoo/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2025-07-31 14:41 Sam James
2025-07-29 9:05 Sam James
2025-07-27 1:03 Sam James
2025-07-13 0:49 Sam James
2025-07-13 0:48 Sam James
2025-07-08 18:43 Sam James
2025-05-07 11:21 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox