[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2024-04-07 Thread Sam James
commit: 0b365302d77dabad96a00c5fe3643d905ec39298
Author: Sam James  gentoo  org>
AuthorDate: Sun Apr  7 23:15:56 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Apr  7 23:16:27 2024 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=0b365302

13.2.0: rebase patches

Signed-off-by: Sam James  gentoo.org>

 ...l_match.pd-don-t-emit-label-if-not-needed.patch |  8 ++--
 ...move-commented-out-line-pragmas-unless-vv.patch |  8 ++--
 ...78_all_match.pd-CSE-the-dump-output-check.patch |  8 ++--
 ...lit-shared-code-to-gimple-match-exports.c.patch | 18 -
 ...pd-automatically-partition-match.cc-files.patch | 18 -
 ...e-splits-in-makefile-and-make-configurabl.patch | 46 +++---
 ...in-clean-up-match.pd-related-dependencies.patch |  6 +--
 ...ce-seq-for-portability-with-GNU-Make-vari.patch |  9 +++--
 ...l_Remove-DEFAULT_MATCHPD_PARTITIONS-macro.patch | 46 +++---
 in-Make-TM_P_H-depend-on-TREE_H-PR111021.patch |  6 +--
 ...in-Make-recog.h-depend-on-TREE_H-PR111021.patch |  6 +--
 ...genemit-Split-insn-emit.cc-into-ten-files.patch | 26 ++--
 13.2.0/gentoo/README.history   | 12 ++
 13 files changed, 133 insertions(+), 84 deletions(-)

diff --git a/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch 
b/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch
index 9d702eb..95da940 100644
--- a/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch
+++ b/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch
@@ -1,9 +1,9 @@
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21
 
-From 30f78d42a215686cab9c7276076f11e5ea08341d Mon Sep 17 00:00:00 2001
+From 6178fddd3e0957fbb8bcfc443fef172691b7640b Mon Sep 17 00:00:00 2001
 From: Tamar Christina 
 Date: Fri, 5 May 2023 13:35:17 +0100
-Subject: [PATCH 02/14] match.pd: don't emit label if not needed
+Subject: [PATCH 01/15] match.pd: don't emit label if not needed
 
 This is a small QoL codegen improvement for match.pd to not emit labels when
 they are not needed.  The codegen is nice and there is a small (but consistent)
@@ -20,7 +20,7 @@ gcc/ChangeLog:
  1 file changed, 22 insertions(+), 8 deletions(-)
 
 diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
-index 98b429a9d0bb..0c5a19aca8ed 100644
+index c1023d921fca..9ecd0a462b4f 100644
 --- a/gcc/genmatch.cc
 +++ b/gcc/genmatch.cc
 @@ -3354,6 +3354,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
@@ -110,5 +110,5 @@ index 98b429a9d0bb..0c5a19aca8ed 100644
  }
  
 -- 
-2.43.0
+2.44.0
 

diff --git 
a/13.2.0/gentoo/77_all_match.pd-Remove-commented-out-line-pragmas-unless-vv.patch
 
b/13.2.0/gentoo/77_all_match.pd-Remove-commented-out-line-pragmas-unless-vv.patch
index fb50871..ea61987 100644
--- 
a/13.2.0/gentoo/77_all_match.pd-Remove-commented-out-line-pragmas-unless-vv.patch
+++ 
b/13.2.0/gentoo/77_all_match.pd-Remove-commented-out-line-pragmas-unless-vv.patch
@@ -1,9 +1,9 @@
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21
 
-From 1e714dddc3646b484014ec6636b3d80910536b4b Mon Sep 17 00:00:00 2001
+From 2be19327b38b4e3e183d47529871614a3ef0c3ad Mon Sep 17 00:00:00 2001
 From: Tamar Christina 
 Date: Fri, 5 May 2023 13:36:01 +0100
-Subject: [PATCH 03/14] match.pd: Remove commented out line pragmas unless -vv
+Subject: [PATCH 02/15] match.pd: Remove commented out line pragmas unless -vv
  is used.
 
 genmatch currently outputs commented out line directives that have no effect
@@ -24,7 +24,7 @@ gcc/ChangeLog:
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
-index 0c5a19aca8ed..8937c76369cb 100644
+index 9ecd0a462b4f..45e49c790b6d 100644
 --- a/gcc/genmatch.cc
 +++ b/gcc/genmatch.cc
 @@ -209,7 +209,7 @@ output_line_directive (FILE *f, location_t location,
@@ -37,5 +37,5 @@ index 0c5a19aca8ed..8937c76369cb 100644
 development it's right now more convenient to have line information
 from the generated file.  Still keep the directives as comment for now
 -- 
-2.43.0
+2.44.0
 

diff --git a/13.2.0/gentoo/78_all_match.pd-CSE-the-dump-output-check.patch 
b/13.2.0/gentoo/78_all_match.pd-CSE-the-dump-output-check.patch
index 8dda55a..e084c4c 100644
--- a/13.2.0/gentoo/78_all_match.pd-CSE-the-dump-output-check.patch
+++ b/13.2.0/gentoo/78_all_match.pd-CSE-the-dump-output-check.patch
@@ -1,9 +1,9 @@
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21
 
-From c256e2c80e56c4e015d8d7ca50fa01a6ed98a1eb Mon Sep 17 00:00:00 2001
+From 2d83fafb3f263544be09bf7dbde036e4a84f6d7c Mon Sep 17 00:00:00 2001
 From: Tamar Christina 
 Date: Fri, 5 May 2023 13:36:43 +0100
-Subject: [PATCH 04/14] match.pd: CSE the dump output check.
+Subject: [PATCH 03/15] match.pd: CSE the dump output check.
 
 This is a small improvement in QoL codegen for match.pd to save time not
 re-evaluating the condition for printing debug information in every function.
@@ -26,7 +26,7 @@ gcc/ChangeLog:
  1

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2024-04-07 Thread Sam James
commit: 81f30ec8c4148cd75cf2aa15744a77b6bc18094a
Author: Sam James  gentoo  org>
AuthorDate: Sun Apr  7 23:04:32 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Apr  7 23:04:32 2024 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=81f30ec8

13.2.0: drop upstreamed patch, backport riscv gstreamer fix

Bug: https://bugs.gentoo.org/928234
Signed-off-by: Sam James  gentoo.org>

 ...50_all_PR111632_system_cxx_headers_libcxx.patch | 134 
 .../gentoo/92_all_riscv_PR109760-gstreamer.patch   | 337 +
 13.2.0/gentoo/README.history   |   5 +
 3 files changed, 342 insertions(+), 134 deletions(-)

diff --git a/13.2.0/gentoo/50_all_PR111632_system_cxx_headers_libcxx.patch 
b/13.2.0/gentoo/50_all_PR111632_system_cxx_headers_libcxx.patch
deleted file mode 100644
index af6c286..000
--- a/13.2.0/gentoo/50_all_PR111632_system_cxx_headers_libcxx.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-https://bugs.gentoo.org/912035
-https://inbox.sourceware.org/gcc-patches/0623e896-6b99-49ec-9144-b41bc5108...@andric.com
-https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274038
-https://gcc.gnu.org/PR111632
-
-commit 8992952bfa95e769a554bd97581cf332987383d8
-Author: Dimitry Andric 
-Date:   2023-09-28T17:40:29+02:00
-
-Include safe-ctype.h after C++ standard headers, to avoid over-poisoning
-
-When building gcc's C++ sources against recent libc++, the poisoning of
-the ctype macros due to including safe-ctype.h before including C++
-standard headers such as , , etc, causes many compilation
-errors, similar to:
-
-  In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
-  In file included from /home/dim/src/gcc/master/gcc/system.h:233:
-  In file included from /usr/include/c++/v1/vector:321:
-  In file included from
-  /usr/include/c++/v1/__format/formatter_bool.h:20:
-  In file included from
-  /usr/include/c++/v1/__format/formatter_integral.h:32:
-  In file included from /usr/include/c++/v1/locale:202:
-  /usr/include/c++/v1/__locale:546:5: error: '__abi_tag__' attribute
-  only applies to structs, variables, functions, and namespaces
-546 | _LIBCPP_INLINE_VISIBILITY
-| ^
-  /usr/include/c++/v1/__config:813:37: note: expanded from macro
-  '_LIBCPP_INLINE_VISIBILITY'
-813 | #  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
-| ^
-  /usr/include/c++/v1/__config:792:26: note: expanded from macro
-  '_LIBCPP_HIDE_FROM_ABI'
-792 |
-__attribute__((__abi_tag__(_LIBCPP_TOSTRING(
-  _LIBCPP_VERSIONED_IDENTIFIER
-|  ^
-  In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
-  In file included from /home/dim/src/gcc/master/gcc/system.h:233:
-  In file included from /usr/include/c++/v1/vector:321:
-  In file included from
-  /usr/include/c++/v1/__format/formatter_bool.h:20:
-  In file included from
-  /usr/include/c++/v1/__format/formatter_integral.h:32:
-  In file included from /usr/include/c++/v1/locale:202:
-  /usr/include/c++/v1/__locale:547:37: error: expected ';' at end of
-  declaration list
-547 | char_type toupper(char_type __c) const
-| ^
-  /usr/include/c++/v1/__locale:553:48: error: too many arguments
-  provided to function-like macro invocation
-553 | const char_type* toupper(char_type* __low, const
-char_type* __high) const
-|^
-  /home/dim/src/gcc/master/gcc/../include/safe-ctype.h:146:9: note:
-  macro 'toupper' defined here
-146 | #define toupper(c) do_not_use_toupper_with_safe_ctype
-| ^
-
-This is because libc++ uses different transitive includes than
-libstdc++, and some of those transitive includes pull in various ctype
-declarations (typically via ).
-
-There was already a special case for including  before
-safe-ctype.h, so move the rest of the C++ standard header includes to
-the same location, to fix the problem.
-
-Signed-off-by: Dimitry Andric 
-
-diff --git a/gcc/system.h b/gcc/system.h
-index e924152ad4c..7a516b11438 100644
 a/gcc/system.h
-+++ b/gcc/system.h
-@@ -194,27 +194,8 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
- #undef fread_unlocked
- #undef fwrite_unlocked
- 
--/* Include  before "safe-ctype.h" to avoid GCC poisoning
--   the ctype macros through safe-ctype.h */
--
--#ifdef __cplusplus
--#ifdef INCLUDE_STRING
--# include 
--#endif
--#endif
--
--/* There are an extraordinary number of issues with .
--   The last straw is that it varies with the locale.  Use libiberty's
--   replacement instead.  */
--#include "safe-ctype.h"
--
--#include 
--
--#include 
--
--#if !defined (er

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2024-07-27 Thread Sam James
commit: d892a97182979c3d430469e60ec9a023e899cfe0
Author: Sam James  gentoo  org>
AuthorDate: Sat Jul 27 19:46:31 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Jul 27 19:46:31 2024 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d892a971

13.2.0: drop 93_all_ppc_PR97367-power7-cell-altivec.patch

It's merged upstream.

Signed-off-by: Sam James  gentoo.org>

 13.2.0/gentoo/93_all_ppc_PR97367-power7-cell-altivec.patch | 13 -
 13.2.0/gentoo/README.history   |  4 
 2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/13.2.0/gentoo/93_all_ppc_PR97367-power7-cell-altivec.patch 
b/13.2.0/gentoo/93_all_ppc_PR97367-power7-cell-altivec.patch
deleted file mode 100644
index 154dd0f..000
--- a/13.2.0/gentoo/93_all_ppc_PR97367-power7-cell-altivec.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://gcc.gnu.org/PR97367
-https://inbox.sourceware.org/gcc-patches/20240308.123342.1112119677226246836.r...@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/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index 86a0fb1..17f8d53 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.history
@@ -1,3 +1,7 @@
+18 27 June 2024
+
+   - 93_all_ppc_PR97367-power7-cell-altivec.patch
+
 17 8 June 2024
 
+ 93_all_ppc_PR97367-power7-cell-altivec.patch



[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2024-02-11 Thread Sam James
commit: fa67a66af82ec9fd027c01acb862fe6dbd86bf78
Author: Sam James  gentoo  org>
AuthorDate: Mon Feb 12 05:56:45 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Feb 12 05:57:09 2024 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=fa67a66a

13.2.0: drop 91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch

Backported upstream.

Signed-off-by: Sam James  gentoo.org>

 ...tdc-Prefer-posix_memalign-for-aligned-new.patch | 97 --
 13.2.0/gentoo/README.history   |  4 +
 2 files changed, 4 insertions(+), 97 deletions(-)

diff --git 
a/13.2.0/gentoo/91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch
 
b/13.2.0/gentoo/91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch
deleted file mode 100644
index a03f268..000
--- 
a/13.2.0/gentoo/91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-https://gcc.gnu.org/PR113258
-https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f50f2efae9fb0965d8ccdb62cfdb698336d5a933
-
-From d17158058fee187e7efb918145c87bdfff9cbfa3 Mon Sep 17 00:00:00 2001
-From: Jonathan Wakely 
-Date: Tue, 9 Jan 2024 15:22:46 +
-Subject: [PATCH] libstdc++: Prefer posix_memalign for aligned-new [PR113258]
-
-As described in PR libstdc++/113258 there are old versions of tcmalloc
-which replace malloc and related APIs, but do not repalce aligned_alloc
-because it didn't exist at the time they were released. This means that
-when operator new(size_t, align_val_t) uses aligned_alloc to obtain
-memory, it comes from libc's aligned_alloc not from tcmalloc. But when
-operator delete(void*, size_t, align_val_t) uses free to deallocate the
-memory, that goes to tcmalloc's replacement version of free, which
-doesn't know how to free it.
-
-If we give preference to the older posix_memalign instead of
-aligned_alloc then we're more likely to use a function that will be
-compatible with the replacement version of free. Because posix_memalign
-has been around for longer, it's more likely that old third-party malloc
-replacements will also replace posix_memalign alongside malloc and free.
-
-libstdc++-v3/ChangeLog:
-
-   PR libstdc++/113258
-   * libsupc++/new_opa.cc: Prefer to use posix_memalign if
-   available.
-
-(cherry picked from commit f50f2efae9fb0965d8ccdb62cfdb698336d5a933)

- libstdc++-v3/libsupc++/new_opa.cc | 26 +++---
- 1 file changed, 15 insertions(+), 11 deletions(-)
-
-diff --git a/libstdc++-v3/libsupc++/new_opa.cc 
b/libstdc++-v3/libsupc++/new_opa.cc
-index 6eb136fa8fc7..29767c1cfaad 100644
 a/libstdc++-v3/libsupc++/new_opa.cc
-+++ b/libstdc++-v3/libsupc++/new_opa.cc
-@@ -46,12 +46,12 @@ using std::bad_alloc;
- using std::size_t;
- extern "C"
- {
--# if _GLIBCXX_HAVE_ALIGNED_ALLOC
-+# if _GLIBCXX_HAVE_POSIX_MEMALIGN
-+  void *posix_memalign(void **, size_t alignment, size_t size);
-+# elif _GLIBCXX_HAVE_ALIGNED_ALLOC
-   void *aligned_alloc(size_t alignment, size_t size);
- # elif _GLIBCXX_HAVE__ALIGNED_MALLOC
-   void *_aligned_malloc(size_t size, size_t alignment);
--# elif _GLIBCXX_HAVE_POSIX_MEMALIGN
--  void *posix_memalign(void **, size_t alignment, size_t size);
- # elif _GLIBCXX_HAVE_MEMALIGN
-   void *memalign(size_t alignment, size_t size);
- # else
-@@ -63,13 +63,10 @@ extern "C"
- #endif
- 
- namespace __gnu_cxx {
--#if _GLIBCXX_HAVE_ALIGNED_ALLOC
--using ::aligned_alloc;
--#elif _GLIBCXX_HAVE__ALIGNED_MALLOC
--static inline void*
--aligned_alloc (std::size_t al, std::size_t sz)
--{ return _aligned_malloc(sz, al); }
--#elif _GLIBCXX_HAVE_POSIX_MEMALIGN
-+// Prefer posix_memalign if available, because it's older than aligned_alloc
-+// and so more likely to be provided by replacement malloc libraries that
-+// predate the addition of aligned_alloc. See PR libstdc++/113258.
-+#if _GLIBCXX_HAVE_POSIX_MEMALIGN
- static inline void*
- aligned_alloc (std::size_t al, std::size_t sz)
- {
-@@ -83,6 +80,12 @@ aligned_alloc (std::size_t al, std::size_t sz)
- return ptr;
-   return nullptr;
- }
-+#elif _GLIBCXX_HAVE_ALIGNED_ALLOC
-+using ::aligned_alloc;
-+#elif _GLIBCXX_HAVE__ALIGNED_MALLOC
-+static inline void*
-+aligned_alloc (std::size_t al, std::size_t sz)
-+{ return _aligned_malloc(sz, al); }
- #elif _GLIBCXX_HAVE_MEMALIGN
- static inline void*
- aligned_alloc (std::size_t al, std::size_t sz)
-@@ -128,7 +131,8 @@ operator new (std::size_t sz, std::align_val_t al)
-   if (__builtin_expect (sz == 0, false))
- sz = 1;
- 
--#if _GLIBCXX_HAVE_ALIGNED_ALLOC
-+#if _GLIBCXX_HAVE_POSIX_MEMALIGN
-+#elif _GLIBCXX_HAVE_ALIGNED_ALLOC
- # if defined _AIX || defined __APPLE__
-   /* AIX 7.2.0.0 aligned_alloc incorrectly has posix_memalign's requirement
-* that alignment is a multiple of sizeof(void*).
--- 
-2.43.0

diff --git a/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index 3a6ad75..125a634 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.hi

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2024-01-16 Thread Sam James
commit: 953476b6862099862501b7c2cfed7b91ccb8573c
Author: Sam James  gentoo  org>
AuthorDate: Wed Jan 17 01:05:33 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Jan 17 01:05:45 2024 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=953476b6

13.2.0: add 91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch

This helps some Steam games.

Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7367
Bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8133
Bug: https://github.com/ValveSoftware/csgo-osx-linux/issues/2659
Bug: https://gcc.gnu.org/PR113258
Signed-off-by: Sam James  gentoo.org>

 ...tdc-Prefer-posix_memalign-for-aligned-new.patch | 97 ++
 13.2.0/gentoo/README.history   |  4 +
 2 files changed, 101 insertions(+)

diff --git 
a/13.2.0/gentoo/91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch
 
b/13.2.0/gentoo/91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch
new file mode 100644
index 000..a03f268
--- /dev/null
+++ 
b/13.2.0/gentoo/91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch
@@ -0,0 +1,97 @@
+https://gcc.gnu.org/PR113258
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=f50f2efae9fb0965d8ccdb62cfdb698336d5a933
+
+From d17158058fee187e7efb918145c87bdfff9cbfa3 Mon Sep 17 00:00:00 2001
+From: Jonathan Wakely 
+Date: Tue, 9 Jan 2024 15:22:46 +
+Subject: [PATCH] libstdc++: Prefer posix_memalign for aligned-new [PR113258]
+
+As described in PR libstdc++/113258 there are old versions of tcmalloc
+which replace malloc and related APIs, but do not repalce aligned_alloc
+because it didn't exist at the time they were released. This means that
+when operator new(size_t, align_val_t) uses aligned_alloc to obtain
+memory, it comes from libc's aligned_alloc not from tcmalloc. But when
+operator delete(void*, size_t, align_val_t) uses free to deallocate the
+memory, that goes to tcmalloc's replacement version of free, which
+doesn't know how to free it.
+
+If we give preference to the older posix_memalign instead of
+aligned_alloc then we're more likely to use a function that will be
+compatible with the replacement version of free. Because posix_memalign
+has been around for longer, it's more likely that old third-party malloc
+replacements will also replace posix_memalign alongside malloc and free.
+
+libstdc++-v3/ChangeLog:
+
+   PR libstdc++/113258
+   * libsupc++/new_opa.cc: Prefer to use posix_memalign if
+   available.
+
+(cherry picked from commit f50f2efae9fb0965d8ccdb62cfdb698336d5a933)
+---
+ libstdc++-v3/libsupc++/new_opa.cc | 26 +++---
+ 1 file changed, 15 insertions(+), 11 deletions(-)
+
+diff --git a/libstdc++-v3/libsupc++/new_opa.cc 
b/libstdc++-v3/libsupc++/new_opa.cc
+index 6eb136fa8fc7..29767c1cfaad 100644
+--- a/libstdc++-v3/libsupc++/new_opa.cc
 b/libstdc++-v3/libsupc++/new_opa.cc
+@@ -46,12 +46,12 @@ using std::bad_alloc;
+ using std::size_t;
+ extern "C"
+ {
+-# if _GLIBCXX_HAVE_ALIGNED_ALLOC
++# if _GLIBCXX_HAVE_POSIX_MEMALIGN
++  void *posix_memalign(void **, size_t alignment, size_t size);
++# elif _GLIBCXX_HAVE_ALIGNED_ALLOC
+   void *aligned_alloc(size_t alignment, size_t size);
+ # elif _GLIBCXX_HAVE__ALIGNED_MALLOC
+   void *_aligned_malloc(size_t size, size_t alignment);
+-# elif _GLIBCXX_HAVE_POSIX_MEMALIGN
+-  void *posix_memalign(void **, size_t alignment, size_t size);
+ # elif _GLIBCXX_HAVE_MEMALIGN
+   void *memalign(size_t alignment, size_t size);
+ # else
+@@ -63,13 +63,10 @@ extern "C"
+ #endif
+ 
+ namespace __gnu_cxx {
+-#if _GLIBCXX_HAVE_ALIGNED_ALLOC
+-using ::aligned_alloc;
+-#elif _GLIBCXX_HAVE__ALIGNED_MALLOC
+-static inline void*
+-aligned_alloc (std::size_t al, std::size_t sz)
+-{ return _aligned_malloc(sz, al); }
+-#elif _GLIBCXX_HAVE_POSIX_MEMALIGN
++// Prefer posix_memalign if available, because it's older than aligned_alloc
++// and so more likely to be provided by replacement malloc libraries that
++// predate the addition of aligned_alloc. See PR libstdc++/113258.
++#if _GLIBCXX_HAVE_POSIX_MEMALIGN
+ static inline void*
+ aligned_alloc (std::size_t al, std::size_t sz)
+ {
+@@ -83,6 +80,12 @@ aligned_alloc (std::size_t al, std::size_t sz)
+ return ptr;
+   return nullptr;
+ }
++#elif _GLIBCXX_HAVE_ALIGNED_ALLOC
++using ::aligned_alloc;
++#elif _GLIBCXX_HAVE__ALIGNED_MALLOC
++static inline void*
++aligned_alloc (std::size_t al, std::size_t sz)
++{ return _aligned_malloc(sz, al); }
+ #elif _GLIBCXX_HAVE_MEMALIGN
+ static inline void*
+ aligned_alloc (std::size_t al, std::size_t sz)
+@@ -128,7 +131,8 @@ operator new (std::size_t sz, std::align_val_t al)
+   if (__builtin_expect (sz == 0, false))
+ sz = 1;
+ 
+-#if _GLIBCXX_HAVE_ALIGNED_ALLOC
++#if _GLIBCXX_HAVE_POSIX_MEMALIGN
++#elif _GLIBCXX_HAVE_ALIGNED_ALLOC
+ # if defined _AIX || defined __APPLE__
+   /* AIX 7.2.0.0 aligned_alloc incorrectly has posix_memalign's requirement
+* that alignment is a m

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-12-02 Thread Sam James
commit: 4645a0fbda11a783b7545ae92d8a7e1783a7f583
Author: Sam James  gentoo  org>
AuthorDate: Sun Dec  3 03:17:22 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Dec  3 03:17:22 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4645a0fb

13.2.0: cut patchset 11

Signed-off-by: Sam James  gentoo.org>

 13.2.0/gentoo/README.history | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index e306264..69f7809 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.history
@@ -1,4 +1,4 @@
-11 ?? ??? 2023
+11 3 Dec 2023
 
U 76_all_match.pd-don-t-emit-label-if-not-needed.patch
U 77_all_match.pd-Remove-commented-out-line-pragmas-unless-vv.patch



[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2024-02-27 Thread Sam James
commit: d5e5f9b252f00c9485c34446efc01bdd2eaaa9b1
Author: Sam James  gentoo  org>
AuthorDate: Wed Feb 28 00:28:36 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Feb 28 00:29:43 2024 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d5e5f9b2

13.2.0: add 91_all_riscv_PR106271-multilib-bootstrap.patch

Fixes prefix bootstrap for riscv.

Bug: https://gcc.gnu.org/PR106271
Bug: https://bugs.gentoo.org/890636
Signed-off-by: Sam James  gentoo.org>

 .../91_all_riscv_PR106271-multilib-bootstrap.patch | 37 ++
 13.2.0/gentoo/README.history   |  4 +++
 2 files changed, 41 insertions(+)

diff --git a/13.2.0/gentoo/91_all_riscv_PR106271-multilib-bootstrap.patch 
b/13.2.0/gentoo/91_all_riscv_PR106271-multilib-bootstrap.patch
new file mode 100644
index 000..2d2933f
--- /dev/null
+++ b/13.2.0/gentoo/91_all_riscv_PR106271-multilib-bootstrap.patch
@@ -0,0 +1,37 @@
+https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=47f95bc4be4eb14730ab3eaaaf8f6e71fda47690
+https://gcc.gnu.org/PR106271
+https://bugs.gentoo.org/890636
+
+From 976280d3fbfc5c1315befb36cebf07a6f1f0c518 Mon Sep 17 00:00:00 2001
+From: Raphael Moreira Zinsly 
+Date: Tue, 22 Aug 2023 11:37:04 -0600
+Subject: [PATCH] RISC-V: Add multiarch support on riscv-linux-gnu
+
+This adds multiarch support to the RISC-V port so that bootstraps work with
+Debian out-of-the-box.  Without this patch the stage1 compiler is unable to
+find headers/libraries when building the stage1 runtime.
+
+This is functionally (and possibly textually) equivalent to Debian's fix for
+the same problem.
+
+gcc/
+   * config/riscv/t-linux: Add MULTIARCH_DIRNAME.
+
+(cherry picked from commit 47f95bc4be4eb14730ab3eaaaf8f6e71fda47690)
+---
+ gcc/config/riscv/t-linux | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/gcc/config/riscv/t-linux b/gcc/config/riscv/t-linux
+index 216d2776a183..a6f64f88d25c 100644
+--- a/gcc/config/riscv/t-linux
 b/gcc/config/riscv/t-linux
+@@ -1,3 +1,5 @@
+ # Only XLEN and ABI affect Linux multilib dir names, e.g. /lib32/ilp32d/
+ MULTILIB_DIRNAMES := $(patsubst rv32%,lib32,$(patsubst 
rv64%,lib64,$(MULTILIB_DIRNAMES)))
+ MULTILIB_OSDIRNAMES := $(patsubst lib%,../lib%,$(MULTILIB_DIRNAMES))
++
++MULTIARCH_DIRNAME := $(call if_multiarch,$(firstword $(subst -, 
,$(target)))-linux-gnu)
+-- 
+2.44.0
+

diff --git a/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index 125a634..3477e53 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.history
@@ -1,3 +1,7 @@
+14 28 Feb 2024
+
+   + 91_all_riscv_PR106271-multilib-bootstrap.patch
+
 13 12 Feb 2024
 
- 91_all_PR113258_libstdc-Prefer-posix_memalign-for-aligned-new.patch



[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-09-30 Thread Sam James
commit: 9e320b0781c3505e9f6ff49b84f5b35d6016c653
Author: Sam James  gentoo  org>
AuthorDate: Sun Oct  1 01:50:47 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Oct  1 02:28:48 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9e320b07

13.2.0: add 50_all_PR111632_system_cxx_headers_libcxx.patch

Bug: https://gcc.gnu.org/PR111632
Bug: https://bugs.gentoo.org/912035
Signed-off-by: Sam James  gentoo.org>

 ...50_all_PR111632_system_cxx_headers_libcxx.patch | 134 +
 13.2.0/gentoo/README.history   |   1 +
 2 files changed, 135 insertions(+)

diff --git a/13.2.0/gentoo/50_all_PR111632_system_cxx_headers_libcxx.patch 
b/13.2.0/gentoo/50_all_PR111632_system_cxx_headers_libcxx.patch
new file mode 100644
index 000..af6c286
--- /dev/null
+++ b/13.2.0/gentoo/50_all_PR111632_system_cxx_headers_libcxx.patch
@@ -0,0 +1,134 @@
+https://bugs.gentoo.org/912035
+https://inbox.sourceware.org/gcc-patches/0623e896-6b99-49ec-9144-b41bc5108...@andric.com
+https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274038
+https://gcc.gnu.org/PR111632
+
+commit 8992952bfa95e769a554bd97581cf332987383d8
+Author: Dimitry Andric 
+Date:   2023-09-28T17:40:29+02:00
+
+Include safe-ctype.h after C++ standard headers, to avoid over-poisoning
+
+When building gcc's C++ sources against recent libc++, the poisoning of
+the ctype macros due to including safe-ctype.h before including C++
+standard headers such as , , etc, causes many compilation
+errors, similar to:
+
+  In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
+  In file included from /home/dim/src/gcc/master/gcc/system.h:233:
+  In file included from /usr/include/c++/v1/vector:321:
+  In file included from
+  /usr/include/c++/v1/__format/formatter_bool.h:20:
+  In file included from
+  /usr/include/c++/v1/__format/formatter_integral.h:32:
+  In file included from /usr/include/c++/v1/locale:202:
+  /usr/include/c++/v1/__locale:546:5: error: '__abi_tag__' attribute
+  only applies to structs, variables, functions, and namespaces
+546 | _LIBCPP_INLINE_VISIBILITY
+| ^
+  /usr/include/c++/v1/__config:813:37: note: expanded from macro
+  '_LIBCPP_INLINE_VISIBILITY'
+813 | #  define _LIBCPP_INLINE_VISIBILITY _LIBCPP_HIDE_FROM_ABI
+| ^
+  /usr/include/c++/v1/__config:792:26: note: expanded from macro
+  '_LIBCPP_HIDE_FROM_ABI'
+792 |
+__attribute__((__abi_tag__(_LIBCPP_TOSTRING(
+  _LIBCPP_VERSIONED_IDENTIFIER
+|  ^
+  In file included from /home/dim/src/gcc/master/gcc/gensupport.cc:23:
+  In file included from /home/dim/src/gcc/master/gcc/system.h:233:
+  In file included from /usr/include/c++/v1/vector:321:
+  In file included from
+  /usr/include/c++/v1/__format/formatter_bool.h:20:
+  In file included from
+  /usr/include/c++/v1/__format/formatter_integral.h:32:
+  In file included from /usr/include/c++/v1/locale:202:
+  /usr/include/c++/v1/__locale:547:37: error: expected ';' at end of
+  declaration list
+547 | char_type toupper(char_type __c) const
+| ^
+  /usr/include/c++/v1/__locale:553:48: error: too many arguments
+  provided to function-like macro invocation
+553 | const char_type* toupper(char_type* __low, const
+char_type* __high) const
+|^
+  /home/dim/src/gcc/master/gcc/../include/safe-ctype.h:146:9: note:
+  macro 'toupper' defined here
+146 | #define toupper(c) do_not_use_toupper_with_safe_ctype
+| ^
+
+This is because libc++ uses different transitive includes than
+libstdc++, and some of those transitive includes pull in various ctype
+declarations (typically via ).
+
+There was already a special case for including  before
+safe-ctype.h, so move the rest of the C++ standard header includes to
+the same location, to fix the problem.
+
+Signed-off-by: Dimitry Andric 
+
+diff --git a/gcc/system.h b/gcc/system.h
+index e924152ad4c..7a516b11438 100644
+--- a/gcc/system.h
 b/gcc/system.h
+@@ -194,27 +194,8 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
+ #undef fread_unlocked
+ #undef fwrite_unlocked
+ 
+-/* Include  before "safe-ctype.h" to avoid GCC poisoning
+-   the ctype macros through safe-ctype.h */
+-
+-#ifdef __cplusplus
+-#ifdef INCLUDE_STRING
+-# include 
+-#endif
+-#endif
+-
+-/* There are an extraordinary number of issues with .
+-   The last straw is that it varies with the locale.  Use libiberty's
+-   replacement instead.  */
+-#include "safe-ctype.h"
+-
+-#include 
+-
+-#include 
+-
+-#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-09-30 Thread Sam James
commit: d10e29b8069920831f8c63a63e58f0dfe46ee3fe
Author: Sam James  gentoo  org>
AuthorDate: Sun Oct  1 01:45:42 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Oct  1 02:28:48 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d10e29b8

13.2.0: drop upstreamed 83_all_all_PR110315_crash_large_std_vector.patch

Signed-off-by: Sam James  gentoo.org>

 ...3_all_all_PR110315_crash_large_std_vector.patch | 353 -
 13.2.0/gentoo/README.history   |   3 +
 2 files changed, 3 insertions(+), 353 deletions(-)

diff --git a/13.2.0/gentoo/83_all_all_PR110315_crash_large_std_vector.patch 
b/13.2.0/gentoo/83_all_all_PR110315_crash_large_std_vector.patch
deleted file mode 100644
index 7c854ff..000
--- a/13.2.0/gentoo/83_all_all_PR110315_crash_large_std_vector.patch
+++ /dev/null
@@ -1,353 +0,0 @@
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110315 (specifically 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110315#c7)
-
-From 777aa930b106fea2dd6ed9fe22b42a2717f1472d Mon Sep 17 00:00:00 2001
-From: Aldy Hernandez 
-Date: Mon, 15 May 2023 12:25:58 +0200
-Subject: [PATCH] [GCC13] Add auto-resizing capability to irange's [PR109695]
-
-Backport the following from trunk.
-
-   Note that the patch has been adapted to trees.
-
-   The numbers for various sub-ranges on GCC13 are:
-   < 2> =  64 bytes, -3.02% for VRP.
-   < 3> =  80 bytes, -2.67% for VRP.
-   < 8> = 160 bytes, -2.46% for VRP.
-   <16> = 288 bytes, -2.40% for VRP.
-
-
-We can now have int_range for automatically
-resizable ranges.  int_range_max is now int_range<3, true>
-for a 69X reduction in size from current trunk, and 6.9X reduction from
-GCC12.  This incurs a 5% performance penalty for VRP that is more than
-covered by our > 13% improvements recently.
-
-
-int_range_max is the temporary range object we use in the ranger for
-integers.  With the conversion to wide_int, this structure bloated up
-significantly because wide_ints are huge (80 bytes a piece) and are
-about 10 times as big as a plain tree.  Since the temporary object
-requires 255 sub-ranges, that's 255 * 80 * 2, plus the control word.
-This means the structure grew from 4112 bytes to 40912 bytes.
-
-This patch adds the ability to resize ranges as needed, defaulting to
-no resizing, while int_range_max now defaults to 3 sub-ranges (instead
-of 255) and grows to 255 when the range being calculated does not fit.
-
-For example:
-
-int_range<1> foo;  // 1 sub-range with no resizing.
-int_range<5> foo;  // 5 sub-ranges with no resizing.
-int_range<5, true> foo;// 5 sub-ranges with resizing.
-
-I ran some tests and found that 3 sub-ranges cover 99% of cases, so
-I've set the int_range_max default to that:
-
-   typedef int_range<3, /*RESIZABLE=*/true> int_range_max;
-
-We don't bother growing incrementally, since the default covers most
-cases and we have a 255 hard-limit.  This hard limit could be reduced
-to 128, since my tests never saw a range needing more than 124, but we
-could do that as a follow-up if needed.
-
-With 3-subranges, int_range_max is now 592 bytes versus 40912 for
-trunk, and versus 4112 bytes for GCC12!  The penalty is 5.04% for VRP
-and 3.02% for threading, with no noticeable change in overall
-compilation (0.27%).  This is more than covered by our 13.26%
-improvements for the legacy removal + wide_int conversion.
-
-I think this approach is a good alternative, while providing us with
-flexibility going forward.  For example, we could try defaulting to a
-8 sub-ranges for a noticeable improvement in VRP.  We could also use
-large sub-ranges for switch analysis to avoid resizing.
-
-Another approach I tried was always resizing.  With this, we could
-drop the whole int_range nonsense, and have irange just hold a
-resizable range.  This simplified things, but incurred a 7% penalty on
-ipa_cp.  This was hard to pinpoint, and I'm not entirely convinced
-this wasn't some artifact of valgrind.  However, until we're sure,
-let's avoid massive changes, especially since IPA changes are coming
-up.
-
-For the curious, a particular hot spot for IPA in this area was:
-
-ipcp_vr_lattice::meet_with_1 (const value_range *other_vr)
-{
-...
-...
-  value_range save (m_vr);
-  m_vr.union_ (*other_vr);
-  return m_vr != save;
-}
-
-The problem isn't the resizing (since we do that at most once) but the
-fact that for some functions with lots of callers we end up a huge
-range that gets copied and compared for every meet operation.  Maybe
-the IPA algorithm could be adjusted somehow??.
-
-Anywhooo... for now there is nothing to worry about, since value_range
-still has 2 subranges and is not resizable.  But we should probably
-think what if anything we want to do here, as I envision IPA using
-infinite ranges here (well, int_range_max) and handling frange's, etc.
-
-gcc/ChangeLog:
-
-   PR tree-optimization/109695
-   * value-

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-09-30 Thread Sam James
commit: a2b85f16e79253103389731d9ac60b6868435b48
Author: Sam James  gentoo  org>
AuthorDate: Sun Oct  1 02:02:13 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Oct  1 02:28:48 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a2b85f16

13.2.0: rebase 31_all_gm2_make_P_var.patch

Signed-off-by: Sam James  gentoo.org>

 13.2.0/gentoo/31_all_gm2_make_P_var.patch | 16 +++-
 13.2.0/gentoo/README.history  |  2 ++
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/13.2.0/gentoo/31_all_gm2_make_P_var.patch 
b/13.2.0/gentoo/31_all_gm2_make_P_var.patch
index ef34288..74b3925 100644
--- a/13.2.0/gentoo/31_all_gm2_make_P_var.patch
+++ b/13.2.0/gentoo/31_all_gm2_make_P_var.patch
@@ -12,33 +12,33 @@ r0-31149-gb8dad04b688e9c.
 
 gcc/m2/ChangeLog:
 
-   * Make-lang.in: Remove references to $(P).
-   * Make-maintainer.in: Ditto.
+   * Make-lang.in: Remove references to $(P).
+   * Make-maintainer.in: Ditto.
 
 (cherry picked from commit 79c73122fab213f218b85b2c579ffe3cf5e98ad0)
 --- a/gcc/m2/Make-lang.in
 +++ b/gcc/m2/Make-lang.in
-@@ -515,7 +515,7 @@ GM2_LIBS_BOOT = m2/gm2-compiler-boot/gm2.a \
+@@ -532,7 +532,7 @@ m2_OBJS = $(GM2_C_OBJS) m2/gm2-gcc/rtegraph.o \
  cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) $(m2.prev)
cp -p $< $@
  
 -m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) m2/gm2-compiler/m2flex.o 
$(P) \
 +m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) m2/gm2-compiler/m2flex.o 
\
  $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS) \
- m2/gm2-gcc/rtegraph.o plugin/m2rte$(soext)
+ m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO)
-test -d $(@D) || $(mkinstalldirs) $(@D)
-@@ -528,7 +528,7 @@ m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) 
m2/gm2-compiler/m2flex.o $(
+@@ -545,7 +545,7 @@ m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) 
m2/gm2-compiler/m2flex.o $(
@$(call LINK_PROGRESS,$(INDEX.m2),end)
  
  m2/stage1/cc1gm2$(exeext): gm2$(exeext) m2/gm2-compiler-boot/m2flex.o \
 -$(P) $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) \
 +$(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) \
  $(GM2_LIBS_BOOT) $(MC_LIBS) \
- m2/gm2-gcc/rtegraph.o plugin/m2rte$(soext) \
+ m2/gm2-gcc/rtegraph.o $(M2RTE_PLUGIN_SO) \
  $(m2.prev)
 --- a/gcc/m2/Make-maintainer.in
 +++ b/gcc/m2/Make-maintainer.in
-@@ -848,7 +848,7 @@ GM2_LIBS_PARANOID = m2/gm2-compiler-paranoid/gm2.a \
+@@ -852,7 +852,7 @@ GM2_LIBS_PARANOID = m2/gm2-compiler-paranoid/gm2.a \
  gm2.paranoid: m2/m2obj3/cc1gm2$(exeext) gm2.verifyparanoid
  
  m2/m2obj3/cc1gm2$(exeext): m2/m2obj2/cc1gm2$(exeext) 
m2/gm2-compiler-paranoid/m2flex.o \
@@ -47,5 +47,3 @@ gcc/m2/ChangeLog:
  m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so
-test -d m2/m2obj3 || $(mkinstalldirs) m2/m2obj3
@$(call LINK_PROGRESS,$(INDEX.m2),start)
--- 
-2.41.0

diff --git a/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index 449fcee..1ab8e80 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.history
@@ -1,4 +1,6 @@
 8  1 Oct 2023
+
+   U 31_all_gm2_make_P_var.patch
+ 50_all_system_cxx_headers_libcxx.patch
- 83_all_all_PR110315_crash_large_std_vector.patch
 



[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-10-27 Thread Sam James
commit: 4e7cf4e3cf83a83932fd23c7dfb6a31903d09dd7
Author: Sam James  gentoo  org>
AuthorDate: Fri Oct 27 23:39:42 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Fri Oct 27 23:39:42 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4e7cf4e3

13.2.0: update 90_all_PR54179_genemit-Split-insn-emit.cc-into-ten-files.patch

Signed-off-by: Sam James  gentoo.org>

 ...genemit-Split-insn-emit.cc-into-ten-files.patch | 164 -
 13.2.0/gentoo/README.history   |   4 +
 2 files changed, 100 insertions(+), 68 deletions(-)

diff --git 
a/13.2.0/gentoo/90_all_PR54179_genemit-Split-insn-emit.cc-into-ten-files.patch 
b/13.2.0/gentoo/90_all_PR54179_genemit-Split-insn-emit.cc-into-ten-files.patch
index 19352ac..6a2f3ed 100644
--- 
a/13.2.0/gentoo/90_all_PR54179_genemit-Split-insn-emit.cc-into-ten-files.patch
+++ 
b/13.2.0/gentoo/90_all_PR54179_genemit-Split-insn-emit.cc-into-ten-files.patch
@@ -1,44 +1,42 @@
 https://gcc.gnu.org/PR54179
-https://gcc.gnu.org/PR84402
-https://gcc.gnu.org/PR111600
-https://inbox.sourceware.org/gcc-patches/87il76kgk2@gentoo.org/T/
+https://inbox.sourceware.org/gcc-patches/de0f7bdc-d236-4f5b-9504-d5bfb215d...@gmail.com/
 
-From 6b25a6ca295528805d8dedd59e1ed2f1e218a819 Mon Sep 17 00:00:00 2001
+From a71bcc136fee1c5a5ec6639f802daf1b22a1aab6 Mon Sep 17 00:00:00 2001
 From: Robin Dapp 
-Date: Mon, 16 Oct 2023 12:17:07 +0200
-Subject: [PATCH 6/6] genemit: Split insn-emit.cc into ten files.
+Date: Fri, 27 Oct 2023 21:04:25 +0200
+Subject: [PATCH] genemit: Split insn-emit.cc into ten files.
 
-Hi,
+After working with Sam off-list (thanks) I managed to get hppa to
+build.  Initially it looked as if hppa just had a very small number of
+instruction patterns so we wouldn't generate all 10 output files.
+However, the actual issue (which we will only hit with a low
+pattern count) was with counting all the patterns vs only counting
+the patterns that will be output.  A wrong pattern count lead to
+prematurely stopping to write output files.
 
-the attached v2 includes Tamar's suggestion of keeping the current
-stdout behavior.  When no output files are passed (via -O) the output
-is written to stdout as before.
+With that corrected, hppa "just works" until I hit linker errors
+due to relocations - most likely unrelated:
 
-Tamar also mentioned off-list that, similar to match.pd, it might make
-sense to balance the partitions in a better way than a fixed number
-of patterns threshold.  That's a good idea but I'd rather do that
-separately as the current approach already helps considerably.
+bin/ld: unwind-dw2-fde-dip_s.o(.data.rel.ro+0): cannot handle
+R_PARISC_FPTR64 for __pthread_key_create@@GLIBC_2.34
 
-Attached v2 was bootstrapped and regtested on power10, aarch64 and
-x86 are still running.
-Stefan also tested v1 on s390 where the partitioning does not help
-but also doesn't slow anything down.  insn-emit.cc isn't very large
-to begin with on s390.
+Attached is v3 that has been bootstrapped and tested on x86 and power10,
+aarch64 bootstrap was ok, testsuite is still running.  A riscv build and
+testsuite run was successful as well.
 
 Regards
  Robin
 
->From 34d05113a4e3c7e83a4731020307e26c1144af69 Mon Sep 17 00:00:00 2001
+>From 248744c328440bff9cc339d2bf622852cbaac343 Mon Sep 17 00:00:00 2001
 From: Robin Dapp 
 Date: Thu, 12 Oct 2023 11:23:26 +0200
-Subject: [PATCH v2] genemit: Split insn-emit.cc into several partitions.
+Subject: [PATCH v3] genemit: Split insn-emit.cc into several partitions.
 
 On riscv insn-emit.cc has grown to over 1.2 mio lines of code and
 compiling it takes considerable time.
 Therefore, this patch adjust genemit to create several partitions
-(insn-emit-1.cc to insn-emit-n.cc).  In order to do so it first counts
-the number of available patterns, calculates the number of patterns per
-file and starts a new file whenever that number is reached.
+(insn-emit-1.cc to insn-emit-n.cc).  The available patterns are
+written to the given files in a sequential fashion.
 
 Similar to match.pd a configure option --with-emitinsn-partitions=num
 is introduced that makes the number of partition configurable.
@@ -74,21 +72,19 @@ gcc/ChangeLog:
* gensupport.h (count_patterns): Define.
* read-md.cc (md_reader::print_md_ptr_loc): Add file argument.
* read-md.h (class md_reader): Change definition.
-
-(cherry picked from commit 646ee18fef30ade65e5ff2e7445e4915a0f9a3ad)
 ---
- gcc/Makefile.in   |  38 +++-
- gcc/configure |  22 +-
+ gcc/Makefile.in   |  36 ++-
+ gcc/configure |  24 +-
  gcc/configure.ac  |  13 ++
- gcc/genemit.cc| 536 +-
- gcc/gensupport.cc |  36 
+ gcc/genemit.cc| 542 +-
+ gcc/gensupport.cc |  55 +
  gcc/gensupport.h  |   1 +
  gcc/read-md.cc|   4 +-
  gcc/read-md.h |   2 +-
- 8 files changed, 398 insertions(+), 254 deletions(-)
+ 8 files changed, 4

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-10-16 Thread Sam James
commit: 6e02b91080e891bbc57ced4d3140fcf6ba3d7088
Author: Sam James  gentoo  org>
AuthorDate: Mon Oct 16 12:10:48 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Oct 16 12:40:58 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6e02b910

13.2.0: backport insn-emit split patches

This is a continuation of 7a6b2d23ec02e75475a6123254ccd44d73827f39 ('13.2.0: 
backport split match.pd changes')
in a sense - see that commit for rationale for backporting.

Motivated here again by more reports of OOMs with insn-match.cc.

Bug: https://gcc.gnu.org/PR54179
Bug: https://gcc.gnu.org/PR84402
Bug: https://gcc.gnu.org/PR111600
Signed-off-by: Sam James  gentoo.org>

 ...ce-seq-for-portability-with-GNU-Make-vari.patch |   72 +
 ...l_Remove-DEFAULT_MATCHPD_PARTITIONS-macro.patch |   72 +
 in-Make-TM_P_H-depend-on-TREE_H-PR111021.patch |   66 +
 ...in-Make-recog.h-depend-on-TREE_H-PR111021.patch |   44 +
 ...genemit-Split-insn-emit.cc-into-ten-files.patch | 1376 
 13.2.0/gentoo/README.history   |8 +
 6 files changed, 1638 insertions(+)

diff --git 
a/13.2.0/gentoo/86_all_build-Replace-seq-for-portability-with-GNU-Make-vari.patch
 
b/13.2.0/gentoo/86_all_build-Replace-seq-for-portability-with-GNU-Make-vari.patch
new file mode 100644
index 000..9b88852
--- /dev/null
+++ 
b/13.2.0/gentoo/86_all_build-Replace-seq-for-portability-with-GNU-Make-vari.patch
@@ -0,0 +1,72 @@
+https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=319aef8d2fde32be5cfed99f321c7f90e33d1f1d
+
+From 3fd5922104168eb1a88ee6209d84ccc9e72a4bfa Mon Sep 17 00:00:00 2001
+From: Jakub Jelinek 
+Date: Sat, 6 May 2023 02:32:17 +0200
+Subject: [PATCH 1/6] build: Replace seq for portability with GNU Make variant
+
+Some hosts like AIX don't have seq command, this patch replaces it
+with something that uses just GNU make features we've been using
+for this already before for the parallel make check.
+
+2023-05-06  Jakub Jelinek  
+
+   * Makefile.in (check_p_numbers): Rename to one_to_, move
+   earlier with helper variables also renamed.
+   (MATCH_SPLUT_SEQ): Use $(wordlist 1,$(NUM_MATCH_SPLITS),$(one_to_))
+   instead of $(shell seq 1 $(NUM_MATCH_SPLITS)).
+   (check_p_subdirs): Use $(one_to_) instead of $(check_p_numbers).
+
+(cherry picked from commit 319aef8d2fde32be5cfed99f321c7f90e33d1f1d)
+---
+ gcc/Makefile.in | 22 --
+ 1 file changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index fe3af5c8008..975fbb61ea8 100644
+--- a/gcc/Makefile.in
 b/gcc/Makefile.in
+@@ -214,9 +214,19 @@ rtl-ssa-warn = $(STRICT_WARN)
+ GCC_WARN_CFLAGS = $(LOOSE_WARN) $(C_LOOSE_WARN) $($(@D)-warn) $(if 
$(filter-out $(STRICT_WARN),$($(@D)-warn)),,$(C_STRICT_WARN)) $(NOCOMMON_FLAG) 
$($@-warn)
+ GCC_WARN_CXXFLAGS = $(LOOSE_WARN) $($(@D)-warn) $(NOCOMMON_FLAG) $($@-warn)
+ 
++# 1 2 3 ... 
++one_to__0:=1 2 3 4 5 6 7 8 9
++one_to__1:=0 $(one_to__0)
++one_to__2:=$(foreach i,$(one_to__0),$(addprefix 
$(i),$(one_to__1)))
++one_to__3:=$(addprefix 0,$(one_to__1)) $(one_to__2)
++one_to__4:=$(foreach i,$(one_to__0),$(addprefix 
$(i),$(one_to__3)))
++one_to__5:=$(addprefix 0,$(one_to__3)) $(one_to__4)
++one_to__6:=$(foreach i,$(one_to__0),$(addprefix 
$(i),$(one_to__5)))
++one_to_:=$(one_to__0) $(one_to__2) $(one_to__4) 
$(one_to__6)
++
+ # The number of splits to be made for the match.pd files.
+ NUM_MATCH_SPLITS = @DEFAULT_MATCHPD_PARTITIONS@
+-MATCH_SPLITS_SEQ = $(shell seq 1 $(NUM_MATCH_SPLITS))
++MATCH_SPLITS_SEQ = $(wordlist 1,$(NUM_MATCH_SPLITS),$(one_to_))
+ GIMPLE_MATCH_PD_SEQ_SRC = $(patsubst %, gimple-match-%.cc, 
$(MATCH_SPLITS_SEQ))
+ GIMPLE_MATCH_PD_SEQ_O = $(patsubst %, gimple-match-%.o, $(MATCH_SPLITS_SEQ))
+ GENERIC_MATCH_PD_SEQ_SRC = $(patsubst %, generic-match-%.cc, 
$(MATCH_SPLITS_SEQ))
+@@ -4220,18 +4230,10 @@ $(patsubst %,%-subtargets,$(lang_checks)): 
check-%-subtargets:
+ check_p_tool=$(firstword $(subst _, ,$*))
+ check_p_count=$(check_$(check_p_tool)_parallelize)
+ check_p_subno=$(word 2,$(subst _, ,$*))
+-check_p_numbers0:=1 2 3 4 5 6 7 8 9
+-check_p_numbers1:=0 $(check_p_numbers0)
+-check_p_numbers2:=$(foreach i,$(check_p_numbers0),$(addprefix 
$(i),$(check_p_numbers1)))
+-check_p_numbers3:=$(addprefix 0,$(check_p_numbers1)) $(check_p_numbers2)
+-check_p_numbers4:=$(foreach i,$(check_p_numbers0),$(addprefix 
$(i),$(check_p_numbers3)))
+-check_p_numbers5:=$(addprefix 0,$(check_p_numbers3)) $(check_p_numbers4)
+-check_p_numbers6:=$(foreach i,$(check_p_numbers0),$(addprefix 
$(i),$(check_p_numbers5)))
+-check_p_numbers:=$(check_p_numbers0) $(check_p_numbers2) $(check_p_numbers4) 
$(check_p_numbers6)
+ check_p_subdir=$(subst _,,$*)
+ check_p_subdirs=$(wordlist 1,$(check_p_count),$(wordlist 1, \
+   $(if 
$(GCC_TEST_PARALLEL_SLOTS),$(GCC_TEST_PARALLEL_SLOTS),128), \
+-   

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-11-29 Thread Sam James
commit: 27a129d42cd0e4a96d591d5ccadf5d220f441e06
Author: Sam James  gentoo  org>
AuthorDate: Wed Nov 29 20:15:37 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Nov 29 20:15:49 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=27a129d4

13.2.0: rebase patches

U 76_all_match.pd-don-t-emit-label-if-not-needed.patch
U 77_all_match.pd-Remove-commented-out-line-pragmas-unless-vv.patch
U 78_all_match.pd-CSE-the-dump-output-check.patch
U 79_all_genmatch-split-shared-code-to-gimple-match-exports.c.patch
U 80_all_match.pd-automatically-partition-match.cc-files.patch
U 81_all_match.pd-Use-splits-in-makefile-and-make-configurabl.patch
+ 82_all_Makefile.in-clean-up-match.pd-related-dependencies.patch

Signed-off-by: Sam James  gentoo.org>

 ...l_match.pd-don-t-emit-label-if-not-needed.patch | 24 -
 ...move-commented-out-line-pragmas-unless-vv.patch | 10 ++--
 ...78_all_match.pd-CSE-the-dump-output-check.patch | 16 +++---
 ...lit-shared-code-to-gimple-match-exports.c.patch | 18 +++
 ...pd-automatically-partition-match.cc-files.patch | 36 ++---
 ...e-splits-in-makefile-and-make-configurabl.patch | 28 +-
 ...in-clean-up-match.pd-related-dependencies.patch | 60 ++
 13.2.0/gentoo/README.history   | 10 
 8 files changed, 136 insertions(+), 66 deletions(-)

diff --git a/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch 
b/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch
index ac9efe6..9d702eb 100644
--- a/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch
+++ b/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch
@@ -1,9 +1,9 @@
 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21
 
-From 6894f8e1fafe211a5f14ecbb534c92c2b78beb3a Mon Sep 17 00:00:00 2001
+From 30f78d42a215686cab9c7276076f11e5ea08341d Mon Sep 17 00:00:00 2001
 From: Tamar Christina 
 Date: Fri, 5 May 2023 13:35:17 +0100
-Subject: [PATCH 1/6] match.pd: don't emit label if not needed
+Subject: [PATCH 02/14] match.pd: don't emit label if not needed
 
 This is a small QoL codegen improvement for match.pd to not emit labels when
 they are not needed.  The codegen is nice and there is a small (but consistent)
@@ -20,10 +20,10 @@ gcc/ChangeLog:
  1 file changed, 22 insertions(+), 8 deletions(-)
 
 diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
-index 4fab4135347..638606b2502 100644
+index 98b429a9d0bb..0c5a19aca8ed 100644
 --- a/gcc/genmatch.cc
 +++ b/gcc/genmatch.cc
-@@ -3352,6 +3352,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+@@ -3354,6 +3354,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
char local_fail_label[256];
snprintf (local_fail_label, 256, "next_after_fail%u", ++fail_label_cnt);
fail_label = local_fail_label;
@@ -31,7 +31,7 @@ index 4fab4135347..638606b2502 100644
  
/* Analyze captures and perform early-outs on the incoming arguments
   that cover cases we cannot handle.  */
-@@ -3366,6 +3367,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+@@ -3368,6 +3369,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
fprintf_indent (f, indent,
"if (TREE_SIDE_EFFECTS (_p%d)) goto %s;\n",
i, fail_label);
@@ -39,7 +39,7 @@ index 4fab4135347..638606b2502 100644
if (verbose >= 1)
  warning_at (as_a  (s->match)->ops[i]->location,
  "forcing toplevel operand to have no "
-@@ -3381,6 +3383,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+@@ -3383,6 +3385,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
fprintf_indent (f, indent,
"if (TREE_SIDE_EFFECTS (captures[%d])) "
"goto %s;\n", i, fail_label);
@@ -47,7 +47,7 @@ index 4fab4135347..638606b2502 100644
if (verbose >= 1)
  warning_at (cinfo.info[i].c->location,
  "forcing captured operand to have no "
-@@ -3423,7 +3426,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+@@ -3425,7 +3428,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
  }
  
if (s->kind == simplify::SIMPLIFY)
@@ -59,7 +59,7 @@ index 4fab4135347..638606b2502 100644
  
fprintf_indent (f, indent, "if (UNLIKELY (dump_file && (dump_flags & 
TDF_FOLDING))) "
   "fprintf (dump_file, \"%s ",
-@@ -3496,9 +3502,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+@@ -3498,9 +3504,12 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
  "res_op->resimplify (%s, valueize);\n",
  !e->force_leaf ? "lseq" : "NULL");
  if (

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-11-29 Thread Sam James
commit: 1e31431a93ba11e6905e7914a9e470b4a3e928ec
Author: Sam James  gentoo  org>
AuthorDate: Wed Nov 29 20:24:57 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Nov 29 20:24:57 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=1e31431a

13.2.0: rebase patches

Signed-off-by: Sam James  gentoo.org>

 ...l_Remove-DEFAULT_MATCHPD_PARTITIONS-macro.patch | 24 ++--
 in-Make-TM_P_H-depend-on-TREE_H-PR111021.patch |  8 +++
 ...in-Make-recog.h-depend-on-TREE_H-PR111021.patch |  9 
 ...genemit-Split-insn-emit.cc-into-ten-files.patch | 26 +++---
 13.2.0/gentoo/README.history   |  4 
 5 files changed, 38 insertions(+), 33 deletions(-)

diff --git a/13.2.0/gentoo/87_all_Remove-DEFAULT_MATCHPD_PARTITIONS-macro.patch 
b/13.2.0/gentoo/87_all_Remove-DEFAULT_MATCHPD_PARTITIONS-macro.patch
index 5cbeb48..5e6a81d 100644
--- a/13.2.0/gentoo/87_all_Remove-DEFAULT_MATCHPD_PARTITIONS-macro.patch
+++ b/13.2.0/gentoo/87_all_Remove-DEFAULT_MATCHPD_PARTITIONS-macro.patch
@@ -1,9 +1,9 @@
 
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=bc45e18d433f879a02e369d027829f90f9e85724
 
-From f68becb26d43428a8e35ff2528c2bce719a7bb0a Mon Sep 17 00:00:00 2001
+From e351a8c9975b93e3e98e52342cb77b6a2969257f Mon Sep 17 00:00:00 2001
 From: Tamar Christina 
 Date: Mon, 12 Jun 2023 14:06:08 +0100
-Subject: [PATCH 2/6] Remove DEFAULT_MATCHPD_PARTITIONS macro
+Subject: [PATCH 10/14] Remove DEFAULT_MATCHPD_PARTITIONS macro
 
 As Jakub pointed out, DEFAULT_MATCHPD_PARTITIONS
 is now unused and can be removed.
@@ -21,10 +21,10 @@ gcc/ChangeLog:
  2 files changed, 2 insertions(+), 9 deletions(-)
 
 diff --git a/gcc/configure b/gcc/configure
-index 843fd5449dd..3750f77fd03 100755
+index 2c124f1b0337..61c18a13ab7b 100755
 --- a/gcc/configure
 +++ b/gcc/configure
-@@ -7908,11 +7908,6 @@ if (test $DEFAULT_MATCHPD_PARTITIONS -lt 1); then
+@@ -7914,11 +7914,6 @@ if (test $DEFAULT_MATCHPD_PARTITIONS -lt 1); then
  fi
  
  
@@ -36,26 +36,26 @@ index 843fd5449dd..3750f77fd03 100755
  
  # Enable __cxa_atexit for C++.
  # Check whether --enable-__cxa_atexit was given.
-@@ -19850,7 +19845,7 @@ else
+@@ -19873,7 +19868,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
--#line 19853 "configure"
-+#line 19848 "configure"
+-#line 19876 "configure"
++#line 19871 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
-@@ -19956,7 +19951,7 @@ else
+@@ -19979,7 +19974,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
--#line 19959 "configure"
-+#line 19954 "configure"
+-#line 19982 "configure"
++#line 19977 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
 diff --git a/gcc/configure.ac b/gcc/configure.ac
-index de5e3aef2c8..7f8aa5329c7 100644
+index 526ce0665a3e..c15b65367419 100644
 --- a/gcc/configure.ac
 +++ b/gcc/configure.ac
 @@ -932,8 +932,6 @@ if (test $DEFAULT_MATCHPD_PARTITIONS -lt 1); then
@@ -68,5 +68,5 @@ index de5e3aef2c8..7f8aa5329c7 100644
  
  # Enable __cxa_atexit for C++.
 -- 
-2.42.0
+2.43.0
 

diff --git 
a/13.2.0/gentoo/88_all_Makefile.in-Make-TM_P_H-depend-on-TREE_H-PR111021.patch 
b/13.2.0/gentoo/88_all_Makefile.in-Make-TM_P_H-depend-on-TREE_H-PR111021.patch
index bd738cb..aa6a0f3 100644
--- 
a/13.2.0/gentoo/88_all_Makefile.in-Make-TM_P_H-depend-on-TREE_H-PR111021.patch
+++ 
b/13.2.0/gentoo/88_all_Makefile.in-Make-TM_P_H-depend-on-TREE_H-PR111021.patch
@@ -1,9 +1,9 @@
 
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=8353b9c5f5af0e65cb04fcbb7325d6a566006cd4
 
-From c60ffbdd0b7bee758672d66187b65eaf1a59d4a1 Mon Sep 17 00:00:00 2001
+From f9139ea69c23448a874cbb64c2d201cf9f7ece2f Mon Sep 17 00:00:00 2001
 From: Kewen Lin 
 Date: Fri, 18 Aug 2023 05:03:40 -0500
-Subject: [PATCH 4/6] Makefile.in: Make TM_P_H depend on $(TREE_H) [PR111021]
+Subject: [PATCH 12/14] Makefile.in: Make TM_P_H depend on $(TREE_H) [PR111021]
 
 As PR111021 shows, the below ${port}-protos.h include tree.h
 for code_helper and tree_code:
@@ -48,7 +48,7 @@ gcc/ChangeLog:
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/gcc/Makefile.in b/gcc/Makefile.in
-index 975fbb61ea8..115d2a6d9b7 100644
+index 975fbb61ea8a..115d2a6d9b76 100644
 --- a/gcc/Makefile.in
 +++ b/gcc/Makefile.in
 @@ -886,7 +886,8 @@ OPTIONS_C_EXTRA = $(PRETTY_PRINT_H)
@@ -62,5 +62,5 @@ index 975fbb61ea8..115d2a6d9b7 100644
  GTM_H = tm.h  $(tm_file_list) insn-constants.h
  TM_H  = $(GTM_H) insn-flags.h $(OPTIONS_H)
 -- 
-2.42.0
+2.43.0
 

diff --git 
a/13.2.0/gentoo/89_all_Makefile.in-Make-recog.h-depend-on-TREE_H-PR111021.patch 
b/13.2.0/gentoo/89_all_Makefile.in-Make-recog.h-depend-on-TREE_H-PR111021.patch
index 7254215..330503a 100644
--- 
a/13.2.0/gentoo/89_all_Makefile.in-Make-recog.h-depend-on-TREE_H-PR111021.patch
+++ 
b/13.2.0/gentoo/89_all_Makefile.in-Make-recog.h-depend-on-TREE_H-PR111021.pa

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-05-25 Thread Sam James
commit: 7a6b2d23ec02e75475a6123254ccd44d73827f39
Author: Sam James  gentoo  org>
AuthorDate: Fri May 26 02:26:36 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Fri May 26 02:26:36 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7a6b2d23

13.2.0: backport split match.pd changes

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21.

This should improve (reduce) the peak RAM usage when building GCC as it builds
gimple-match in smaller chunks (previously was one huge generated file) as well
as speeding up parallel build when used.

i.e. This has benefits for both people building on constrained hardware (because
-j1 is more effective and just means each smaller chunk is built one-at-a-time,
not the massive blob) and also for people building with many jobs, as there's
one less synchronisation point so the build is less serial.

Motivated in particular by the upstream report (PR109927) of this being an issue
on m68k with RAM usage for the single GCC process building gimple-match.

(IIRC immolo and possibly dilfridge had mentioned similar issues when building
some arches in qemu as well.)

Note that upstream are planning on splitting insn-* as well so there are further
improvements in the pipeline (see PR54179, but discussion has occurred far more
recently on IRC about this and tamar is likely to look at it.).

Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54179 (old bug for splitting 
insn-*, will be revisited)
Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84402 (tracker bug for 
parallelisation, interesting discussion)
Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927
Bug: https://bugs.gentoo.org/891909 (not the same issue per-se but related to 
reduced resource usage)
Bug: https://bugs.gentoo.org/894256
Bug: https://bugs.gentoo.org/901317
Signed-off-by: Sam James  gentoo.org>

 ...l_match.pd-don-t-emit-label-if-not-needed.patch |  114 +
 ...move-commented-out-line-pragmas-unless-vv.patch |   41 +
 ...78_all_match.pd-CSE-the-dump-output-check.patch |   70 +
 ...lit-shared-code-to-gimple-match-exports.c.patch | 2560 
 ...pd-automatically-partition-match.cc-files.patch |  524 
 ...e-splits-in-makefile-and-make-configurabl.patch |  258 ++
 13.2.0/gentoo/README.history   |   10 +
 7 files changed, 3577 insertions(+)

diff --git a/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch 
b/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch
new file mode 100644
index 000..ac9efe6
--- /dev/null
+++ b/13.2.0/gentoo/76_all_match.pd-don-t-emit-label-if-not-needed.patch
@@ -0,0 +1,114 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109927#c21
+
+From 6894f8e1fafe211a5f14ecbb534c92c2b78beb3a Mon Sep 17 00:00:00 2001
+From: Tamar Christina 
+Date: Fri, 5 May 2023 13:35:17 +0100
+Subject: [PATCH 1/6] match.pd: don't emit label if not needed
+
+This is a small QoL codegen improvement for match.pd to not emit labels when
+they are not needed.  The codegen is nice and there is a small (but consistent)
+improvement in compile time.
+
+gcc/ChangeLog:
+
+   PR bootstrap/84402
+   * genmatch.cc (dt_simplify::gen_1): Only emit labels if used.
+
+(cherry picked from commit 580cda3c2799b1f8323af770e52f1eb0fa204718)
+---
+ gcc/genmatch.cc | 30 ++
+ 1 file changed, 22 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/genmatch.cc b/gcc/genmatch.cc
+index 4fab4135347..638606b2502 100644
+--- a/gcc/genmatch.cc
 b/gcc/genmatch.cc
+@@ -3352,6 +3352,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+   char local_fail_label[256];
+   snprintf (local_fail_label, 256, "next_after_fail%u", ++fail_label_cnt);
+   fail_label = local_fail_label;
++  bool needs_label = false;
+ 
+   /* Analyze captures and perform early-outs on the incoming arguments
+  that cover cases we cannot handle.  */
+@@ -3366,6 +3367,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+   fprintf_indent (f, indent,
+   "if (TREE_SIDE_EFFECTS (_p%d)) goto %s;\n",
+   i, fail_label);
++  needs_label = true;
+   if (verbose >= 1)
+ warning_at (as_a  (s->match)->ops[i]->location,
+ "forcing toplevel operand to have no "
+@@ -3381,6 +3383,7 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+   fprintf_indent (f, indent,
+   "if (TREE_SIDE_EFFECTS (captures[%d])) "
+   "goto %s;\n", i, fail_label);
++  needs_label = true;
+   if (verbose >= 1)
+ warning_at (cinfo.info[i].c->location,
+ "forcing captured operand to have no "
+@@ -3423,7 +3426,10 @@ dt_simplify::gen_1 (FILE *f, int indent, bool gimple, 
operand *result)
+ }
+ 
+   if (s->kind ==

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-08-05 Thread Sam James
commit: 78f6c61007a059d12df76503152c689f5c76dc03
Author: Sam James  gentoo  org>
AuthorDate: Sat Aug  5 22:53:05 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Aug  5 22:53:05 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=78f6c610

13.2: drop obsolete upstream patch (82_all_arm64_PR110280_ICE_fold-const.patch)

In latest snapshot.

Signed-off-by: Sam James  gentoo.org>

 .../82_all_arm64_PR110280_ICE_fold-const.patch | 53 --
 13.2.0/gentoo/README.history   |  3 ++
 2 files changed, 3 insertions(+), 53 deletions(-)

diff --git a/13.2.0/gentoo/82_all_arm64_PR110280_ICE_fold-const.patch 
b/13.2.0/gentoo/82_all_arm64_PR110280_ICE_fold-const.patch
deleted file mode 100644
index d27ca7a..000
--- a/13.2.0/gentoo/82_all_arm64_PR110280_ICE_fold-const.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110280
-https://inbox.sourceware.org/gcc-patches/nycvar.yfh.7.77.849.2307270634430.12...@jbgna.fhfr.qr/T/#t
-
-From 85d8e0d8d5342ec8b4e6a54e22741c30b33c6f04 Mon Sep 17 00:00:00 2001
-From: Prathamesh Kulkarni 
-Date: Fri, 23 Jun 2023 15:27:17 +0530
-Subject: [PATCH] [aarch64/match.pd] Fix ICE observed in PR110280.
-
-gcc/ChangeLog:
-   PR tree-optimization/110280
-   * match.pd (vec_perm_expr(v, v, mask) -> v): Explicitly build vector
-   using build_vector_from_val with the element of input operand, and
-   mask's type if operand and mask's types don't match.
-
-gcc/testsuite/ChangeLog:
-   PR tree-optimization/110280
-   * gcc.target/aarch64/sve/pr110280.c: New test.
-
-(cherry picked from commit 85d8e0d8d5342ec8b4e6a54e22741c30b33c6f04)
-
 a/gcc/match.pd
-+++ b/gcc/match.pd
-@@ -8292,7 +8292,14 @@ and,
- 
- (simplify
-  (vec_perm vec_same_elem_p@0 @0 @1)
-- @0)
-+ (if (types_match (type, TREE_TYPE (@0)))
-+  @0
-+  (with
-+   {
-+ tree elem = uniform_vector_p (@0);
-+   }
-+   (if (elem)
-+{ build_vector_from_val (type, elem); }
- 
- /* Push VEC_PERM earlier if that may help FMA perception (PR101895).  */
- (simplify
 /dev/null
-+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr110280.c
-@@ -0,0 +1,12 @@
-+/* { dg-do compile } */
-+/* { dg-options "-O3 -fdump-tree-optimized" } */
-+
-+#include "arm_sve.h"
-+
-+svuint32_t l()
-+{
-+  _Alignas(16) const unsigned int lanes[4] = {0, 0, 0, 0};
-+  return svld1rq_u32(svptrue_b8(), lanes);
-+}
-+
-+/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */

diff --git a/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index 998f555..769413a 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.history
@@ -1,3 +1,6 @@
+5  05 Aug 2023
+   - 82_all_arm64_PR110280_ICE_fold-const.patch
+
 4  30 Jul 2023
 
U 31_all_gm2_make_P_var.patch



[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-07-30 Thread Sam James
commit: 5d5b708b7e6f858c3fc2d6a421fb424225efdb04
Author: Sam James  gentoo  org>
AuthorDate: Sun Jul 30 17:30:47 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Jul 30 17:30:47 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5d5b708b

13.2.0: backport a few patches, cut patchset 4

Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110280
Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110315
Signed-off-by: Sam James  gentoo.org>

 13.2.0/gentoo/31_all_gm2_make_P_var.patch  |  16 +-
 .../82_all_arm64_PR110280_ICE_fold-const.patch |  53 
 ...3_all_all_PR110315_crash_large_std_vector.patch | 353 +
 13.2.0/gentoo/README.history   |   6 +
 4 files changed, 421 insertions(+), 7 deletions(-)

diff --git a/13.2.0/gentoo/31_all_gm2_make_P_var.patch 
b/13.2.0/gentoo/31_all_gm2_make_P_var.patch
index c977874..ef34288 100644
--- a/13.2.0/gentoo/31_all_gm2_make_P_var.patch
+++ b/13.2.0/gentoo/31_all_gm2_make_P_var.patch
@@ -1,8 +1,8 @@
 https://bugs.gentoo.org/904714
 
https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=79c73122fab213f218b85b2c579ffe3cf5e98ad0
 
-From 79c73122fab213f218b85b2c579ffe3cf5e98ad0 Mon Sep 17 00:00:00 2001
-From: =?utf8?q?Arsen=20Arsenovi=C4=87?= 
+From 275c516a40b7044895c4920f52ec19c7bceedd54 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= 
 Date: Fri, 21 Apr 2023 18:07:29 +0200
 Subject: [PATCH] gcc/m2: Drop references to $(P)
 
@@ -14,9 +14,11 @@ gcc/m2/ChangeLog:
 
* Make-lang.in: Remove references to $(P).
* Make-maintainer.in: Ditto.
+
+(cherry picked from commit 79c73122fab213f218b85b2c579ffe3cf5e98ad0)
 --- a/gcc/m2/Make-lang.in
 +++ b/gcc/m2/Make-lang.in
-@@ -514,7 +514,7 @@ GM2_LIBS_BOOT = m2/gm2-compiler-boot/gm2.a \
+@@ -515,7 +515,7 @@ GM2_LIBS_BOOT = m2/gm2-compiler-boot/gm2.a \
  cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) $(m2.prev)
cp -p $< $@
  
@@ -25,7 +27,7 @@ gcc/m2/ChangeLog:
  $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) $(GM2_LIBS) \
  m2/gm2-gcc/rtegraph.o plugin/m2rte$(soext)
-test -d $(@D) || $(mkinstalldirs) $(@D)
-@@ -527,7 +527,7 @@ m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) 
m2/gm2-compiler/m2flex.o $(
+@@ -528,7 +528,7 @@ m2/stage2/cc1gm2$(exeext): m2/stage1/cc1gm2$(exeext) 
m2/gm2-compiler/m2flex.o $(
@$(call LINK_PROGRESS,$(INDEX.m2),end)
  
  m2/stage1/cc1gm2$(exeext): gm2$(exeext) m2/gm2-compiler-boot/m2flex.o \
@@ -36,14 +38,14 @@ gcc/m2/ChangeLog:
  $(m2.prev)
 --- a/gcc/m2/Make-maintainer.in
 +++ b/gcc/m2/Make-maintainer.in
-@@ -753,7 +753,7 @@ GM2_LIBS_PARANOID = m2/gm2-compiler-paranoid/gm2.a \
+@@ -848,7 +848,7 @@ GM2_LIBS_PARANOID = m2/gm2-compiler-paranoid/gm2.a \
  gm2.paranoid: m2/m2obj3/cc1gm2$(exeext) gm2.verifyparanoid
  
  m2/m2obj3/cc1gm2$(exeext): m2/m2obj2/cc1gm2$(exeext) 
m2/gm2-compiler-paranoid/m2flex.o \
 -$(P) $(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) 
$(GM2_LIBS_PARANOID) \
 +$(GM2_C_OBJS) $(BACKEND) $(LIBDEPS) 
$(GM2_LIBS_PARANOID) \
- m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so 
m2/gm2-libs-boot/M2LINK.o
+ m2/gm2-gcc/rtegraph.o plugin/m2rte$(exeext).so
-test -d m2/m2obj3 || $(mkinstalldirs) m2/m2obj3
@$(call LINK_PROGRESS,$(INDEX.m2),start)
 -- 
-2.31.1
+2.41.0

diff --git a/13.2.0/gentoo/82_all_arm64_PR110280_ICE_fold-const.patch 
b/13.2.0/gentoo/82_all_arm64_PR110280_ICE_fold-const.patch
new file mode 100644
index 000..d27ca7a
--- /dev/null
+++ b/13.2.0/gentoo/82_all_arm64_PR110280_ICE_fold-const.patch
@@ -0,0 +1,53 @@
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110280
+https://inbox.sourceware.org/gcc-patches/nycvar.yfh.7.77.849.2307270634430.12...@jbgna.fhfr.qr/T/#t
+
+From 85d8e0d8d5342ec8b4e6a54e22741c30b33c6f04 Mon Sep 17 00:00:00 2001
+From: Prathamesh Kulkarni 
+Date: Fri, 23 Jun 2023 15:27:17 +0530
+Subject: [PATCH] [aarch64/match.pd] Fix ICE observed in PR110280.
+
+gcc/ChangeLog:
+   PR tree-optimization/110280
+   * match.pd (vec_perm_expr(v, v, mask) -> v): Explicitly build vector
+   using build_vector_from_val with the element of input operand, and
+   mask's type if operand and mask's types don't match.
+
+gcc/testsuite/ChangeLog:
+   PR tree-optimization/110280
+   * gcc.target/aarch64/sve/pr110280.c: New test.
+
+(cherry picked from commit 85d8e0d8d5342ec8b4e6a54e22741c30b33c6f04)
+
+--- a/gcc/match.pd
 b/gcc/match.pd
+@@ -8292,7 +8292,14 @@ and,
+ 
+ (simplify
+  (vec_perm vec_same_elem_p@0 @0 @1)
+- @0)
++ (if (types_match (type, TREE_TYPE (@0)))
++  @0
++  (with
++   {
++ tree elem = uniform_vector_p (@0);
++   }
++   (if (elem)
++{ build_vector_from_val (type, elem); }
+ 
+ /* Push VEC_PERM earlier if that may help FMA perception (PR101895).  */
+ (simplify
+--- /dev/null
 b/gcc/test

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-08-12 Thread Sam James
commit: 7b28599cfed98fc831c16f1b528f15fd99011dae
Author: Sam James  gentoo  org>
AuthorDate: Sun Aug 13 00:20:39 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sun Aug 13 00:20:39 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7b28599c

13.2.0: add patch for Botan miscompilation

Bug: https://github.com/randombit/botan/issues/3637
Bug: https://gcc.gnu.org/PR110792
Signed-off-by: Sam James  gentoo.org>

 ...110792-Early-clobber-issues-with-rot32di2.patch | 186 +
 13.2.0/gentoo/README.history   |   3 +
 2 files changed, 189 insertions(+)

diff --git 
a/13.2.0/gentoo/84_all_x86_PR110792-Early-clobber-issues-with-rot32di2.patch 
b/13.2.0/gentoo/84_all_x86_PR110792-Early-clobber-issues-with-rot32di2.patch
new file mode 100644
index 000..e3c09cc
--- /dev/null
+++ b/13.2.0/gentoo/84_all_x86_PR110792-Early-clobber-issues-with-rot32di2.patch
@@ -0,0 +1,186 @@
+https://gcc.gnu.org/PR110792
+https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=790c1f60a5662b16eb19eb4b81922995863c7571
+https://github.com/randombit/botan/issues/3637
+
+From 85628c5653ff40963158a24c60eeec6a3b5a8e56 Mon Sep 17 00:00:00 2001
+From: Roger Sayle 
+Date: Thu, 3 Aug 2023 07:12:04 +0100
+Subject: [PATCH] PR target/110792: Early clobber issues with
+ rot32di2_doubleword on i386.
+
+This patch is a conservative fix for PR target/110792, a wrong-code
+regression affecting doubleword rotations by BITS_PER_WORD, which
+effectively swaps the highpart and lowpart words, when the source to be
+rotated resides in memory. The issue is that if the register used to
+hold the lowpart of the destination is mentioned in the address of
+the memory operand, the current define_insn_and_split unintentionally
+clobbers it before reading the highpart.
+
+Hence, for the testcase, the incorrectly generated code looks like:
+
+salq$4, %rdi   // calculate address
+movqWHIRL_S+8(%rdi), %rdi  // accidentally clobber addr
+movqWHIRL_S(%rdi), %rbp// load (wrong) lowpart
+
+Traditionally, the textbook way to fix this would be to add an
+explicit early clobber to the instruction's constraints.
+
+ (define_insn_and_split "32di2_doubleword"
+- [(set (match_operand:DI 0 "register_operand" "=r,r,r")
++ [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
+(any_rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0,r,o")
+   (const_int 32)))]
+
+but unfortunately this currently generates significantly worse code,
+due to a strange choice of reloads (effectively memcpy), which ends up
+looking like:
+
+salq$4, %rdi   // calculate address
+movdqa  WHIRL_S(%rdi), %xmm0   // load the double word in SSE reg.
+movaps  %xmm0, -16(%rsp)   // store the SSE reg back to the stack
+movq-8(%rsp), %rdi // load highpart
+movq-16(%rsp), %rbp// load lowpart
+
+Note that reload's "&" doesn't distinguish between the memory being
+early clobbered, vs the registers used in an addressing mode being
+early clobbered.
+
+The fix proposed in this patch is to remove the third alternative, that
+allowed offsetable memory as an operand, forcing reload to place the
+operand into a register before the rotation.  This results in:
+
+salq$4, %rdi
+movqWHIRL_S(%rdi), %rax
+movqWHIRL_S+8(%rdi), %rdi
+movq%rax, %rbp
+
+I believe there's a more advanced solution, by swapping the order of
+the loads (if first destination register is mentioned in the address),
+or inserting a lea insn (if both destination registers are mentioned
+in the address), but this fix is a minimal "safe" solution, that
+should hopefully be suitable for backporting.
+
+2023-08-03  Roger Sayle  
+
+gcc/ChangeLog
+   PR target/110792
+   * config/i386/i386.md (ti3): For rotations by 64 bits
+   place operand in a register before gen_64ti2_doubleword.
+   (di3): Likewise, for rotations by 32 bits, place
+   operand in a register before gen_32di2_doubleword.
+   (32di2_doubleword): Constrain operand to be in register.
+   (64ti2_doubleword): Likewise.
+
+gcc/testsuite/ChangeLog
+   PR target/110792
+   * g++.target/i386/pr110792.C: New 32-bit C++ test case.
+   * gcc.target/i386/pr110792.c: New 64-bit C test case.
+
+(cherry picked from commit 790c1f60a5662b16eb19eb4b81922995863c7571)
+---
+ gcc/config/i386/i386.md  | 18 --
+ gcc/testsuite/g++.target/i386/pr110792.C | 16 
+ gcc/testsuite/gcc.target/i386/pr110792.c | 18 ++
+ 3 files changed, 46 insertions(+), 6 deletions(-)
+ create mode 100644 gcc/testsuite/g++.target/i386/pr110792.C
+ create mode 100644 gcc/testsuite/gcc.target/i386/pr110792.c
+
+diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
+index f3a3305..a71e837 100644
+--- a/gcc/config/i386/i386.md
 b/gcc/con

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-08-14 Thread Sam James
commit: d0b55776a4e1d2f293db5ba0e4a04aefed055ec4
Author: Sam James  gentoo  org>
AuthorDate: Sun Aug 13 00:37:58 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Mon Aug 14 09:30:03 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d0b55776

13.2.0: add extra trivial test fix

Signed-off-by: Sam James  gentoo.org>

 ...y-clobber-issues-with-rot32di2-test-fixup.patch | 39 ++
 13.2.0/gentoo/README.history   |  3 ++
 2 files changed, 42 insertions(+)

diff --git 
a/13.2.0/gentoo/85_all_x86_PR110792-Early-clobber-issues-with-rot32di2-test-fixup.patch
 
b/13.2.0/gentoo/85_all_x86_PR110792-Early-clobber-issues-with-rot32di2-test-fixup.patch
new file mode 100644
index 000..059f68c
--- /dev/null
+++ 
b/13.2.0/gentoo/85_all_x86_PR110792-Early-clobber-issues-with-rot32di2-test-fixup.patch
@@ -0,0 +1,39 @@
+From 529909f9e92dd3b0ed0383f45a44d2b5f8a58958 Mon Sep 17 00:00:00 2001
+From: Roger Sayle 
+Date: Sun, 6 Aug 2023 23:19:10 +0100
+Subject: [PATCH] [Committed] Avoid FAIL of gcc.target/i386/pr110792.c
+
+My apologies (again), I managed to mess up the 64-bit version of the
+test case for PR 110792.  Unlike the 32-bit version, the 64-bit case
+contains exactly the same load instructions, just in a different order
+making the correct and incorrect behaviours impossible to distinguish
+with a scan-assembler-not.  Somewhere between checking that this test
+failed in a clean tree without the patch, and getting the escaping
+correct, I'd failed to notice that this also FAILs in the patched tree.
+Doh!  Instead of removing the test completely, I've left it as a
+compilation test.
+
+The original fix is tested by the 32-bit test case.
+
+Committed to mainline as obvious.  Sorry for the incovenience.
+
+2023-08-06  Roger Sayle  
+
+gcc/testsuite/ChangeLog
+   PR target/110792
+   * gcc.target/i386/pr110792.c: Remove dg-final scan-assembler-not.
+---
+ gcc/testsuite/gcc.target/i386/pr110792.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/gcc/testsuite/gcc.target/i386/pr110792.c 
b/gcc/testsuite/gcc.target/i386/pr110792.c
+index b65125c48b62..eea4e1877dbb 100644
+--- a/gcc/testsuite/gcc.target/i386/pr110792.c
 b/gcc/testsuite/gcc.target/i386/pr110792.c
+@@ -15,4 +15,3 @@ unsigned __int128 whirl(unsigned char x0)
+asm("":::"memory");
+return tt;
+ }
+-/* { dg-final { scan-assembler-not "movq\tWHIRL_S\\+8\\(%rdi\\), %rdi" } } */
+-- 
+2.39.3

diff --git a/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index 2f1fc73..24a8367 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.history
@@ -1,3 +1,6 @@
+7  13 Aug 2023
+   + 
85_all_x86_PR110792-Early-clobber-issues-with-rot32di2-test-fixup.patch
+
 6  13 Aug 2023
+ 84_all_x86_PR110792-Early-clobber-issues-with-rot32di2.patch
 



[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-04-26 Thread Sam James
commit: 28d2380b495e99daca3b01ca9e6a73a623a2f3d2
Author: Sam James  gentoo  org>
AuthorDate: Wed Apr 26 20:38:52 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Apr 26 20:38:52 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=28d2380b

13.2.0: drop upstream patches

We only put them in here to include in 13.1.0-r1. They're already on 
releases/gcc-13.

Signed-off-by: Sam James  gentoo.org>

 ...573_13_ICE-in-vectorizable_live_operation.patch | 134 -
 ...l_all_PR109585_13_rtl-alias-analysis-typo.patch |  68 ---
 .../77_all_all_PR109609_13_tail-call-fnspec.patch  | 105 
 3 files changed, 307 deletions(-)

diff --git 
a/13.2.0/gentoo/75_all_all_PR109573_13_ICE-in-vectorizable_live_operation.patch 
b/13.2.0/gentoo/75_all_all_PR109573_13_ICE-in-vectorizable_live_operation.patch
deleted file mode 100644
index 31abade..000
--- 
a/13.2.0/gentoo/75_all_all_PR109573_13_ICE-in-vectorizable_live_operation.patch
+++ /dev/null
@@ -1,134 +0,0 @@
-https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=263d1ed0484fc81d3f93e39cdd2f9eb0ce4d3e88
-https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109573
-https://bugs.gentoo.org/904455
-
-kFrom 263d1ed0484fc81d3f93e39cdd2f9eb0ce4d3e88 Mon Sep 17 00:00:00 2001
-From: Richard Biener 
-Date: Fri, 21 Apr 2023 12:57:17 +0200
-Subject: [PATCH] tree-optimization/109573 - avoid ICEing on unexpected live
- def
-
-The following relaxes the assert in vectorizable_live_operation
-where we catch currently unhandled cases to also allow an
-intermediate copy as it happens here but also relax the assert
-to checking only.
-
-   PR tree-optimization/109573
-   * tree-vect-loop.cc (vectorizable_live_operation): Allow
-   unhandled SSA copy as well.  Demote assert to checking only.
-
-   * g++.dg/vect/pr109573.cc: New testcase.
-
-(cherry picked from commit cddfe6bc40b3dc0806e260bbfb4cac82d609a258)
 /dev/null
-+++ b/gcc/testsuite/g++.dg/vect/pr109573.cc
-@@ -0,0 +1,91 @@
-+// { dg-do compile }
-+// { dg-require-effective-target c++20 }
-+
-+void *operator new(__SIZE_TYPE__, void *__p) { return __p; }
-+template  struct _Head_base {
-+  _Head _M_head_impl;
-+};
-+template  struct _Tuple_impl;
-+template 
-+struct _Tuple_impl<_Idx, _Head, _Tail...> : _Tuple_impl<_Idx + 1, _Tail...>,
-+_Head_base<_Head> {
-+  template 
-+  _Tuple_impl(_UHead __head, _UTail... __tail)
-+  : _Tuple_impl<_Idx + 1, _Tail...>(__tail...), _Head_base<_Head>(__head) 
{}
-+};
-+template  struct _Tuple_impl<_Idx, _Head> 
{
-+  template  _Tuple_impl(_UHead);
-+};
-+template  struct tuple : _Tuple_impl<0, _Elements...> {
-+  template 
-+  tuple(_UElements... __elements)
-+  : _Tuple_impl<0, _Elements...>(__elements...) {}
-+};
-+unsigned long position_;
-+struct Zone {
-+  template  T *New(Args... args) {
-+return new (reinterpret_cast(position_)) T(args...);
-+  }
-+};
-+struct Label {
-+  int pos_;
-+  int near_link_pos_;
-+};
-+enum Condition { below_equal };
-+void bind(Label *);
-+Zone *zone();
-+unsigned long deopt_info_address();
-+int MakeDeferredCode___trans_tmp_2, MakeDeferredCode___trans_tmp_3,
-+Prologue___trans_tmp_6, MakeDeferredCode___trans_tmp_1;
-+struct MaglevAssembler {
-+  template 
-+  void MakeDeferredCode(Function &&, Args &&...);
-+  template 
-+  void JumpToDeferredIf(Condition, Function, Args... args) {
-+MakeDeferredCode(Function(), args...);
-+  }
-+  void Prologue();
-+};
-+struct ZoneLabelRef {
-+  ZoneLabelRef(Zone *zone) : label_(zone->New()) {}
-+  ZoneLabelRef(MaglevAssembler *) : ZoneLabelRef(zone()) {}
-+  Label *operator*() { return label_; }
-+  Label *label_;
-+};
-+template 
-+struct FunctionArgumentsTupleHelper
-+: FunctionArgumentsTupleHelper {};
-+template 
-+struct FunctionArgumentsTupleHelper {
-+  using Tuple = tuple;
-+};
-+template  struct StripFirstTupleArg;
-+template 
-+struct StripFirstTupleArg> {
-+  using Stripped = tuple;
-+};
-+template  struct DeferredCodeInfoImpl {
-+  template 
-+  DeferredCodeInfoImpl(int *, int, int, Function, InArgs... args)
-+  : args(args...) {}
-+  StripFirstTupleArg<
-+  typename FunctionArgumentsTupleHelper::Tuple>::Stripped args;
-+};
-+template 
-+void MaglevAssembler::MakeDeferredCode(Function &&deferred_code_gen,
-+   Args &&...args) {
-+  zone()->New>(
-+  &MakeDeferredCode___trans_tmp_1, MakeDeferredCode___trans_tmp_2,
-+  MakeDeferredCode___trans_tmp_3, deferred_code_gen, args...);
-+}
-+void MaglevAssembler::Prologue() {
-+  int *__trans_tmp_9;
-+  ZoneLabelRef deferred_call_stack_guard_return(this);
-+  __trans_tmp_9 = reinterpret_cast(deopt_info_address());
-+  JumpToDeferredIf(
-+  below_equal, [](MaglevAssembler, int *, ZoneLabelRef, int, int) {},
-+  __trans_tmp_9, deferred_call_stack_guard_return, Prologue___trans_tmp_6,
-+  0);
-+  Label __trans_tmp_7 = **deferred_call_stack_guard_return;
-+  b

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2023-04-29 Thread Sam James
commit: 490c1c096ca1d3a1f4a84801a46231d64c07ba49
Author: Sam James  gentoo  org>
AuthorDate: Sat Apr 29 22:41:36 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Apr 29 22:41:36 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=490c1c09

13.2.0: cut 2 patchset

Signed-off-by: Sam James  gentoo.org>

 13.2.0/gentoo/README.history | 5 +
 1 file changed, 5 insertions(+)

diff --git a/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index 1ae5deb..20af64a 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.history
@@ -1,3 +1,8 @@
+2  29 Apr 2023
+   - 75_all_all_PR109573_13_ICE-in-vectorizable_live_operation.patch
+   - 76_all_all_PR109585_13_rtl-alias-analysis-typo.patch
+   - 77_all_all_PR109609_13_tail-call-fnspec.patch
+
 1  26 April 2023
 
+ 01_all_default-fortify-source.patch



[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2024-06-08 Thread Sam James
commit: 87f98154a853bf66074d33365aa8b85900f2e857
Author: Sam James  gentoo  org>
AuthorDate: Sat Jun  8 16:58:26 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Sat Jun  8 16:58:58 2024 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=87f98154

13.2.0: add 93_all_ppc_PR97367-power7-cell-altivec.patch

Requested by ernsteiswuerfel.

Bug: https://gcc.gnu.org/PR97367
Signed-off-by: Sam James  gentoo.org>

 13.2.0/gentoo/93_all_ppc_PR97367-power7-cell-altivec.patch | 13 +
 13.2.0/gentoo/README.history   |  4 
 2 files changed, 17 insertions(+)

diff --git a/13.2.0/gentoo/93_all_ppc_PR97367-power7-cell-altivec.patch 
b/13.2.0/gentoo/93_all_ppc_PR97367-power7-cell-altivec.patch
new file mode 100644
index 000..154dd0f
--- /dev/null
+++ b/13.2.0/gentoo/93_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.r...@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/13.2.0/gentoo/README.history b/13.2.0/gentoo/README.history
index 9d31fc5..86a0fb1 100644
--- a/13.2.0/gentoo/README.history
+++ b/13.2.0/gentoo/README.history
@@ -1,3 +1,7 @@
+17 8 June 2024
+
+   + 93_all_ppc_PR97367-power7-cell-altivec.patch
+
 16 10 May 2024
 
- 84_all_x86_PR110792-Early-clobber-issues-with-rot32di2.patch



[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/

2024-05-10 Thread Sam James
commit: bc7d81fe2f725b4043ce8b9ffb11d80032ce3f75
Author: Sam James  gentoo  org>
AuthorDate: Fri May 10 22:47:32 2024 +
Commit: Sam James  gentoo  org>
CommitDate: Fri May 10 22:47:32 2024 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=bc7d81fe

13.2.0: drop obsolete patches backported upstream

Signed-off-by: Sam James  gentoo.org>

 ...110792-Early-clobber-issues-with-rot32di2.patch | 186 -
 ...y-clobber-issues-with-rot32di2-test-fixup.patch |  39 -
 13.2.0/gentoo/README.history   |   5 +
 3 files changed, 5 insertions(+), 225 deletions(-)

diff --git 
a/13.2.0/gentoo/84_all_x86_PR110792-Early-clobber-issues-with-rot32di2.patch 
b/13.2.0/gentoo/84_all_x86_PR110792-Early-clobber-issues-with-rot32di2.patch
deleted file mode 100644
index e3c09cc..000
--- a/13.2.0/gentoo/84_all_x86_PR110792-Early-clobber-issues-with-rot32di2.patch
+++ /dev/null
@@ -1,186 +0,0 @@
-https://gcc.gnu.org/PR110792
-https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=790c1f60a5662b16eb19eb4b81922995863c7571
-https://github.com/randombit/botan/issues/3637
-
-From 85628c5653ff40963158a24c60eeec6a3b5a8e56 Mon Sep 17 00:00:00 2001
-From: Roger Sayle 
-Date: Thu, 3 Aug 2023 07:12:04 +0100
-Subject: [PATCH] PR target/110792: Early clobber issues with
- rot32di2_doubleword on i386.
-
-This patch is a conservative fix for PR target/110792, a wrong-code
-regression affecting doubleword rotations by BITS_PER_WORD, which
-effectively swaps the highpart and lowpart words, when the source to be
-rotated resides in memory. The issue is that if the register used to
-hold the lowpart of the destination is mentioned in the address of
-the memory operand, the current define_insn_and_split unintentionally
-clobbers it before reading the highpart.
-
-Hence, for the testcase, the incorrectly generated code looks like:
-
-salq$4, %rdi   // calculate address
-movqWHIRL_S+8(%rdi), %rdi  // accidentally clobber addr
-movqWHIRL_S(%rdi), %rbp// load (wrong) lowpart
-
-Traditionally, the textbook way to fix this would be to add an
-explicit early clobber to the instruction's constraints.
-
- (define_insn_and_split "32di2_doubleword"
-- [(set (match_operand:DI 0 "register_operand" "=r,r,r")
-+ [(set (match_operand:DI 0 "register_operand" "=r,r,&r")
-(any_rotate:DI (match_operand:DI 1 "nonimmediate_operand" "0,r,o")
-   (const_int 32)))]
-
-but unfortunately this currently generates significantly worse code,
-due to a strange choice of reloads (effectively memcpy), which ends up
-looking like:
-
-salq$4, %rdi   // calculate address
-movdqa  WHIRL_S(%rdi), %xmm0   // load the double word in SSE reg.
-movaps  %xmm0, -16(%rsp)   // store the SSE reg back to the stack
-movq-8(%rsp), %rdi // load highpart
-movq-16(%rsp), %rbp// load lowpart
-
-Note that reload's "&" doesn't distinguish between the memory being
-early clobbered, vs the registers used in an addressing mode being
-early clobbered.
-
-The fix proposed in this patch is to remove the third alternative, that
-allowed offsetable memory as an operand, forcing reload to place the
-operand into a register before the rotation.  This results in:
-
-salq$4, %rdi
-movqWHIRL_S(%rdi), %rax
-movqWHIRL_S+8(%rdi), %rdi
-movq%rax, %rbp
-
-I believe there's a more advanced solution, by swapping the order of
-the loads (if first destination register is mentioned in the address),
-or inserting a lea insn (if both destination registers are mentioned
-in the address), but this fix is a minimal "safe" solution, that
-should hopefully be suitable for backporting.
-
-2023-08-03  Roger Sayle  
-
-gcc/ChangeLog
-   PR target/110792
-   * config/i386/i386.md (ti3): For rotations by 64 bits
-   place operand in a register before gen_64ti2_doubleword.
-   (di3): Likewise, for rotations by 32 bits, place
-   operand in a register before gen_32di2_doubleword.
-   (32di2_doubleword): Constrain operand to be in register.
-   (64ti2_doubleword): Likewise.
-
-gcc/testsuite/ChangeLog
-   PR target/110792
-   * g++.target/i386/pr110792.C: New 32-bit C++ test case.
-   * gcc.target/i386/pr110792.c: New 64-bit C test case.
-
-(cherry picked from commit 790c1f60a5662b16eb19eb4b81922995863c7571)

- gcc/config/i386/i386.md  | 18 --
- gcc/testsuite/g++.target/i386/pr110792.C | 16 
- gcc/testsuite/gcc.target/i386/pr110792.c | 18 ++
- 3 files changed, 46 insertions(+), 6 deletions(-)
- create mode 100644 gcc/testsuite/g++.target/i386/pr110792.C
- create mode 100644 gcc/testsuite/gcc.target/i386/pr110792.c
-
-diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
-index f3a3305..a71e837 100644
 a/gcc/config/i386/i386.md
-+++ b/gc

[gentoo-commits] proj/gcc-patches:master commit in: 13.2.0/gentoo/, 13.2.0/musl/

2023-04-26 Thread Sam James
commit: 7546d8be5a8ae93e81535644c2578807db276ab6
Author: Sam James  gentoo  org>
AuthorDate: Wed Apr 26 13:10:32 2023 +
Commit: Sam James  gentoo  org>
CommitDate: Wed Apr 26 13:11:21 2023 +
URL:https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7546d8be

13.2.0: add

Clone of 13.1.0 with:
+ 75_all_all_PR109573_13_ICE-in-vectorizable_live_operation.patch (ICE)
+ 76_all_all_PR109585_13_rtl-alias-analysis-typo.patch (miscompilation)
+ 77_all_all_PR109609_13_tail-call-fnspec.patch (miscompilation)

Signed-off-by: Sam James  gentoo.org>

 13.2.0/gentoo/01_all_default-fortify-source.patch  |  26 +++
 .../02_all_default-warn-format-security.patch  |  22 +++
 .../gentoo/03_all_default-warn-trampolines.patch   |  13 ++
 13.2.0/gentoo/04_all_nossp-on-nostdlib.patch   |  27 +++
 13.2.0/gentoo/05_all_alpha-mieee-default.patch |  39 +
 13.2.0/gentoo/06_all_ia64_note.GNU-stack.patch |  92 ++
 13.2.0/gentoo/07_all_libiberty-asprintf.patch  |  18 ++
 13.2.0/gentoo/08_all_libiberty-pic.patch   |  10 ++
 13.2.0/gentoo/09_all_nopie-all-flags.patch |  18 ++
 13.2.0/gentoo/10_all_sh-drop-sysroot-suffix.patch  |  26 +++
 13.2.0/gentoo/11_all_ia64-TEXTREL.patch|  22 +++
 13.2.0/gentoo/14_all_respect-build-cxxflags.patch  |  39 +
 .../15_all_DEF_GENTOO_GLIBCXX_ASSERTIONS.patch |  14 ++
 13.2.0/gentoo/20_all_libstdcxx-no-vtv.patch|  61 +++
 13.2.0/gentoo/22_all_default_ssp-buffer-size.patch |  14 ++
 13.2.0/gentoo/23_all_DEF_GENTOO_ZNOW-z-now.patch   |  26 +++
 ...ll_DEF_GENTOO_SCP-fstack-clash-protection.patch |  65 +++
 .../25_all_lto-intl-workaround-PR95194.patch   |  20 +++
 13.2.0/gentoo/26_all_enable-cet.patch  | 193 +
 13.2.0/gentoo/28_all_drop_CFLAGS_sed.patch |  35 
 13.2.0/gentoo/29_all_msgfmt-libstdc++-link.patch   |  39 +
 13.2.0/gentoo/30_all_tar_libstdc++-link.patch  |  57 ++
 13.2.0/gentoo/31_all_gm2_make_P_var.patch  |  49 ++
 ...573_13_ICE-in-vectorizable_live_operation.patch | 134 ++
 ...l_all_PR109585_13_rtl-alias-analysis-typo.patch |  68 
 .../77_all_all_PR109609_13_tail-call-fnspec.patch  | 105 +++
 13.2.0/gentoo/README.history   |  28 +++
 13.2.0/musl/25_all_multilib_pure64.patch   |  83 +
 13.2.0/musl/50_all_cpu_indicator.patch |  37 
 13.2.0/musl/50_all_libssp_unconditionally.patch|  24 +++
 13.2.0/musl/50_all_posix_memalign.patch|  28 +++
 13.2.0/musl/README.history |   6 +
 32 files changed, 1438 insertions(+)

diff --git a/13.2.0/gentoo/01_all_default-fortify-source.patch 
b/13.2.0/gentoo/01_all_default-fortify-source.patch
new file mode 100644
index 000..4cdf5f6
--- /dev/null
+++ b/13.2.0/gentoo/01_all_default-fortify-source.patch
@@ -0,0 +1,26 @@
+Taken Debian's patch and removed docs matches:
+https://salsa.debian.org/toolchain-team/gcc.git
+Also see https://bugs.gentoo.org/621036 where
+initially Gentoo used too complicated macro.
+
+# DP: Turn on -D_FORTIFY_SOURCE=2 by default for C, C++, ObjC, ObjC++,
+# DP: if the optimization level is > 0
+--- a/gcc/c-family/c-cppbuiltin.cc
 b/gcc/c-family/c-cppbuiltin.cc
+@@ -1510,6 +1510,16 @@ c_cpp_builtins (cpp_reader *pfile)
+   builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
+   builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
+ 
++#if !defined(ACCEL_COMPILER)
++  #ifndef GENTOO_FORTIFY_SOURCE_LEVEL
++#define GENTOO_FORTIFY_SOURCE_LEVEL 2
++  #endif
++
++  /* F_S enabled by default for optimization levels > 0, except for ASAN: 
https://github.com/google/sanitizers/issues/247 */
++  if (optimize && ! (flag_sanitize & SANITIZE_ADDRESS))
++builtin_define_with_int_value ("_FORTIFY_SOURCE", 
GENTOO_FORTIFY_SOURCE_LEVEL);
++#endif
++
+   /* Misc.  */
+   if (flag_gnu89_inline)
+ cpp_define (pfile, "__GNUC_GNU_INLINE__");

diff --git a/13.2.0/gentoo/02_all_default-warn-format-security.patch 
b/13.2.0/gentoo/02_all_default-warn-format-security.patch
new file mode 100644
index 000..9723a1c
--- /dev/null
+++ b/13.2.0/gentoo/02_all_default-warn-format-security.patch
@@ -0,0 +1,22 @@
+Enable -Wformat and -Wformat-security by default.
+
+--- a/gcc/c-family/c.opt
 b/gcc/c-family/c.opt
+@@ -696,7 +696,7 @@ Warn about function calls with format strings that write 
past the end
+ of the destination region.  Same as -Wformat-overflow=1.
+ 
+ Wformat-security
+-C ObjC C++ ObjC++ Var(warn_format_security) Warning LangEnabledBy(C ObjC C++ 
ObjC++,Wformat=, warn_format >= 2, 0)
++C ObjC C++ ObjC++ Var(warn_format_security) Init(1) Warning LangEnabledBy(C 
ObjC C++ ObjC++,Wformat=, warn_format >= 2, 0)
+ Warn about possible security problems with format functions.
+ 
+ Wformat-signedness
+@@ -717,7 +717,7 @@ C ObjC C++ ObjC++ Var(warn_format_zero_length) Warning 
LangEnabledBy(C ObjC C++
+ War