* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-07 2:45 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-10-07 2:45 UTC (permalink / raw
To: gentoo-commits
commit: 9a259e1746b11f94c3ccdeacb33bcc9ccfeb3f5f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 7 02:45:18 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 7 02:45:18 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9a259e17
15.0.0: cut patchset 15
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index f58b501..a6954a6 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-15 ????
+15 7 October 2024
- 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
- 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-04 10:37 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-10-04 10:37 UTC (permalink / raw
To: gentoo-commits
commit: fd69f7a88e4fa1dd773750c0ce7a31c20f452ce2
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 4 10:36:15 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 4 10:36:57 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=fd69f7a8
15.0.0: drop patches merged upstream
- 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
- 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
...erences-to-internal-linkage-vars-in-C-11-.patch | 96 ----------------------
...e-underlying-decl-rather-than-the-USING_D.patch | 76 -----------------
15.0.0/gentoo/README.history | 5 ++
3 files changed, 5 insertions(+), 172 deletions(-)
diff --git a/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch b/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
deleted file mode 100644
index 4e2f1f4..0000000
--- a/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
+++ /dev/null
@@ -1,96 +0,0 @@
-From 923bd335a44b1b556d705a7f1d36a2e9c06d9c5c Mon Sep 17 00:00:00 2001
-Message-ID: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
-From: Nathaniel Shead <nathanieloshead@gmail.com>
-Date: Fri, 4 Oct 2024 12:41:49 +1000
-Subject: [PATCH 1/2] c++: Allow references to internal-linkage vars in C++11
- [PR113266]
-
-[temp.arg.nontype] changed in C++11 to allow naming internal-linkage
-variables and functions. We currently already handle internal-linkage
-functions, but variables were missed; this patch updates this.
-
- PR c++/113266
- PR c++/116911
-
-gcc/cp/ChangeLog:
-
- * parser.cc (cp_parser_template_argument): Allow
- internal-linkage variables since C++11.
-
-gcc/testsuite/ChangeLog:
-
- * g++.dg/cpp0x/nontype6.C: New test.
-
-Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
----
- gcc/cp/parser.cc | 17 ++++++++++++-----
- gcc/testsuite/g++.dg/cpp0x/nontype6.C | 19 +++++++++++++++++++
- 2 files changed, 31 insertions(+), 5 deletions(-)
- create mode 100644 gcc/testsuite/g++.dg/cpp0x/nontype6.C
-
-diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
-index 08f9c89f1f0..e758ddeb1d5 100644
---- a/gcc/cp/parser.cc
-+++ b/gcc/cp/parser.cc
-@@ -19864,9 +19864,11 @@ cp_parser_template_argument (cp_parser* parser)
-
- -- the name of a non-type template-parameter; or
-
-- -- the name of an object or function with external linkage...
-+ -- the name of an object or function with external (or internal,
-+ since C++11) linkage...
-
-- -- the address of an object or function with external linkage...
-+ -- the address of an object or function with external (or internal,
-+ since C++11) linkage...
-
- -- a pointer to member... */
- /* Look for a non-type template parameter. */
-@@ -19929,11 +19931,16 @@ cp_parser_template_argument (cp_parser* parser)
- probe = TREE_OPERAND (probe, 1);
- if (VAR_P (probe))
- {
-- /* A variable without external linkage might still be a
-+ /* A variable without valid linkage might still be a
- valid constant-expression, so no error is issued here
- if the external-linkage check fails. */
-- if (!address_p && !DECL_EXTERNAL_LINKAGE_P (probe))
-- cp_parser_simulate_error (parser);
-+ if (!address_p && cxx_dialect < cxx17)
-+ {
-+ linkage_kind linkage = decl_linkage (probe);
-+ if (linkage != lk_external
-+ && (cxx_dialect < cxx11 || linkage != lk_internal))
-+ cp_parser_simulate_error (parser);
-+ }
- }
- else if (is_overloaded_fn (argument))
- /* All overloaded functions are allowed; if the external
-diff --git a/gcc/testsuite/g++.dg/cpp0x/nontype6.C b/gcc/testsuite/g++.dg/cpp0x/nontype6.C
-new file mode 100644
-index 00000000000..5543d1e8b6d
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/cpp0x/nontype6.C
-@@ -0,0 +1,19 @@
-+// PR c++/113266, PR c++/116911
-+// { dg-do compile }
-+
-+template <int &> struct a {};
-+static int guard1;
-+a<guard1> b; // { dg-error "constant-expression|invalid" "" { target c++98_only } }
-+
-+namespace {
-+ int guard2;
-+}
-+a<guard2> c; // OK in C++98 because guard2 has external linkage
-+ // OK since C++11 because we can refer to an internal linkage decl
-+
-+void nolinkage() {
-+ static int guard3;
-+ a<guard3> d; // { dg-error "constant-expression|invalid" "" { target c++98_only } }
-+ // { dg-error "constant expression|no linkage" "" { target { c++11 && c++14_down } } .-1 }
-+ // OK since C++17 since we can now refer to no-linkage decls
-+}
---
-2.46.2
-
diff --git a/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch b/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
deleted file mode 100644
index ab12bf6..0000000
--- a/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
+++ /dev/null
@@ -1,76 +0,0 @@
-From ba7c4e109fc589603911630deb2f19eba88bdbe8 Mon Sep 17 00:00:00 2001
-Message-ID: <ba7c4e109fc589603911630deb2f19eba88bdbe8.1728034006.git.sam@gentoo.org>
-In-Reply-To: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
-References: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
-From: Nathaniel Shead <nathanieloshead@gmail.com>
-Date: Fri, 4 Oct 2024 10:52:02 +1000
-Subject: [PATCH 2/2] c++: Return the underlying decl rather than the
- USING_DECL from update_binding [PR116913]
-
-Users of pushdecl assume that the returned decl will be a possibly
-updated decl matching the one that was passed in. My r15-3910 change
-broke this since in some cases we would now return USING_DECLs; this
-patch fixes the situation.
-
- PR c++/116913
-
-gcc/cp/ChangeLog:
-
- * name-lookup.cc (update_binding): Return the strip_using'd old
- decl rather than the binding.
-
-gcc/testsuite/ChangeLog:
-
- * g++.dg/lookup/using70.C: New test.
-
-Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
----
- gcc/cp/name-lookup.cc | 4 ++--
- gcc/testsuite/g++.dg/lookup/using70.C | 13 +++++++++++++
- 2 files changed, 15 insertions(+), 2 deletions(-)
- create mode 100644 gcc/testsuite/g++.dg/lookup/using70.C
-
-diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
-index 4754ef5a522..609bd6e8c9b 100644
---- a/gcc/cp/name-lookup.cc
-+++ b/gcc/cp/name-lookup.cc
-@@ -3101,7 +3101,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
- {
- if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl)))
- /* Two type decls to the same type. Do nothing. */
-- return old_bval;
-+ return old;
- else
- goto conflict;
- }
-@@ -3114,7 +3114,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
-
- /* The new one must be an alias at this point. */
- gcc_assert (DECL_NAMESPACE_ALIAS (decl));
-- return old_bval;
-+ return old;
- }
- else if (TREE_CODE (old) == VAR_DECL)
- {
-diff --git a/gcc/testsuite/g++.dg/lookup/using70.C b/gcc/testsuite/g++.dg/lookup/using70.C
-new file mode 100644
-index 00000000000..14838eea7ec
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/lookup/using70.C
-@@ -0,0 +1,13 @@
-+// PR c++/116913
-+// { dg-do compile { target c++11 } }
-+
-+namespace ns {
-+ struct c {};
-+ using d = int;
-+}
-+
-+using ns::c;
-+using ns::d;
-+
-+using c = ns::c;
-+using d = ns::d;
---
-2.46.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 2d85dc2..f58b501 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+15 ????
+
+ - 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
+ - 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
+
14 4 October 2024
- 70_all_middle-end-check-explicitly-for-external-or-constant.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-04 9:28 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-10-04 9:28 UTC (permalink / raw
To: gentoo-commits
commit: f44cf391c1dbacd2651298e2fb366905a5fe0a06
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 4 09:27:50 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 4 09:27:50 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=f44cf391
15.0.0: add two C++ patches
+ 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
+ 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
...erences-to-internal-linkage-vars-in-C-11-.patch | 96 ++++++++++++++++++++++
...e-underlying-decl-rather-than-the-USING_D.patch | 76 +++++++++++++++++
15.0.0/gentoo/README.history | 4 +-
3 files changed, 175 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch b/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
new file mode 100644
index 0000000..4e2f1f4
--- /dev/null
+++ b/15.0.0/gentoo/71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
@@ -0,0 +1,96 @@
+From 923bd335a44b1b556d705a7f1d36a2e9c06d9c5c Mon Sep 17 00:00:00 2001
+Message-ID: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
+From: Nathaniel Shead <nathanieloshead@gmail.com>
+Date: Fri, 4 Oct 2024 12:41:49 +1000
+Subject: [PATCH 1/2] c++: Allow references to internal-linkage vars in C++11
+ [PR113266]
+
+[temp.arg.nontype] changed in C++11 to allow naming internal-linkage
+variables and functions. We currently already handle internal-linkage
+functions, but variables were missed; this patch updates this.
+
+ PR c++/113266
+ PR c++/116911
+
+gcc/cp/ChangeLog:
+
+ * parser.cc (cp_parser_template_argument): Allow
+ internal-linkage variables since C++11.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.dg/cpp0x/nontype6.C: New test.
+
+Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
+---
+ gcc/cp/parser.cc | 17 ++++++++++++-----
+ gcc/testsuite/g++.dg/cpp0x/nontype6.C | 19 +++++++++++++++++++
+ 2 files changed, 31 insertions(+), 5 deletions(-)
+ create mode 100644 gcc/testsuite/g++.dg/cpp0x/nontype6.C
+
+diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
+index 08f9c89f1f0..e758ddeb1d5 100644
+--- a/gcc/cp/parser.cc
++++ b/gcc/cp/parser.cc
+@@ -19864,9 +19864,11 @@ cp_parser_template_argument (cp_parser* parser)
+
+ -- the name of a non-type template-parameter; or
+
+- -- the name of an object or function with external linkage...
++ -- the name of an object or function with external (or internal,
++ since C++11) linkage...
+
+- -- the address of an object or function with external linkage...
++ -- the address of an object or function with external (or internal,
++ since C++11) linkage...
+
+ -- a pointer to member... */
+ /* Look for a non-type template parameter. */
+@@ -19929,11 +19931,16 @@ cp_parser_template_argument (cp_parser* parser)
+ probe = TREE_OPERAND (probe, 1);
+ if (VAR_P (probe))
+ {
+- /* A variable without external linkage might still be a
++ /* A variable without valid linkage might still be a
+ valid constant-expression, so no error is issued here
+ if the external-linkage check fails. */
+- if (!address_p && !DECL_EXTERNAL_LINKAGE_P (probe))
+- cp_parser_simulate_error (parser);
++ if (!address_p && cxx_dialect < cxx17)
++ {
++ linkage_kind linkage = decl_linkage (probe);
++ if (linkage != lk_external
++ && (cxx_dialect < cxx11 || linkage != lk_internal))
++ cp_parser_simulate_error (parser);
++ }
+ }
+ else if (is_overloaded_fn (argument))
+ /* All overloaded functions are allowed; if the external
+diff --git a/gcc/testsuite/g++.dg/cpp0x/nontype6.C b/gcc/testsuite/g++.dg/cpp0x/nontype6.C
+new file mode 100644
+index 00000000000..5543d1e8b6d
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/cpp0x/nontype6.C
+@@ -0,0 +1,19 @@
++// PR c++/113266, PR c++/116911
++// { dg-do compile }
++
++template <int &> struct a {};
++static int guard1;
++a<guard1> b; // { dg-error "constant-expression|invalid" "" { target c++98_only } }
++
++namespace {
++ int guard2;
++}
++a<guard2> c; // OK in C++98 because guard2 has external linkage
++ // OK since C++11 because we can refer to an internal linkage decl
++
++void nolinkage() {
++ static int guard3;
++ a<guard3> d; // { dg-error "constant-expression|invalid" "" { target c++98_only } }
++ // { dg-error "constant expression|no linkage" "" { target { c++11 && c++14_down } } .-1 }
++ // OK since C++17 since we can now refer to no-linkage decls
++}
+--
+2.46.2
+
diff --git a/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch b/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
new file mode 100644
index 0000000..ab12bf6
--- /dev/null
+++ b/15.0.0/gentoo/72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
@@ -0,0 +1,76 @@
+From ba7c4e109fc589603911630deb2f19eba88bdbe8 Mon Sep 17 00:00:00 2001
+Message-ID: <ba7c4e109fc589603911630deb2f19eba88bdbe8.1728034006.git.sam@gentoo.org>
+In-Reply-To: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
+References: <923bd335a44b1b556d705a7f1d36a2e9c06d9c5c.1728034006.git.sam@gentoo.org>
+From: Nathaniel Shead <nathanieloshead@gmail.com>
+Date: Fri, 4 Oct 2024 10:52:02 +1000
+Subject: [PATCH 2/2] c++: Return the underlying decl rather than the
+ USING_DECL from update_binding [PR116913]
+
+Users of pushdecl assume that the returned decl will be a possibly
+updated decl matching the one that was passed in. My r15-3910 change
+broke this since in some cases we would now return USING_DECLs; this
+patch fixes the situation.
+
+ PR c++/116913
+
+gcc/cp/ChangeLog:
+
+ * name-lookup.cc (update_binding): Return the strip_using'd old
+ decl rather than the binding.
+
+gcc/testsuite/ChangeLog:
+
+ * g++.dg/lookup/using70.C: New test.
+
+Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
+---
+ gcc/cp/name-lookup.cc | 4 ++--
+ gcc/testsuite/g++.dg/lookup/using70.C | 13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+ create mode 100644 gcc/testsuite/g++.dg/lookup/using70.C
+
+diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc
+index 4754ef5a522..609bd6e8c9b 100644
+--- a/gcc/cp/name-lookup.cc
++++ b/gcc/cp/name-lookup.cc
+@@ -3101,7 +3101,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
+ {
+ if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl)))
+ /* Two type decls to the same type. Do nothing. */
+- return old_bval;
++ return old;
+ else
+ goto conflict;
+ }
+@@ -3114,7 +3114,7 @@ update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
+
+ /* The new one must be an alias at this point. */
+ gcc_assert (DECL_NAMESPACE_ALIAS (decl));
+- return old_bval;
++ return old;
+ }
+ else if (TREE_CODE (old) == VAR_DECL)
+ {
+diff --git a/gcc/testsuite/g++.dg/lookup/using70.C b/gcc/testsuite/g++.dg/lookup/using70.C
+new file mode 100644
+index 00000000000..14838eea7ec
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/lookup/using70.C
+@@ -0,0 +1,13 @@
++// PR c++/116913
++// { dg-do compile { target c++11 } }
++
++namespace ns {
++ struct c {};
++ using d = int;
++}
++
++using ns::c;
++using ns::d;
++
++using c = ns::c;
++using d = ns::d;
+--
+2.46.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index d966e4c..2d85dc2 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,7 +1,9 @@
-14 ????
+14 4 October 2024
- 70_all_middle-end-check-explicitly-for-external-or-constant.patch
- 71_all_PR116878-libcall.patch
+ + 71_all_c-Allow-references-to-internal-linkage-vars-in-C-11-.patch
+ + 72_all_c-Return-the-underlying-decl-rather-than-the-USING_D.patch
13 29 September 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-10-02 19:45 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-10-02 19:45 UTC (permalink / raw
To: gentoo-commits
commit: 6566f31fc01e405d7cad5739140fb61e98b0dd82
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 2 19:44:53 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct 2 19:44:53 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6566f31f
15.0.0: drop 71_all_PR116878-libcall.patch
Merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/71_all_PR116878-libcall.patch | 215 ----------------------------
15.0.0/gentoo/README.history | 1 +
2 files changed, 1 insertion(+), 215 deletions(-)
diff --git a/15.0.0/gentoo/71_all_PR116878-libcall.patch b/15.0.0/gentoo/71_all_PR116878-libcall.patch
deleted file mode 100644
index 781196d..0000000
--- a/15.0.0/gentoo/71_all_PR116878-libcall.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-https://gcc.gnu.org/PR116878
-https://gcc.gnu.org/PR116616
-
-From b9883d33e6338b1a44247b3f8772a5e5d2757593 Mon Sep 17 00:00:00 2001
-Message-ID: <b9883d33e6338b1a44247b3f8772a5e5d2757593.1727650422.git.sam@gentoo.org>
-From: Filip Kastl <fkastl@suse.cz>
-Date: Tue, 10 Sep 2024 19:22:27 +0200
-Subject: [PATCH] gimple ssa: Don't use __builtin_popcount in switch exp
- transform
-
-Switch exponential transformation in the switch conversion pass
-currently generates
-
-tmp1 = __builtin_popcount (var);
-tmp2 = tmp1 == 1;
-
-when inserting code to determine if var is power of two. If the target
-doesn't support expanding the builtin as special instructions switch
-conversion relies on this whole pattern being expanded as bitmagic.
-However, it is possible that other GIMPLE optimizations move the two
-statements of the pattern apart. In that case the builtin becomes a
-libgcc call in the final binary. The call is slow and in case of
-freestanding programs can result in linking error (this bug was
-originally found while compiling Linux kernel).
-
-This patch modifies switch conversion to insert the bitmagic
-(var ^ (var - 1)) > (var - 1) instead of the builtin.
-
-gcc/ChangeLog:
-
- PR tree-optimization/116616
- * tree-switch-conversion.cc (can_pow2p): Remove this function.
- (gen_pow2p): Generate bitmagic instead of a builtin. Remove the
- TYPE parameter.
- (switch_conversion::is_exp_index_transform_viable): Don't call
- can_pow2p.
- (switch_conversion::exp_index_transform): Call gen_pow2p without
- the TYPE parameter.
- * tree-switch-conversion.h: Remove
- m_exp_index_transform_pow2p_type.
-
-gcc/testsuite/ChangeLog:
-
- PR tree-optimization/116616
- * gcc.target/i386/switch-exp-transform-1.c: Don't test for
- presence of the POPCOUNT internal fn call.
-
-Signed-off-by: Filip Kastl <fkastl@suse.cz>
----
- .../gcc.target/i386/switch-exp-transform-1.c | 7 +-
- gcc/tree-switch-conversion.cc | 84 +++++--------------
- gcc/tree-switch-conversion.h | 6 +-
- 3 files changed, 23 insertions(+), 74 deletions(-)
-
-diff --git a/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c b/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
-index a8c9e03e515f..4832f5b52c33 100644
---- a/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
-+++ b/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
-@@ -1,10 +1,8 @@
- /* { dg-do compile } */
--/* { dg-options "-O2 -fdump-tree-switchconv -fdump-tree-widening_mul -mpopcnt -mbmi" } */
-+/* { dg-options "-O2 -fdump-tree-switchconv -mbmi" } */
-
- /* Checks that exponential index transform enables switch conversion to convert
-- this switch into an array lookup. Also checks that the "index variable is a
-- power of two" check has been generated and that it has been later expanded
-- into an internal function. */
-+ this switch into an array lookup. */
-
- int foo(unsigned bar)
- {
-@@ -30,4 +28,3 @@ int foo(unsigned bar)
- }
-
- /* { dg-final { scan-tree-dump "CSWTCH" "switchconv" } } */
--/* { dg-final { scan-tree-dump "POPCOUNT" "widening_mul" } } */
-diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc
-index c1332a260943..00426d400006 100644
---- a/gcc/tree-switch-conversion.cc
-+++ b/gcc/tree-switch-conversion.cc
-@@ -133,75 +133,33 @@ gen_log2 (tree op, location_t loc, tree *result, tree type)
- return stmts;
- }
-
--/* Is it possible to efficiently check that a value of TYPE is a power of 2?
--
-- If yes, returns TYPE. If no, returns NULL_TREE. May also return another
-- type. This indicates that logarithm of the variable can be computed but
-- only after it is converted to this type.
--
-- Also see gen_pow2p. */
--
--static tree
--can_pow2p (tree type)
--{
-- /* __builtin_popcount supports the unsigned type or its long and long long
-- variants. Choose the smallest out of those that can still fit TYPE. */
-- int prec = TYPE_PRECISION (type);
-- int i_prec = TYPE_PRECISION (unsigned_type_node);
-- int li_prec = TYPE_PRECISION (long_unsigned_type_node);
-- int lli_prec = TYPE_PRECISION (long_long_unsigned_type_node);
--
-- if (prec <= i_prec)
-- return unsigned_type_node;
-- else if (prec <= li_prec)
-- return long_unsigned_type_node;
-- else if (prec <= lli_prec)
-- return long_long_unsigned_type_node;
-- else
-- return NULL_TREE;
--}
--
--/* Build a sequence of gimple statements checking that OP is a power of 2. Use
-- special optabs if target supports them. Return the result as a
-- boolean_type_node ssa name through RESULT. Assumes that OP's value will
-- be non-negative. The generated check may give arbitrary answer for negative
-- values.
--
-- Before computing the check, OP may have to be converted to another type.
-- This should be specified in TYPE. Use can_pow2p to decide what this type
-- should be.
--
-- Should only be used if can_pow2p returns true for type of OP. */
-+/* Build a sequence of gimple statements checking that OP is a power of 2.
-+ Return the result as a boolean_type_node ssa name through RESULT. Assumes
-+ that OP's value will be non-negative. The generated check may give
-+ arbitrary answer for negative values. */
-
- static gimple_seq
--gen_pow2p (tree op, location_t loc, tree *result, tree type)
-+gen_pow2p (tree op, location_t loc, tree *result)
- {
- gimple_seq stmts = NULL;
- gimple_stmt_iterator gsi = gsi_last (stmts);
-
-- built_in_function fn;
-- if (type == unsigned_type_node)
-- fn = BUILT_IN_POPCOUNT;
-- else if (type == long_unsigned_type_node)
-- fn = BUILT_IN_POPCOUNTL;
-- else
-- {
-- fn = BUILT_IN_POPCOUNTLL;
-- gcc_checking_assert (type == long_long_unsigned_type_node);
-- }
-+ tree type = TREE_TYPE (op);
-+ tree utype = unsigned_type_for (type);
-
-- tree orig_type = TREE_TYPE (op);
-+ /* Build (op ^ (op - 1)) > (op - 1). */
- tree tmp1;
-- if (type != orig_type)
-- tmp1 = gimple_convert (&gsi, false, GSI_NEW_STMT, loc, type, op);
-- else
-+ if (types_compatible_p (type, utype))
- tmp1 = op;
-- /* Build __builtin_popcount{l,ll} (op) == 1. */
-- tree tmp2 = gimple_build (&gsi, false, GSI_NEW_STMT, loc,
-- as_combined_fn (fn), integer_type_node, tmp1);
-- *result = gimple_build (&gsi, false, GSI_NEW_STMT, loc, EQ_EXPR,
-- boolean_type_node, tmp2,
-- build_one_cst (integer_type_node));
-+ else
-+ tmp1 = gimple_convert (&gsi, false, GSI_NEW_STMT, loc, utype, op);
-+ tree tmp2 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, MINUS_EXPR, utype,
-+ tmp1, build_one_cst (utype));
-+ tree tmp3 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, BIT_XOR_EXPR,
-+ utype, tmp1, tmp2);
-+ *result = gimple_build (&gsi, false, GSI_NEW_STMT, loc, GT_EXPR,
-+ boolean_type_node, tmp3, tmp2);
-+
- return stmts;
- }
-
-@@ -371,9 +329,6 @@ switch_conversion::is_exp_index_transform_viable (gswitch *swtch)
- m_exp_index_transform_log2_type = can_log2 (index_type, opt_type);
- if (!m_exp_index_transform_log2_type)
- return false;
-- m_exp_index_transform_pow2p_type = can_pow2p (index_type);
-- if (!m_exp_index_transform_pow2p_type)
-- return false;
-
- /* Check that each case label corresponds only to one value
- (no case 1..3). */
-@@ -467,8 +422,7 @@ switch_conversion::exp_index_transform (gswitch *swtch)
- new_edge2->probability = profile_probability::even ();
-
- tree tmp;
-- gimple_seq stmts = gen_pow2p (index, UNKNOWN_LOCATION, &tmp,
-- m_exp_index_transform_pow2p_type);
-+ gimple_seq stmts = gen_pow2p (index, UNKNOWN_LOCATION, &tmp);
- gsi = gsi_last_bb (cond_bb);
- gsi_insert_seq_after (&gsi, stmts, GSI_LAST_NEW_STMT);
- gcond *stmt_cond = gimple_build_cond (NE_EXPR, tmp, boolean_false_node,
-diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h
-index 14610499e5fb..6468995eb316 100644
---- a/gcc/tree-switch-conversion.h
-+++ b/gcc/tree-switch-conversion.h
-@@ -920,11 +920,9 @@ public:
- bool m_exp_index_transform_applied;
-
- /* If switch conversion decided exponential index transform is viable, here
-- will be stored the types to which index variable has to be converted
-- before the logarithm and the "is power of 2" operations which are part of
-- the transform. */
-+ will be stored the type to which index variable has to be converted
-+ before the logarithm operation which is a part of the transform. */
- tree m_exp_index_transform_log2_type;
-- tree m_exp_index_transform_pow2p_type;
- };
-
- void
---
-2.46.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 819d192..d966e4c 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,6 +1,7 @@
14 ????
- 70_all_middle-end-check-explicitly-for-external-or-constant.patch
+ - 71_all_PR116878-libcall.patch
13 29 September 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-30 14:05 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-09-30 14:05 UTC (permalink / raw
To: gentoo-commits
commit: 4dffefc137f5ba6524cdb6eb598313646c5df6c8
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 30 14:05:13 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 30 14:05:13 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4dffefc1
15.0.0: drop 70_all_middle-end-check-explicitly-for-external-or-constant.patch
Merged upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...check-explicitly-for-external-or-constant.patch | 88 ----------------------
15.0.0/gentoo/README.history | 5 ++
2 files changed, 5 insertions(+), 88 deletions(-)
diff --git a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
deleted file mode 100644
index 7dcf89d..0000000
--- a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-https://inbox.sourceware.org/gcc-patches/patch-18806-tamar@arm.com/T/#u
-https://gcc.gnu.org/PR116817
-
-From 9a5d1eb943dcaf26551b534eb62cbf1dd8443335 Mon Sep 17 00:00:00 2001
-Message-ID: <9a5d1eb943dcaf26551b534eb62cbf1dd8443335.1727104663.git.sam@gentoo.org>
-From: Tamar Christina <tamar.christina@arm.com>
-Date: Mon, 23 Sep 2024 15:29:52 +0100
-Subject: [PATCH] middle-end: check explicitly for external or constants when
- checking for loop invariant [PR116817]
-
-Hi All,
-
-The previous check if a value was external was checking
-!vect_get_internal_def (vinfo, var) but this of course isn't completely right
-as they could reductions etc.
-
-This changes the check to just explicitly look at externals and constants.
-Note that reductions remain unhandled here, but we don't support codegen of
-boolean reductions today anyway.
-
-So at the time we do then this would have the be handled as well in lowering.
-
-Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
-
-Ok for master?
-
-Thanks,
-Tamar
-
-gcc/ChangeLog:
-
- PR tree-optimization/116817
- * tree-vect-patterns.cc (vect_recog_bool_pattern): Check for const or
- externals.
-
-gcc/testsuite/ChangeLog:
-
-PR tree-optimization/116817
- * g++.dg/vect/pr116817.cc: New test.
----
- gcc/testsuite/g++.dg/vect/pr116817.cc | 16 ++++++++++++++++
- gcc/tree-vect-patterns.cc | 5 ++++-
- 2 files changed, 20 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/g++.dg/vect/pr116817.cc
-
-diff --git a/gcc/testsuite/g++.dg/vect/pr116817.cc b/gcc/testsuite/g++.dg/vect/pr116817.cc
-new file mode 100644
-index 00000000000..7e28982fb13
---- /dev/null
-+++ b/gcc/testsuite/g++.dg/vect/pr116817.cc
-@@ -0,0 +1,16 @@
-+/* { dg-do compile } */
-+/* { dg-additional-options "-O3" } */
-+
-+int main_ulData0;
-+unsigned *main_pSrcBuffer;
-+int main(void) {
-+ int iSrc = 0;
-+ bool bData0;
-+ for (; iSrc < 4; iSrc++) {
-+ if (bData0)
-+ main_pSrcBuffer[iSrc] = main_ulData0;
-+ else
-+ main_pSrcBuffer[iSrc] = 0;
-+ bData0 = !bData0;
-+ }
-+}
-diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
-index e7e877dd2adb55262822f1660f8d92b42d44e6d0..f0298b2ab97a1e7dd0d943340e1389c3c0fa796e 100644
---- a/gcc/tree-vect-patterns.cc
-+++ b/gcc/tree-vect-patterns.cc
-@@ -6062,12 +6062,15 @@ vect_recog_bool_pattern (vec_info *vinfo,
- if (get_vectype_for_scalar_type (vinfo, type) == NULL_TREE)
- return NULL;
-
-+ stmt_vec_info var_def_info = vinfo->lookup_def (var);
- if (check_bool_pattern (var, vinfo, bool_stmts))
- var = adjust_bool_stmts (vinfo, bool_stmts, type, stmt_vinfo);
- else if (integer_type_for_mask (var, vinfo))
- return NULL;
- else if (TREE_CODE (TREE_TYPE (var)) == BOOLEAN_TYPE
-- && !vect_get_internal_def (vinfo, var))
-+ && (!var_def_info
-+ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_external_def
-+ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_constant_def))
- {
- /* If the condition is already a boolean then manually convert it to a
- mask of the given integer type but don't set a vectype. */
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 6c31450..819d192 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,5 +1,10 @@
+14 ????
+
+ - 70_all_middle-end-check-explicitly-for-external-or-constant.patch
+
13 29 September 2024
+ + 70_all_middle-end-check-explicitly-for-external-or-constant.patch
+ 71_all_PR116878-libcall.patch
12 1 September 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-29 22:56 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-09-29 22:56 UTC (permalink / raw
To: gentoo-commits
commit: 891af478cc93ae3e2e176ed9739166799b814a05
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 29 22:55:02 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Sep 29 22:55:28 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=891af478
15.0.0: add 71_all_PR116878-libcall.patch
It's been approved but not yet merged.
Bug: https://gcc.gnu.org/PR116616
Bug: https://gcc.gnu.org/PR116878
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/71_all_PR116878-libcall.patch | 215 ++++++++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +
2 files changed, 219 insertions(+)
diff --git a/15.0.0/gentoo/71_all_PR116878-libcall.patch b/15.0.0/gentoo/71_all_PR116878-libcall.patch
new file mode 100644
index 0000000..781196d
--- /dev/null
+++ b/15.0.0/gentoo/71_all_PR116878-libcall.patch
@@ -0,0 +1,215 @@
+https://gcc.gnu.org/PR116878
+https://gcc.gnu.org/PR116616
+
+From b9883d33e6338b1a44247b3f8772a5e5d2757593 Mon Sep 17 00:00:00 2001
+Message-ID: <b9883d33e6338b1a44247b3f8772a5e5d2757593.1727650422.git.sam@gentoo.org>
+From: Filip Kastl <fkastl@suse.cz>
+Date: Tue, 10 Sep 2024 19:22:27 +0200
+Subject: [PATCH] gimple ssa: Don't use __builtin_popcount in switch exp
+ transform
+
+Switch exponential transformation in the switch conversion pass
+currently generates
+
+tmp1 = __builtin_popcount (var);
+tmp2 = tmp1 == 1;
+
+when inserting code to determine if var is power of two. If the target
+doesn't support expanding the builtin as special instructions switch
+conversion relies on this whole pattern being expanded as bitmagic.
+However, it is possible that other GIMPLE optimizations move the two
+statements of the pattern apart. In that case the builtin becomes a
+libgcc call in the final binary. The call is slow and in case of
+freestanding programs can result in linking error (this bug was
+originally found while compiling Linux kernel).
+
+This patch modifies switch conversion to insert the bitmagic
+(var ^ (var - 1)) > (var - 1) instead of the builtin.
+
+gcc/ChangeLog:
+
+ PR tree-optimization/116616
+ * tree-switch-conversion.cc (can_pow2p): Remove this function.
+ (gen_pow2p): Generate bitmagic instead of a builtin. Remove the
+ TYPE parameter.
+ (switch_conversion::is_exp_index_transform_viable): Don't call
+ can_pow2p.
+ (switch_conversion::exp_index_transform): Call gen_pow2p without
+ the TYPE parameter.
+ * tree-switch-conversion.h: Remove
+ m_exp_index_transform_pow2p_type.
+
+gcc/testsuite/ChangeLog:
+
+ PR tree-optimization/116616
+ * gcc.target/i386/switch-exp-transform-1.c: Don't test for
+ presence of the POPCOUNT internal fn call.
+
+Signed-off-by: Filip Kastl <fkastl@suse.cz>
+---
+ .../gcc.target/i386/switch-exp-transform-1.c | 7 +-
+ gcc/tree-switch-conversion.cc | 84 +++++--------------
+ gcc/tree-switch-conversion.h | 6 +-
+ 3 files changed, 23 insertions(+), 74 deletions(-)
+
+diff --git a/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c b/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
+index a8c9e03e515f..4832f5b52c33 100644
+--- a/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
++++ b/gcc/testsuite/gcc.target/i386/switch-exp-transform-1.c
+@@ -1,10 +1,8 @@
+ /* { dg-do compile } */
+-/* { dg-options "-O2 -fdump-tree-switchconv -fdump-tree-widening_mul -mpopcnt -mbmi" } */
++/* { dg-options "-O2 -fdump-tree-switchconv -mbmi" } */
+
+ /* Checks that exponential index transform enables switch conversion to convert
+- this switch into an array lookup. Also checks that the "index variable is a
+- power of two" check has been generated and that it has been later expanded
+- into an internal function. */
++ this switch into an array lookup. */
+
+ int foo(unsigned bar)
+ {
+@@ -30,4 +28,3 @@ int foo(unsigned bar)
+ }
+
+ /* { dg-final { scan-tree-dump "CSWTCH" "switchconv" } } */
+-/* { dg-final { scan-tree-dump "POPCOUNT" "widening_mul" } } */
+diff --git a/gcc/tree-switch-conversion.cc b/gcc/tree-switch-conversion.cc
+index c1332a260943..00426d400006 100644
+--- a/gcc/tree-switch-conversion.cc
++++ b/gcc/tree-switch-conversion.cc
+@@ -133,75 +133,33 @@ gen_log2 (tree op, location_t loc, tree *result, tree type)
+ return stmts;
+ }
+
+-/* Is it possible to efficiently check that a value of TYPE is a power of 2?
+-
+- If yes, returns TYPE. If no, returns NULL_TREE. May also return another
+- type. This indicates that logarithm of the variable can be computed but
+- only after it is converted to this type.
+-
+- Also see gen_pow2p. */
+-
+-static tree
+-can_pow2p (tree type)
+-{
+- /* __builtin_popcount supports the unsigned type or its long and long long
+- variants. Choose the smallest out of those that can still fit TYPE. */
+- int prec = TYPE_PRECISION (type);
+- int i_prec = TYPE_PRECISION (unsigned_type_node);
+- int li_prec = TYPE_PRECISION (long_unsigned_type_node);
+- int lli_prec = TYPE_PRECISION (long_long_unsigned_type_node);
+-
+- if (prec <= i_prec)
+- return unsigned_type_node;
+- else if (prec <= li_prec)
+- return long_unsigned_type_node;
+- else if (prec <= lli_prec)
+- return long_long_unsigned_type_node;
+- else
+- return NULL_TREE;
+-}
+-
+-/* Build a sequence of gimple statements checking that OP is a power of 2. Use
+- special optabs if target supports them. Return the result as a
+- boolean_type_node ssa name through RESULT. Assumes that OP's value will
+- be non-negative. The generated check may give arbitrary answer for negative
+- values.
+-
+- Before computing the check, OP may have to be converted to another type.
+- This should be specified in TYPE. Use can_pow2p to decide what this type
+- should be.
+-
+- Should only be used if can_pow2p returns true for type of OP. */
++/* Build a sequence of gimple statements checking that OP is a power of 2.
++ Return the result as a boolean_type_node ssa name through RESULT. Assumes
++ that OP's value will be non-negative. The generated check may give
++ arbitrary answer for negative values. */
+
+ static gimple_seq
+-gen_pow2p (tree op, location_t loc, tree *result, tree type)
++gen_pow2p (tree op, location_t loc, tree *result)
+ {
+ gimple_seq stmts = NULL;
+ gimple_stmt_iterator gsi = gsi_last (stmts);
+
+- built_in_function fn;
+- if (type == unsigned_type_node)
+- fn = BUILT_IN_POPCOUNT;
+- else if (type == long_unsigned_type_node)
+- fn = BUILT_IN_POPCOUNTL;
+- else
+- {
+- fn = BUILT_IN_POPCOUNTLL;
+- gcc_checking_assert (type == long_long_unsigned_type_node);
+- }
++ tree type = TREE_TYPE (op);
++ tree utype = unsigned_type_for (type);
+
+- tree orig_type = TREE_TYPE (op);
++ /* Build (op ^ (op - 1)) > (op - 1). */
+ tree tmp1;
+- if (type != orig_type)
+- tmp1 = gimple_convert (&gsi, false, GSI_NEW_STMT, loc, type, op);
+- else
++ if (types_compatible_p (type, utype))
+ tmp1 = op;
+- /* Build __builtin_popcount{l,ll} (op) == 1. */
+- tree tmp2 = gimple_build (&gsi, false, GSI_NEW_STMT, loc,
+- as_combined_fn (fn), integer_type_node, tmp1);
+- *result = gimple_build (&gsi, false, GSI_NEW_STMT, loc, EQ_EXPR,
+- boolean_type_node, tmp2,
+- build_one_cst (integer_type_node));
++ else
++ tmp1 = gimple_convert (&gsi, false, GSI_NEW_STMT, loc, utype, op);
++ tree tmp2 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, MINUS_EXPR, utype,
++ tmp1, build_one_cst (utype));
++ tree tmp3 = gimple_build (&gsi, false, GSI_NEW_STMT, loc, BIT_XOR_EXPR,
++ utype, tmp1, tmp2);
++ *result = gimple_build (&gsi, false, GSI_NEW_STMT, loc, GT_EXPR,
++ boolean_type_node, tmp3, tmp2);
++
+ return stmts;
+ }
+
+@@ -371,9 +329,6 @@ switch_conversion::is_exp_index_transform_viable (gswitch *swtch)
+ m_exp_index_transform_log2_type = can_log2 (index_type, opt_type);
+ if (!m_exp_index_transform_log2_type)
+ return false;
+- m_exp_index_transform_pow2p_type = can_pow2p (index_type);
+- if (!m_exp_index_transform_pow2p_type)
+- return false;
+
+ /* Check that each case label corresponds only to one value
+ (no case 1..3). */
+@@ -467,8 +422,7 @@ switch_conversion::exp_index_transform (gswitch *swtch)
+ new_edge2->probability = profile_probability::even ();
+
+ tree tmp;
+- gimple_seq stmts = gen_pow2p (index, UNKNOWN_LOCATION, &tmp,
+- m_exp_index_transform_pow2p_type);
++ gimple_seq stmts = gen_pow2p (index, UNKNOWN_LOCATION, &tmp);
+ gsi = gsi_last_bb (cond_bb);
+ gsi_insert_seq_after (&gsi, stmts, GSI_LAST_NEW_STMT);
+ gcond *stmt_cond = gimple_build_cond (NE_EXPR, tmp, boolean_false_node,
+diff --git a/gcc/tree-switch-conversion.h b/gcc/tree-switch-conversion.h
+index 14610499e5fb..6468995eb316 100644
+--- a/gcc/tree-switch-conversion.h
++++ b/gcc/tree-switch-conversion.h
+@@ -920,11 +920,9 @@ public:
+ bool m_exp_index_transform_applied;
+
+ /* If switch conversion decided exponential index transform is viable, here
+- will be stored the types to which index variable has to be converted
+- before the logarithm and the "is power of 2" operations which are part of
+- the transform. */
++ will be stored the type to which index variable has to be converted
++ before the logarithm operation which is a part of the transform. */
+ tree m_exp_index_transform_log2_type;
+- tree m_exp_index_transform_pow2p_type;
+ };
+
+ void
+--
+2.46.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index a035c01..6c31450 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+13 29 September 2024
+
+ + 71_all_PR116878-libcall.patch
+
12 1 September 2024
- 32_all_PR116470-debug-bootstrap.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-24 1:41 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-09-24 1:41 UTC (permalink / raw
To: gentoo-commits
commit: 3e1c7a2699f90793d9bf7107cb0b5943ba7c76c1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 24 01:41:22 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep 24 01:41:22 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3e1c7a26
15.0.0: update 70_all_middle-end-check-explicitly-for-external-or-constant.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
...middle-end-check-explicitly-for-external-or-constant.patch | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
index 6dcc1a4..7dcf89d 100644
--- a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
+++ b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
@@ -66,7 +66,7 @@ index 00000000000..7e28982fb13
+ }
+}
diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
-index e7e877dd2ad..b913d6de003 100644
+index e7e877dd2adb55262822f1660f8d92b42d44e6d0..f0298b2ab97a1e7dd0d943340e1389c3c0fa796e 100644
--- a/gcc/tree-vect-patterns.cc
+++ b/gcc/tree-vect-patterns.cc
@@ -6062,12 +6062,15 @@ vect_recog_bool_pattern (vec_info *vinfo,
@@ -80,14 +80,9 @@ index e7e877dd2ad..b913d6de003 100644
return NULL;
else if (TREE_CODE (TREE_TYPE (var)) == BOOLEAN_TYPE
- && !vect_get_internal_def (vinfo, var))
-+ && var_def_info
-+ && (STMT_VINFO_DEF_TYPE (var_def_info) == vect_external_def
++ && (!var_def_info
++ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_external_def
+ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_constant_def))
{
/* If the condition is already a boolean then manually convert it to a
mask of the given integer type but don't set a vectype. */
-
-base-commit: 358db2e3ed4acf44282d1d9ebbc4a1a3b6e38d21
---
-2.46.1
-
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-23 15:23 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-09-23 15:23 UTC (permalink / raw
To: gentoo-commits
commit: 690e151179e3dc40e99b3beeb551ac50b321d456
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 23 15:23:35 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 23 15:23:35 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=690e1511
15.0.0: add 70_all_middle-end-check-explicitly-for-external-or-constant.patch
Bug: https://gcc.gnu.org/PR116817
Signed-off-by: Sam James <sam <AT> gentoo.org>
...check-explicitly-for-external-or-constant.patch | 93 ++++++++++++++++++++++
1 file changed, 93 insertions(+)
diff --git a/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
new file mode 100644
index 0000000..6dcc1a4
--- /dev/null
+++ b/15.0.0/gentoo/70_all_middle-end-check-explicitly-for-external-or-constant.patch
@@ -0,0 +1,93 @@
+https://inbox.sourceware.org/gcc-patches/patch-18806-tamar@arm.com/T/#u
+https://gcc.gnu.org/PR116817
+
+From 9a5d1eb943dcaf26551b534eb62cbf1dd8443335 Mon Sep 17 00:00:00 2001
+Message-ID: <9a5d1eb943dcaf26551b534eb62cbf1dd8443335.1727104663.git.sam@gentoo.org>
+From: Tamar Christina <tamar.christina@arm.com>
+Date: Mon, 23 Sep 2024 15:29:52 +0100
+Subject: [PATCH] middle-end: check explicitly for external or constants when
+ checking for loop invariant [PR116817]
+
+Hi All,
+
+The previous check if a value was external was checking
+!vect_get_internal_def (vinfo, var) but this of course isn't completely right
+as they could reductions etc.
+
+This changes the check to just explicitly look at externals and constants.
+Note that reductions remain unhandled here, but we don't support codegen of
+boolean reductions today anyway.
+
+So at the time we do then this would have the be handled as well in lowering.
+
+Bootstrapped Regtested on aarch64-none-linux-gnu and no issues.
+
+Ok for master?
+
+Thanks,
+Tamar
+
+gcc/ChangeLog:
+
+ PR tree-optimization/116817
+ * tree-vect-patterns.cc (vect_recog_bool_pattern): Check for const or
+ externals.
+
+gcc/testsuite/ChangeLog:
+
+PR tree-optimization/116817
+ * g++.dg/vect/pr116817.cc: New test.
+---
+ gcc/testsuite/g++.dg/vect/pr116817.cc | 16 ++++++++++++++++
+ gcc/tree-vect-patterns.cc | 5 ++++-
+ 2 files changed, 20 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/g++.dg/vect/pr116817.cc
+
+diff --git a/gcc/testsuite/g++.dg/vect/pr116817.cc b/gcc/testsuite/g++.dg/vect/pr116817.cc
+new file mode 100644
+index 00000000000..7e28982fb13
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/vect/pr116817.cc
+@@ -0,0 +1,16 @@
++/* { dg-do compile } */
++/* { dg-additional-options "-O3" } */
++
++int main_ulData0;
++unsigned *main_pSrcBuffer;
++int main(void) {
++ int iSrc = 0;
++ bool bData0;
++ for (; iSrc < 4; iSrc++) {
++ if (bData0)
++ main_pSrcBuffer[iSrc] = main_ulData0;
++ else
++ main_pSrcBuffer[iSrc] = 0;
++ bData0 = !bData0;
++ }
++}
+diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
+index e7e877dd2ad..b913d6de003 100644
+--- a/gcc/tree-vect-patterns.cc
++++ b/gcc/tree-vect-patterns.cc
+@@ -6062,12 +6062,15 @@ vect_recog_bool_pattern (vec_info *vinfo,
+ if (get_vectype_for_scalar_type (vinfo, type) == NULL_TREE)
+ return NULL;
+
++ stmt_vec_info var_def_info = vinfo->lookup_def (var);
+ if (check_bool_pattern (var, vinfo, bool_stmts))
+ var = adjust_bool_stmts (vinfo, bool_stmts, type, stmt_vinfo);
+ else if (integer_type_for_mask (var, vinfo))
+ return NULL;
+ else if (TREE_CODE (TREE_TYPE (var)) == BOOLEAN_TYPE
+- && !vect_get_internal_def (vinfo, var))
++ && var_def_info
++ && (STMT_VINFO_DEF_TYPE (var_def_info) == vect_external_def
++ || STMT_VINFO_DEF_TYPE (var_def_info) == vect_constant_def))
+ {
+ /* If the condition is already a boolean then manually convert it to a
+ mask of the given integer type but don't set a vectype. */
+
+base-commit: 358db2e3ed4acf44282d1d9ebbc4a1a3b6e38d21
+--
+2.46.1
+
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-09-02 2:28 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-09-02 2:28 UTC (permalink / raw
To: gentoo-commits
commit: d676863b64b58bf73a7f26eea70f81aeba517b13
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 2 02:28:39 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep 2 02:28:39 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=d676863b
15.0.0: cut patchset 12
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index e1c375e..a035c01 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-12 ????
+12 1 September 2024
- 32_all_PR116470-debug-bootstrap.patch
- 33_all_PR116348-vect.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-26 13:44 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-26 13:44 UTC (permalink / raw
To: gentoo-commits
commit: 24f7b8a07ce29ac39d8d3245a1ba7f7abf3dcfa1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 26 13:43:58 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 13:43:58 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=24f7b8a0
15.0.0: drop now-upstream patches
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gentoo/32_all_PR116470-debug-bootstrap.patch | 78 ----------------------
15.0.0/gentoo/33_all_PR116348-vect.patch | 78 ----------------------
15.0.0/gentoo/README.history | 5 ++
3 files changed, 5 insertions(+), 156 deletions(-)
diff --git a/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch b/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch
deleted file mode 100644
index 613cf4c..0000000
--- a/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-https://gcc.gnu.org/PR116470
-https://inbox.sourceware.org/gcc-patches/AS1PR01MB946587924CF9EFA4950ECBAFE48B2@AS1PR01MB9465.eurprd01.prod.exchangelabs.com/
-
-From 9c7050effd98d868d59fbd5ec7eeff1160eb05b8 Mon Sep 17 00:00:00 2001
-Message-ID: <9c7050effd98d868d59fbd5ec7eeff1160eb05b8.1724653254.git.sam@gentoo.org>
-From: Bernd Edlinger <bernd.edlinger@hotmail.de>
-Date: Mon, 26 Aug 2024 05:46:16 +0200
-Subject: [PATCH] Fix bootstap-errors due to enabling -gvariable-location-views
-
-This recent change triggered various bootsteap-errors, mostly on
-x86 targets because line info advance address entries were output
-in the wrong section table.
-The switch to the wrong line table happened in dwarfout_set_ignored_loc.
-It must use the same section as the earlier called
-dwarf2out_switch_text_section.
-
-But also ft32-elf was affected, because the assembler choked on
-something simple as ".2byte .LM2-.LM1", but fortunately it is
-able to use native location views, the configure test was just
-not executed because the ft32 "nop" instruction was missing.
-
-gcc/ChangeLog:
-
-PR debug/116470
- * configure.ac: Add the "nop" instruction for cpu type ft32.
- * configure: Regenerate.
- * dwarf2out.cc (dwarf2out_set_ignored_loc): Use the correct
- line info section.
----
- gcc/configure | 2 +-
- gcc/configure.ac | 2 +-
- gcc/dwarf2out.cc | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/gcc/configure b/gcc/configure
-index 557ea5fa3ac9..3d301b6ecd3d 100755
---- a/gcc/configure
-+++ b/gcc/configure
-@@ -31398,7 +31398,7 @@ esac
- case "$cpu_type" in
- aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
- | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
-- | visium | xstormy16 | xtensa)
-+ | visium | xstormy16 | xtensa | ft32)
- insn="nop"
- ;;
- ia64 | s390)
-diff --git a/gcc/configure.ac b/gcc/configure.ac
-index eaa01d0d7e56..8a2d2b0438e7 100644
---- a/gcc/configure.ac
-+++ b/gcc/configure.ac
-@@ -5610,7 +5610,7 @@ esac
- case "$cpu_type" in
- aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
- | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
-- | visium | xstormy16 | xtensa)
-+ | visium | xstormy16 | xtensa | ft32)
- insn="nop"
- ;;
- ia64 | s390)
-diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
-index 633900b035fe..3f040da33a63 100644
---- a/gcc/dwarf2out.cc
-+++ b/gcc/dwarf2out.cc
-@@ -28939,7 +28939,7 @@ dwarf2out_set_ignored_loc (unsigned int line, unsigned int column,
- dw_fde_ref fde = cfun->fde;
-
- fde->ignored_debug = false;
-- set_cur_line_info_table (function_section (fde->decl));
-+ set_cur_line_info_table (current_function_section ());
-
- dwarf2out_source_line (line, column, filename, 0, true);
- }
-
-base-commit: b4ac2c23d8745d98984954e88f02aa73f1c3594b
---
-2.46.0
-
diff --git a/15.0.0/gentoo/33_all_PR116348-vect.patch b/15.0.0/gentoo/33_all_PR116348-vect.patch
deleted file mode 100644
index 623ce34..0000000
--- a/15.0.0/gentoo/33_all_PR116348-vect.patch
+++ /dev/null
@@ -1,78 +0,0 @@
-https://gcc.gnu.org/PR116348
-https://inbox.sourceware.org/gcc-patches/20240825185348.37025-1-xry111@xry111.site/T/#u
-
-From cc68092ef1bb1134f6d8ddf0281323658a4358ae Mon Sep 17 00:00:00 2001
-Message-ID: <cc68092ef1bb1134f6d8ddf0281323658a4358ae.1724653336.git.sam@gentoo.org>
-From: Xi Ruoyao <xry111@xry111.site>
-Date: Mon, 26 Aug 2024 02:53:13 +0800
-Subject: [PATCH] vect: Fix STMT_VINFO_DEF_TYPE check for odd/even widen mult
- [PR116348]
-
-After fixing PR116142 some code started to trigger an ICE with -O3
--march=znver4. Per Richard Biener who actually made this fix:
-
-"supportable_widening_operation fails at transform time - that's likely
-because vectorizable_reduction "puns" defs to internal_def"
-
-so the check should use STMT_VINFO_REDUC_DEF instead of checking if
-STMT_VINFO_DEF_TYPE is vect_reduction_def.
-
-gcc/ChangeLog:
-
- PR tree-optimization/PR116348
- * tree-vect-stmts.cc (supportable_widening_operation): Use
- STMT_VINFO_REDUC_DEF (x) instead of
- STMT_VINFO_DEF_TYPE (x) == vect_reduction_def.
-
-gcc/testsuite/ChangeLog:
-
- PR tree-optimization/PR116348
- * gcc.c-torture/compile/pr116438.c: New test.
-
-Co-authored-by: Richard Biener <rguenther@suse.de>
----
- gcc/testsuite/gcc.c-torture/compile/pr116438.c | 14 ++++++++++++++
- gcc/tree-vect-stmts.cc | 3 +--
- 2 files changed, 15 insertions(+), 2 deletions(-)
- create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr116438.c
-
-diff --git a/gcc/testsuite/gcc.c-torture/compile/pr116438.c b/gcc/testsuite/gcc.c-torture/compile/pr116438.c
-new file mode 100644
-index 000000000000..97ab0181ab8b
---- /dev/null
-+++ b/gcc/testsuite/gcc.c-torture/compile/pr116438.c
-@@ -0,0 +1,14 @@
-+/* { dg-additional-options "-march=znver4" { target x86_64-*-* i?86-*-* } } */
-+
-+int *a;
-+int b;
-+long long c, d;
-+void
-+e (int f)
-+{
-+ for (; f; f++)
-+ {
-+ d += (long long)a[f] * b;
-+ c += (long long)a[f] * 3;
-+ }
-+}
-diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
-index 385e63163c24..9eb73a599339 100644
---- a/gcc/tree-vect-stmts.cc
-+++ b/gcc/tree-vect-stmts.cc
-@@ -14193,8 +14193,7 @@ supportable_widening_operation (vec_info *vinfo,
- by STMT is only directly used in the reduction statement. */
- tree lhs = gimple_assign_lhs (vect_orig_stmt (stmt_info)->stmt);
- stmt_vec_info use_stmt_info = loop_info->lookup_single_use (lhs);
-- if (use_stmt_info
-- && STMT_VINFO_DEF_TYPE (use_stmt_info) == vect_reduction_def)
-+ if (use_stmt_info && STMT_VINFO_REDUC_DEF (use_stmt_info))
- return true;
- }
- c1 = VEC_WIDEN_MULT_LO_EXPR;
-
-base-commit: b4ac2c23d8745d98984954e88f02aa73f1c3594b
-prerequisite-patch-id: 743f4e4444f9cac24e67abce2bda52d6a421d870
---
-2.46.0
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 728080e..e1c375e 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+12 ????
+
+ - 32_all_PR116470-debug-bootstrap.patch
+ - 33_all_PR116348-vect.patch
+
11 26 August 2024
- 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-26 6:24 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-26 6:24 UTC (permalink / raw
To: gentoo-commits
commit: b6fdeaf382dd20760fc3baf1ca9ff3db9f58c14d
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 26 06:23:04 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 26 06:23:13 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b6fdeaf3
15.0.0: cut 11 patchset, add two patches
* Add an ICE fix for vectorization (PR116348)
* Fix bootstrap on x86 w/ debug info (PR116470)
Bug: https://gcc.gnu.org/PR116348
Bug: https://gcc.gnu.org/PR116470
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gentoo/32_all_PR116470-debug-bootstrap.patch | 78 ++++++++++++++++++++++
15.0.0/gentoo/33_all_PR116348-vect.patch | 78 ++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +-
3 files changed, 159 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch b/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch
new file mode 100644
index 0000000..613cf4c
--- /dev/null
+++ b/15.0.0/gentoo/32_all_PR116470-debug-bootstrap.patch
@@ -0,0 +1,78 @@
+https://gcc.gnu.org/PR116470
+https://inbox.sourceware.org/gcc-patches/AS1PR01MB946587924CF9EFA4950ECBAFE48B2@AS1PR01MB9465.eurprd01.prod.exchangelabs.com/
+
+From 9c7050effd98d868d59fbd5ec7eeff1160eb05b8 Mon Sep 17 00:00:00 2001
+Message-ID: <9c7050effd98d868d59fbd5ec7eeff1160eb05b8.1724653254.git.sam@gentoo.org>
+From: Bernd Edlinger <bernd.edlinger@hotmail.de>
+Date: Mon, 26 Aug 2024 05:46:16 +0200
+Subject: [PATCH] Fix bootstap-errors due to enabling -gvariable-location-views
+
+This recent change triggered various bootsteap-errors, mostly on
+x86 targets because line info advance address entries were output
+in the wrong section table.
+The switch to the wrong line table happened in dwarfout_set_ignored_loc.
+It must use the same section as the earlier called
+dwarf2out_switch_text_section.
+
+But also ft32-elf was affected, because the assembler choked on
+something simple as ".2byte .LM2-.LM1", but fortunately it is
+able to use native location views, the configure test was just
+not executed because the ft32 "nop" instruction was missing.
+
+gcc/ChangeLog:
+
+PR debug/116470
+ * configure.ac: Add the "nop" instruction for cpu type ft32.
+ * configure: Regenerate.
+ * dwarf2out.cc (dwarf2out_set_ignored_loc): Use the correct
+ line info section.
+---
+ gcc/configure | 2 +-
+ gcc/configure.ac | 2 +-
+ gcc/dwarf2out.cc | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 557ea5fa3ac9..3d301b6ecd3d 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -31398,7 +31398,7 @@ esac
+ case "$cpu_type" in
+ aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
+ | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
+- | visium | xstormy16 | xtensa)
++ | visium | xstormy16 | xtensa | ft32)
+ insn="nop"
+ ;;
+ ia64 | s390)
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index eaa01d0d7e56..8a2d2b0438e7 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5610,7 +5610,7 @@ esac
+ case "$cpu_type" in
+ aarch64 | alpha | arc | arm | avr | bfin | cris | csky | i386 | loongarch | m32c \
+ | m68k | microblaze | mips | nds32 | nios2 | pa | riscv | rs6000 | score | sparc \
+- | visium | xstormy16 | xtensa)
++ | visium | xstormy16 | xtensa | ft32)
+ insn="nop"
+ ;;
+ ia64 | s390)
+diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
+index 633900b035fe..3f040da33a63 100644
+--- a/gcc/dwarf2out.cc
++++ b/gcc/dwarf2out.cc
+@@ -28939,7 +28939,7 @@ dwarf2out_set_ignored_loc (unsigned int line, unsigned int column,
+ dw_fde_ref fde = cfun->fde;
+
+ fde->ignored_debug = false;
+- set_cur_line_info_table (function_section (fde->decl));
++ set_cur_line_info_table (current_function_section ());
+
+ dwarf2out_source_line (line, column, filename, 0, true);
+ }
+
+base-commit: b4ac2c23d8745d98984954e88f02aa73f1c3594b
+--
+2.46.0
+
diff --git a/15.0.0/gentoo/33_all_PR116348-vect.patch b/15.0.0/gentoo/33_all_PR116348-vect.patch
new file mode 100644
index 0000000..623ce34
--- /dev/null
+++ b/15.0.0/gentoo/33_all_PR116348-vect.patch
@@ -0,0 +1,78 @@
+https://gcc.gnu.org/PR116348
+https://inbox.sourceware.org/gcc-patches/20240825185348.37025-1-xry111@xry111.site/T/#u
+
+From cc68092ef1bb1134f6d8ddf0281323658a4358ae Mon Sep 17 00:00:00 2001
+Message-ID: <cc68092ef1bb1134f6d8ddf0281323658a4358ae.1724653336.git.sam@gentoo.org>
+From: Xi Ruoyao <xry111@xry111.site>
+Date: Mon, 26 Aug 2024 02:53:13 +0800
+Subject: [PATCH] vect: Fix STMT_VINFO_DEF_TYPE check for odd/even widen mult
+ [PR116348]
+
+After fixing PR116142 some code started to trigger an ICE with -O3
+-march=znver4. Per Richard Biener who actually made this fix:
+
+"supportable_widening_operation fails at transform time - that's likely
+because vectorizable_reduction "puns" defs to internal_def"
+
+so the check should use STMT_VINFO_REDUC_DEF instead of checking if
+STMT_VINFO_DEF_TYPE is vect_reduction_def.
+
+gcc/ChangeLog:
+
+ PR tree-optimization/PR116348
+ * tree-vect-stmts.cc (supportable_widening_operation): Use
+ STMT_VINFO_REDUC_DEF (x) instead of
+ STMT_VINFO_DEF_TYPE (x) == vect_reduction_def.
+
+gcc/testsuite/ChangeLog:
+
+ PR tree-optimization/PR116348
+ * gcc.c-torture/compile/pr116438.c: New test.
+
+Co-authored-by: Richard Biener <rguenther@suse.de>
+---
+ gcc/testsuite/gcc.c-torture/compile/pr116438.c | 14 ++++++++++++++
+ gcc/tree-vect-stmts.cc | 3 +--
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr116438.c
+
+diff --git a/gcc/testsuite/gcc.c-torture/compile/pr116438.c b/gcc/testsuite/gcc.c-torture/compile/pr116438.c
+new file mode 100644
+index 000000000000..97ab0181ab8b
+--- /dev/null
++++ b/gcc/testsuite/gcc.c-torture/compile/pr116438.c
+@@ -0,0 +1,14 @@
++/* { dg-additional-options "-march=znver4" { target x86_64-*-* i?86-*-* } } */
++
++int *a;
++int b;
++long long c, d;
++void
++e (int f)
++{
++ for (; f; f++)
++ {
++ d += (long long)a[f] * b;
++ c += (long long)a[f] * 3;
++ }
++}
+diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
+index 385e63163c24..9eb73a599339 100644
+--- a/gcc/tree-vect-stmts.cc
++++ b/gcc/tree-vect-stmts.cc
+@@ -14193,8 +14193,7 @@ supportable_widening_operation (vec_info *vinfo,
+ by STMT is only directly used in the reduction statement. */
+ tree lhs = gimple_assign_lhs (vect_orig_stmt (stmt_info)->stmt);
+ stmt_vec_info use_stmt_info = loop_info->lookup_single_use (lhs);
+- if (use_stmt_info
+- && STMT_VINFO_DEF_TYPE (use_stmt_info) == vect_reduction_def)
++ if (use_stmt_info && STMT_VINFO_REDUC_DEF (use_stmt_info))
+ return true;
+ }
+ c1 = VEC_WIDEN_MULT_LO_EXPR;
+
+base-commit: b4ac2c23d8745d98984954e88f02aa73f1c3594b
+prerequisite-patch-id: 743f4e4444f9cac24e67abce2bda52d6a421d870
+--
+2.46.0
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 76096c4..728080e 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,8 +1,10 @@
-11 ????
+11 26 August 2024
- 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
- 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
+ 09_all_esysroot.patch
+ + 32_all_PR116470-debug-bootstrap.patch
+ + 33_all_PR116348-vect.patch
10 19 August 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-23 13:51 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-23 13:51 UTC (permalink / raw
To: gentoo-commits
commit: fec800d970afa89845479d5d6ad58140eaae5035
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 07:57:11 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 23 13:51:19 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=fec800d9
15.0.0: add 09_all_esysroot.patch
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/09_all_esysroot.patch | 67 +++++++++++++++++++++++++++++++++++++
15.0.0/gentoo/README.history | 1 +
2 files changed, 68 insertions(+)
diff --git a/15.0.0/gentoo/09_all_esysroot.patch b/15.0.0/gentoo/09_all_esysroot.patch
new file mode 100644
index 0000000..80e0561
--- /dev/null
+++ b/15.0.0/gentoo/09_all_esysroot.patch
@@ -0,0 +1,67 @@
+From 71e048084d32811f6e17e73b6ebadfe550ef1193 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Sun, 4 Aug 2024 17:02:06 +0100
+Subject: [PATCH] Allow setting target sysroot with ESYSROOT env var for
+ cross-compilers
+
+The variable is ignored for native compilers. The --sysroot command line
+option takes precedence.
+
+Signed-off-by: James Le Cuirot <chewi@gentoo.org>
+---
+ gcc/doc/invoke.texi | 10 ++++++++++
+ gcc/gcc.cc | 10 ++++++++++
+ 2 files changed, 20 insertions(+)
+
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index 0fe99ca8e..434cf30e2 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -19230,6 +19230,10 @@ for this option. If your linker does not support this option, the
+ header file aspect of @option{--sysroot} still works, but the
+ library aspect does not.
+
++On Gentoo Linux, this option can also be set for cross-compilers using the
++@env{ESYSROOT} environmnent variable. The variable is ignored for native
++compilers. The command line option takes precedence.
++
+ @opindex no-sysroot-suffix
+ @item --no-sysroot-suffix
+ For some targets, a suffix is added to the root directory specified
+@@ -37657,6 +37661,12 @@ using GCC also uses these directories when searching for ordinary
+ libraries for the @option{-l} option (but directories specified with
+ @option{-L} come first).
+
++@vindex ESYSROOT
++@item ESYSROOT
++On Gentoo Linux, this variable sets the logical root directory for headers and
++libraries for cross-compilers. It is ignored for native compilers. The
++@option{--sysroot} option takes precedence.
++
+ @vindex LANG
+ @cindex locale definition
+ @item LANG
+diff --git a/gcc/gcc.cc b/gcc/gcc.cc
+index abdb40bfe..956363ddb 100644
+--- a/gcc/gcc.cc
++++ b/gcc/gcc.cc
+@@ -5516,6 +5516,16 @@ process_command (unsigned int decoded_options_count,
+ "BINUTILS", PREFIX_PRIORITY_LAST, 0, 1);
+ free (tooldir_prefix);
+
++ if (*cross_compile == '1' && !target_system_root_changed)
++ {
++ const char *esysroot = env.get("ESYSROOT");
++ if (esysroot && esysroot[0] != '\0' && strcmp(esysroot, "/") != 0 && (!target_system_root || strcmp(esysroot, target_system_root) != 0))
++ {
++ target_system_root = esysroot;
++ target_system_root_changed = 1;
++ }
++ }
++
+ #if defined(TARGET_SYSTEM_ROOT_RELOCATABLE) && !defined(VMS)
+ /* If the normal TARGET_SYSTEM_ROOT is inside of $exec_prefix,
+ then consider it to relocate with the rest of the GCC installation
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 82e55aa..76096c4 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -2,6 +2,7 @@
- 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
- 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
+ + 09_all_esysroot.patch
10 19 August 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-20 20:31 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-20 20:31 UTC (permalink / raw
To: gentoo-commits
commit: c9cf4331e4dfb52d6752adf48c161060fe6ef00a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 20 20:30:42 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Aug 20 20:30:42 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c9cf4331
15.0.0: drop now-upstream phiopt patches
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-for-non-const-functions-for-factor_out_c.patch | 100 ---------------------
...ct-non-gimple-val-inside-factor_out_condi.patch | 64 -------------
15.0.0/gentoo/README.history | 5 ++
3 files changed, 5 insertions(+), 164 deletions(-)
diff --git a/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch b/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
deleted file mode 100644
index 1920001..0000000
--- a/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
+++ /dev/null
@@ -1,100 +0,0 @@
-From 8d5c584e088109e39402221f59c2330b24bed142 Mon Sep 17 00:00:00 2001
-Message-ID: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
-From: Andrew Pinski <quic_apinski@quicinc.com>
-Date: Mon, 19 Aug 2024 11:37:13 -0700
-Subject: [PATCH 1/2] phi-opt: Fix for non-const functions for
- factor_out_conditional_operation [PR 116409]
-
-Currently maybe_push_res_to_seq does not handle non-const builtins (it does handle internal
-functions though). So we need to disable factoring out non-const builtins. This will be fixed in
-a better way later but this fixes the regression at hand and does not change what was goal on
-moving factor_out_conditional_operation over to use gimple_match_op.
-
-Bootstrapped and tested on x86_64-linux-gnu with no regressions.
-
- PR tree-optimization/116409
-
-gcc/ChangeLog:
-
- * tree-ssa-phiopt.cc (factor_out_conditional_operation): Reject
- non const builtins (except for internal functions).
-
-gcc/testsuite/ChangeLog:
-
- * gcc.dg/torture/pr116409-1.c: New test.
- * gcc.dg/torture/pr116409-2.c: New test.
-
-Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
----
- gcc/testsuite/gcc.dg/torture/pr116409-1.c | 7 +++++++
- gcc/testsuite/gcc.dg/torture/pr116409-2.c | 7 +++++++
- gcc/tree-ssa-phiopt.cc | 18 ++++++++++++++++++
- 3 files changed, 32 insertions(+)
- create mode 100644 gcc/testsuite/gcc.dg/torture/pr116409-1.c
- create mode 100644 gcc/testsuite/gcc.dg/torture/pr116409-2.c
-
-diff --git a/gcc/testsuite/gcc.dg/torture/pr116409-1.c b/gcc/testsuite/gcc.dg/torture/pr116409-1.c
-new file mode 100644
-index 000000000000..7bf8d49c9a01
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr116409-1.c
-@@ -0,0 +1,7 @@
-+/* { dg-do compile } */
-+/* { dg-additional-options "-frounding-math -fno-math-errno" } */
-+double f(int c, double a, double b) {
-+ if (c)
-+ return __builtin_sqrt(a);
-+ return __builtin_sqrt(b);
-+}
-diff --git a/gcc/testsuite/gcc.dg/torture/pr116409-2.c b/gcc/testsuite/gcc.dg/torture/pr116409-2.c
-new file mode 100644
-index 000000000000..c27f11312d98
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr116409-2.c
-@@ -0,0 +1,7 @@
-+/* { dg-do compile } */
-+
-+int f (int t, char *a, char *b) {
-+ if (t)
-+ return __builtin_strlen (a);
-+ return __builtin_strlen (b);
-+}
-diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
-index 2d4aba5b0872..770f3629fe1d 100644
---- a/gcc/tree-ssa-phiopt.cc
-+++ b/gcc/tree-ssa-phiopt.cc
-@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
- #include "dbgcnt.h"
- #include "tree-ssa-propagate.h"
- #include "tree-ssa-dce.h"
-+#include "calls.h"
-
- /* Return the singleton PHI in the SEQ of PHIs for edges E0 and E1. */
-
-@@ -367,6 +368,23 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi,
- if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
- return NULL;
-
-+ /* Function calls can only be const or an internal function
-+ as maybe_push_res_to_seq only handles those currently. */
-+ if (!arg0_op.code.is_tree_code ())
-+ {
-+ auto fn = combined_fn (arg0_op.code);
-+ if (!internal_fn_p (fn))
-+ {
-+ tree decl = builtin_decl_implicit (as_builtin_fn (fn));
-+ if (!decl)
-+ return NULL;
-+
-+ /* Non-const functions are not supported currently. */
-+ if (!(flags_from_decl_or_type (decl) & ECF_CONST))
-+ return NULL;
-+ }
-+ }
-+
- /* Create a new PHI stmt. */
- result = PHI_RESULT (phi);
- temp = make_ssa_name (TREE_TYPE (new_arg0), NULL);
---
-2.46.0
-
diff --git a/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch b/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
deleted file mode 100644
index b3f96ae..0000000
--- a/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From 555a5e896480884c3fe2c6c117654a798b8ffd3f Mon Sep 17 00:00:00 2001
-Message-ID: <555a5e896480884c3fe2c6c117654a798b8ffd3f.1724092858.git.sam@gentoo.org>
-In-Reply-To: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
-References: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
-From: Andrew Pinski <quic_apinski@quicinc.com>
-Date: Mon, 19 Aug 2024 11:37:14 -0700
-Subject: [PATCH 2/2] phiopt: Reject non gimple val inside
- factor_out_conditional_operation [PR116412]
-
-After the conversion to use maybe_push_res_to_seq, sometimes (REALPART_EXPR
-and IMAGPART_EXPR and VCE) the argument will not be a gimple value and
-then phiopt here would create an invalid PHI.
-Just add a check for gimple val is the way to fix this.
-
-Bootstrapped and tested on x86_64-linux-gnu.
-
- PR tree-optimization/116412
-
-gcc/ChangeLog:
-
- * tree-ssa-phiopt.cc (factor_out_conditional_operation): Make sure new_arg0
- and new_arg1 are both gimple values.
-
-gcc/testsuite/ChangeLog:
-
- * gcc.dg/torture/pr116412-1.c: New test.
-
-Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
----
- gcc/testsuite/gcc.dg/torture/pr116412-1.c | 6 ++++++
- gcc/tree-ssa-phiopt.cc | 4 ++++
- 2 files changed, 10 insertions(+)
- create mode 100644 gcc/testsuite/gcc.dg/torture/pr116412-1.c
-
-diff --git a/gcc/testsuite/gcc.dg/torture/pr116412-1.c b/gcc/testsuite/gcc.dg/torture/pr116412-1.c
-new file mode 100644
-index 000000000000..3bc26ecd8b83
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/torture/pr116412-1.c
-@@ -0,0 +1,6 @@
-+/* { dg-do compile } */
-+double f(_Complex double a, _Complex double *b, int c)
-+{
-+ if (c) return __real__ a;
-+ return __real__ *b;
-+}
-diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
-index 770f3629fe1d..be95798a065b 100644
---- a/gcc/tree-ssa-phiopt.cc
-+++ b/gcc/tree-ssa-phiopt.cc
-@@ -368,6 +368,10 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi,
- if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
- return NULL;
-
-+ /* The new args need to be both gimple values. */
-+ if (!is_gimple_val (new_arg0) || !is_gimple_val (new_arg1))
-+ return NULL;
-+
- /* Function calls can only be const or an internal function
- as maybe_push_res_to_seq only handles those currently. */
- if (!arg0_op.code.is_tree_code ())
---
-2.46.0
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 0c430eb..82e55aa 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+11 ????
+
+ - 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
+ - 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
+
10 19 August 2024
+ 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-19 18:43 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-19 18:43 UTC (permalink / raw
To: gentoo-commits
commit: b151680d1549ca7429f970c87b7c11987a351527
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 19 18:42:11 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 19 18:42:11 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b151680d
15.0.0: pull in phiopt fixes
Bug: https://bugs.gentoo.org/938203
Bug: https://bugs.gentoo.org/938200
Bug: https://bugs.gentoo.org/938199
Bug: https://bugs.gentoo.org/938198
Bug: https://bugs.gentoo.org/938196
Bug: https://bugs.gentoo.org/938194
Bug: https://bugs.gentoo.org/938193
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-for-non-const-functions-for-factor_out_c.patch | 100 +++++++++++++++++++++
...ct-non-gimple-val-inside-factor_out_condi.patch | 64 +++++++++++++
15.0.0/gentoo/README.history | 5 +-
3 files changed, 167 insertions(+), 2 deletions(-)
diff --git a/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch b/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
new file mode 100644
index 0000000..1920001
--- /dev/null
+++ b/15.0.0/gentoo/32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
@@ -0,0 +1,100 @@
+From 8d5c584e088109e39402221f59c2330b24bed142 Mon Sep 17 00:00:00 2001
+Message-ID: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
+From: Andrew Pinski <quic_apinski@quicinc.com>
+Date: Mon, 19 Aug 2024 11:37:13 -0700
+Subject: [PATCH 1/2] phi-opt: Fix for non-const functions for
+ factor_out_conditional_operation [PR 116409]
+
+Currently maybe_push_res_to_seq does not handle non-const builtins (it does handle internal
+functions though). So we need to disable factoring out non-const builtins. This will be fixed in
+a better way later but this fixes the regression at hand and does not change what was goal on
+moving factor_out_conditional_operation over to use gimple_match_op.
+
+Bootstrapped and tested on x86_64-linux-gnu with no regressions.
+
+ PR tree-optimization/116409
+
+gcc/ChangeLog:
+
+ * tree-ssa-phiopt.cc (factor_out_conditional_operation): Reject
+ non const builtins (except for internal functions).
+
+gcc/testsuite/ChangeLog:
+
+ * gcc.dg/torture/pr116409-1.c: New test.
+ * gcc.dg/torture/pr116409-2.c: New test.
+
+Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
+---
+ gcc/testsuite/gcc.dg/torture/pr116409-1.c | 7 +++++++
+ gcc/testsuite/gcc.dg/torture/pr116409-2.c | 7 +++++++
+ gcc/tree-ssa-phiopt.cc | 18 ++++++++++++++++++
+ 3 files changed, 32 insertions(+)
+ create mode 100644 gcc/testsuite/gcc.dg/torture/pr116409-1.c
+ create mode 100644 gcc/testsuite/gcc.dg/torture/pr116409-2.c
+
+diff --git a/gcc/testsuite/gcc.dg/torture/pr116409-1.c b/gcc/testsuite/gcc.dg/torture/pr116409-1.c
+new file mode 100644
+index 000000000000..7bf8d49c9a01
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr116409-1.c
+@@ -0,0 +1,7 @@
++/* { dg-do compile } */
++/* { dg-additional-options "-frounding-math -fno-math-errno" } */
++double f(int c, double a, double b) {
++ if (c)
++ return __builtin_sqrt(a);
++ return __builtin_sqrt(b);
++}
+diff --git a/gcc/testsuite/gcc.dg/torture/pr116409-2.c b/gcc/testsuite/gcc.dg/torture/pr116409-2.c
+new file mode 100644
+index 000000000000..c27f11312d98
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr116409-2.c
+@@ -0,0 +1,7 @@
++/* { dg-do compile } */
++
++int f (int t, char *a, char *b) {
++ if (t)
++ return __builtin_strlen (a);
++ return __builtin_strlen (b);
++}
+diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
+index 2d4aba5b0872..770f3629fe1d 100644
+--- a/gcc/tree-ssa-phiopt.cc
++++ b/gcc/tree-ssa-phiopt.cc
+@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "dbgcnt.h"
+ #include "tree-ssa-propagate.h"
+ #include "tree-ssa-dce.h"
++#include "calls.h"
+
+ /* Return the singleton PHI in the SEQ of PHIs for edges E0 and E1. */
+
+@@ -367,6 +368,23 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi,
+ if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
+ return NULL;
+
++ /* Function calls can only be const or an internal function
++ as maybe_push_res_to_seq only handles those currently. */
++ if (!arg0_op.code.is_tree_code ())
++ {
++ auto fn = combined_fn (arg0_op.code);
++ if (!internal_fn_p (fn))
++ {
++ tree decl = builtin_decl_implicit (as_builtin_fn (fn));
++ if (!decl)
++ return NULL;
++
++ /* Non-const functions are not supported currently. */
++ if (!(flags_from_decl_or_type (decl) & ECF_CONST))
++ return NULL;
++ }
++ }
++
+ /* Create a new PHI stmt. */
+ result = PHI_RESULT (phi);
+ temp = make_ssa_name (TREE_TYPE (new_arg0), NULL);
+--
+2.46.0
+
diff --git a/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch b/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
new file mode 100644
index 0000000..b3f96ae
--- /dev/null
+++ b/15.0.0/gentoo/33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
@@ -0,0 +1,64 @@
+From 555a5e896480884c3fe2c6c117654a798b8ffd3f Mon Sep 17 00:00:00 2001
+Message-ID: <555a5e896480884c3fe2c6c117654a798b8ffd3f.1724092858.git.sam@gentoo.org>
+In-Reply-To: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
+References: <8d5c584e088109e39402221f59c2330b24bed142.1724092858.git.sam@gentoo.org>
+From: Andrew Pinski <quic_apinski@quicinc.com>
+Date: Mon, 19 Aug 2024 11:37:14 -0700
+Subject: [PATCH 2/2] phiopt: Reject non gimple val inside
+ factor_out_conditional_operation [PR116412]
+
+After the conversion to use maybe_push_res_to_seq, sometimes (REALPART_EXPR
+and IMAGPART_EXPR and VCE) the argument will not be a gimple value and
+then phiopt here would create an invalid PHI.
+Just add a check for gimple val is the way to fix this.
+
+Bootstrapped and tested on x86_64-linux-gnu.
+
+ PR tree-optimization/116412
+
+gcc/ChangeLog:
+
+ * tree-ssa-phiopt.cc (factor_out_conditional_operation): Make sure new_arg0
+ and new_arg1 are both gimple values.
+
+gcc/testsuite/ChangeLog:
+
+ * gcc.dg/torture/pr116412-1.c: New test.
+
+Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
+---
+ gcc/testsuite/gcc.dg/torture/pr116412-1.c | 6 ++++++
+ gcc/tree-ssa-phiopt.cc | 4 ++++
+ 2 files changed, 10 insertions(+)
+ create mode 100644 gcc/testsuite/gcc.dg/torture/pr116412-1.c
+
+diff --git a/gcc/testsuite/gcc.dg/torture/pr116412-1.c b/gcc/testsuite/gcc.dg/torture/pr116412-1.c
+new file mode 100644
+index 000000000000..3bc26ecd8b83
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/torture/pr116412-1.c
+@@ -0,0 +1,6 @@
++/* { dg-do compile } */
++double f(_Complex double a, _Complex double *b, int c)
++{
++ if (c) return __real__ a;
++ return __real__ *b;
++}
+diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
+index 770f3629fe1d..be95798a065b 100644
+--- a/gcc/tree-ssa-phiopt.cc
++++ b/gcc/tree-ssa-phiopt.cc
+@@ -368,6 +368,10 @@ factor_out_conditional_operation (edge e0, edge e1, gphi *phi,
+ if (!types_compatible_p (TREE_TYPE (new_arg0), TREE_TYPE (new_arg1)))
+ return NULL;
+
++ /* The new args need to be both gimple values. */
++ if (!is_gimple_val (new_arg0) || !is_gimple_val (new_arg1))
++ return NULL;
++
+ /* Function calls can only be const or an internal function
+ as maybe_push_res_to_seq only handles those currently. */
+ if (!arg0_op.code.is_tree_code ())
+--
+2.46.0
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 1849089..0c430eb 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,6 +1,7 @@
-10 ????
+10 19 August 2024
- + 32_all_genoutput-speedup.patch
+ + 32_all_phi-opt-Fix-for-non-const-functions-for-factor_out_c.patch
+ + 33_all_phiopt-Reject-non-gimple-val-inside-factor_out_condi.patch
9 11 August 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-14 9:48 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-14 9:48 UTC (permalink / raw
To: gentoo-commits
commit: b16c59c4a4df5f65d486023aedc4c5c7deef4f15
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 14 09:48:15 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 14 09:48:15 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b16c59c4
15.0.0: drop now-upstream 32_all_genoutput-speedup.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/32_all_genoutput-speedup.patch | 247 ---------------------------
1 file changed, 247 deletions(-)
diff --git a/15.0.0/gentoo/32_all_genoutput-speedup.patch b/15.0.0/gentoo/32_all_genoutput-speedup.patch
deleted file mode 100644
index a379bf8..0000000
--- a/15.0.0/gentoo/32_all_genoutput-speedup.patch
+++ /dev/null
@@ -1,247 +0,0 @@
-https://inbox.sourceware.org/gcc-patches/20240814021909.37082-1-cooper.qu@linux.alibaba.com/
-
-From 23ea354ab6c1faf858120b65a0114c5d0bbeaf6e Mon Sep 17 00:00:00 2001
-Message-ID: <23ea354ab6c1faf858120b65a0114c5d0bbeaf6e.1723604026.git.sam@gentoo.org>
-From: Xianmiao Qu <cooper.qu@linux.alibaba.com>
-Date: Wed, 14 Aug 2024 10:19:09 +0800
-Subject: [PATCH] genoutput: Accelerate the place_operands function.
-
-With the increase in the number of modes and patterns for some
-backend architectures, the place_operands function becomes a
-bottleneck int the speed of genoutput, and may even become a
-bottleneck int the overall speed of building the GCC project.
-This patch aims to accelerate the place_operands function,
-the optimizations it includes are:
-1. Use a hash table to store operand information,
- improving the lookup time for the first operand.
-2. Move mode comparison to the beginning to avoid the scenarios of most strcmp.
-
-I tested the speed improvements for the following backends,
- Improvement Ratio
-x86_64 197.9%
-aarch64 954.5%
-riscv 2578.6%
-If the build machine is slow, then this improvement can save a lot of time.
-
-I tested the genoutput output for x86_64/aarch64/riscv backends,
-and there was no difference compared to before the optimization,
-so this shouldn't introduce any functional issues.
-
-gcc/
- * genoutput.cc (struct operand_data): Add member 'eq_next' to
- point to the next member with the same hash value in the
- hash table.
- (compare_operands): Move the comparison of the mode to the very
- beginning to accelerate the comparison of the two operands.
- (struct operand_data_hasher): New, a class that takes into account
- the necessary elements for comparing the equality of two operands
- in its hash value.
- (operand_data_hasher::hash): New.
- (operand_data_hasher::equal): New.
- (operand_datas): New, hash table of konwn pattern operands.
- (place_operands): Use a hash table instead of traversing the array
- to find the same operand.
- (main): Add initialization of the hash table 'operand_datas'.
----
- gcc/genoutput.cc | 111 +++++++++++++++++++++++++++++++++++++----------
- 1 file changed, 88 insertions(+), 23 deletions(-)
-
-diff --git a/gcc/genoutput.cc b/gcc/genoutput.cc
-index efd81766bb5b..16fd811b5dd5 100644
---- a/gcc/genoutput.cc
-+++ b/gcc/genoutput.cc
-@@ -91,6 +91,7 @@ along with GCC; see the file COPYING3. If not see
- #include "errors.h"
- #include "read-md.h"
- #include "gensupport.h"
-+#include "hash-table.h"
-
- /* No instruction can have more operands than this. Sorry for this
- arbitrary limit, but what machine will have an instruction with
-@@ -112,6 +113,8 @@ static int next_operand_number = 1;
- struct operand_data
- {
- struct operand_data *next;
-+ /* Point to the next member with the same hash value in the hash table. */
-+ struct operand_data *eq_next;
- int index;
- const char *predicate;
- const char *constraint;
-@@ -127,7 +130,7 @@ struct operand_data
-
- static struct operand_data null_operand =
- {
-- 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
-+ 0, 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
- };
-
- static struct operand_data *odata = &null_operand;
-@@ -174,8 +177,8 @@ static void output_operand_data (void);
- static void output_insn_data (void);
- static void output_get_insn_name (void);
- static void scan_operands (class data *, rtx, int, int);
--static int compare_operands (struct operand_data *,
-- struct operand_data *);
-+static int compare_operands (const struct operand_data *,
-+ const struct operand_data *);
- static void place_operands (class data *);
- static void process_template (class data *, const char *);
- static void validate_insn_alternatives (class data *);
-@@ -528,10 +531,18 @@ scan_operands (class data *d, rtx part, int this_address_p,
- /* Compare two operands for content equality. */
-
- static int
--compare_operands (struct operand_data *d0, struct operand_data *d1)
-+compare_operands (const struct operand_data *d0,
-+ const struct operand_data *d1)
- {
- const char *p0, *p1;
-
-+ /* On one hand, comparing strings for predicate and constraint
-+ is time-consuming, and on the other hand, the probability of
-+ different modes is relatively high. Therefore, checking the mode
-+ first can speed up the execution of the program. */
-+ if (d0->mode != d1->mode)
-+ return 0;
-+
- p0 = d0->predicate;
- if (!p0)
- p0 = "";
-@@ -550,9 +561,6 @@ compare_operands (struct operand_data *d0, struct operand_data *d1)
- if (strcmp (p0, p1) != 0)
- return 0;
-
-- if (d0->mode != d1->mode)
-- return 0;
--
- if (d0->strict_low != d1->strict_low)
- return 0;
-
-@@ -562,6 +570,46 @@ compare_operands (struct operand_data *d0, struct operand_data *d1)
- return 1;
- }
-
-+/* This is a class that takes into account the necessary elements for
-+ comparing the equality of two operands in its hash value. */
-+struct operand_data_hasher : nofree_ptr_hash <operand_data>
-+{
-+ static inline hashval_t hash (const operand_data *);
-+ static inline bool equal (const operand_data *, const operand_data *);
-+};
-+
-+hashval_t
-+operand_data_hasher::hash (const operand_data * op_info)
-+{
-+ inchash::hash h;
-+ const char *pred, *cons;
-+
-+ pred = op_info->predicate;
-+ if (!pred)
-+ pred = "";
-+ h.add (pred, strlen (pred) + 1);
-+
-+ cons = op_info->constraint;
-+ if (!cons)
-+ cons = "";
-+ h.add (cons, strlen (cons) + 1);
-+
-+ h.add_object (op_info->mode);
-+ h.add_object (op_info->strict_low);
-+ h.add_object (op_info->eliminable);
-+ return h.end ();
-+}
-+
-+bool
-+operand_data_hasher::equal (const operand_data * op_info1,
-+ const operand_data * op_info2)
-+{
-+ return compare_operands (op_info1, op_info2);
-+}
-+
-+/* Hashtable of konwn pattern operands. */
-+static hash_table<operand_data_hasher> *operand_datas;
-+
- /* Scan the list of operands we've already committed to output and either
- find a subsequence that is the same, or allocate a new one at the end. */
-
-@@ -569,6 +617,7 @@ static void
- place_operands (class data *d)
- {
- struct operand_data *od, *od2;
-+ struct operand_data **slot;
- int i;
-
- if (d->n_operands == 0)
-@@ -577,23 +626,24 @@ place_operands (class data *d)
- return;
- }
-
-+ od = operand_datas->find (&d->operand[0]);
- /* Brute force substring search. */
-- for (od = odata, i = 0; od; od = od->next, i = 0)
-- if (compare_operands (od, &d->operand[0]))
-- {
-- od2 = od->next;
-- i = 1;
-- while (1)
-- {
-- if (i == d->n_operands)
-- goto full_match;
-- if (od2 == NULL)
-- goto partial_match;
-- if (! compare_operands (od2, &d->operand[i]))
-- break;
-- ++i, od2 = od2->next;
-- }
-- }
-+ for (; od; od = od->eq_next)
-+ {
-+ od2 = od->next;
-+ i = 1;
-+ while (1)
-+ {
-+ if (i == d->n_operands)
-+ goto full_match;
-+ if (od2 == NULL)
-+ goto partial_match;
-+ if (! compare_operands (od2, &d->operand[i]))
-+ break;
-+ ++i, od2 = od2->next;
-+ }
-+ }
-+ i = 0;
-
- /* Either partial match at the end of the list, or no match. In either
- case, we tack on what operands are remaining to the end of the list. */
-@@ -605,6 +655,20 @@ place_operands (class data *d)
- *odata_end = od2;
- odata_end = &od2->next;
- od2->index = next_operand_number++;
-+ /* Insert the operand_data variable OD2 into the hash table.
-+ If a variable with the same hash value already exists in
-+ the hash table, insert the element at the end of the
-+ linked list connected through the eq_next member. */
-+ slot = operand_datas->find_slot (od2, INSERT);
-+ if (*slot)
-+ {
-+ struct operand_data *last = (struct operand_data *) *slot;
-+ while (last->eq_next)
-+ last = last->eq_next;
-+ last->eq_next = od2;
-+ }
-+ else
-+ *slot = od2;
- }
- *odata_end = NULL;
- return;
-@@ -1049,6 +1113,7 @@ main (int argc, const char **argv)
- progname = "genoutput";
-
- init_insn_for_nothing ();
-+ operand_datas = new hash_table<operand_data_hasher> (1024);
-
- if (!init_rtx_reader_args (argc, argv))
- return (FATAL_EXIT_CODE);
---
-2.45.2
-
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-14 2:57 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-14 2:57 UTC (permalink / raw
To: gentoo-commits
commit: 70f5adef33e0620d934fc7fb0822e592e3ff04a1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 14 02:57:02 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 14 02:57:02 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=70f5adef
15.0.0: add 32_all_genoutput-speedup.patch
Link: https://inbox.sourceware.org/gcc-patches/20240814021909.37082-1-cooper.qu <AT> linux.alibaba.com/
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/32_all_genoutput-speedup.patch | 247 +++++++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +
2 files changed, 251 insertions(+)
diff --git a/15.0.0/gentoo/32_all_genoutput-speedup.patch b/15.0.0/gentoo/32_all_genoutput-speedup.patch
new file mode 100644
index 0000000..a379bf8
--- /dev/null
+++ b/15.0.0/gentoo/32_all_genoutput-speedup.patch
@@ -0,0 +1,247 @@
+https://inbox.sourceware.org/gcc-patches/20240814021909.37082-1-cooper.qu@linux.alibaba.com/
+
+From 23ea354ab6c1faf858120b65a0114c5d0bbeaf6e Mon Sep 17 00:00:00 2001
+Message-ID: <23ea354ab6c1faf858120b65a0114c5d0bbeaf6e.1723604026.git.sam@gentoo.org>
+From: Xianmiao Qu <cooper.qu@linux.alibaba.com>
+Date: Wed, 14 Aug 2024 10:19:09 +0800
+Subject: [PATCH] genoutput: Accelerate the place_operands function.
+
+With the increase in the number of modes and patterns for some
+backend architectures, the place_operands function becomes a
+bottleneck int the speed of genoutput, and may even become a
+bottleneck int the overall speed of building the GCC project.
+This patch aims to accelerate the place_operands function,
+the optimizations it includes are:
+1. Use a hash table to store operand information,
+ improving the lookup time for the first operand.
+2. Move mode comparison to the beginning to avoid the scenarios of most strcmp.
+
+I tested the speed improvements for the following backends,
+ Improvement Ratio
+x86_64 197.9%
+aarch64 954.5%
+riscv 2578.6%
+If the build machine is slow, then this improvement can save a lot of time.
+
+I tested the genoutput output for x86_64/aarch64/riscv backends,
+and there was no difference compared to before the optimization,
+so this shouldn't introduce any functional issues.
+
+gcc/
+ * genoutput.cc (struct operand_data): Add member 'eq_next' to
+ point to the next member with the same hash value in the
+ hash table.
+ (compare_operands): Move the comparison of the mode to the very
+ beginning to accelerate the comparison of the two operands.
+ (struct operand_data_hasher): New, a class that takes into account
+ the necessary elements for comparing the equality of two operands
+ in its hash value.
+ (operand_data_hasher::hash): New.
+ (operand_data_hasher::equal): New.
+ (operand_datas): New, hash table of konwn pattern operands.
+ (place_operands): Use a hash table instead of traversing the array
+ to find the same operand.
+ (main): Add initialization of the hash table 'operand_datas'.
+---
+ gcc/genoutput.cc | 111 +++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 88 insertions(+), 23 deletions(-)
+
+diff --git a/gcc/genoutput.cc b/gcc/genoutput.cc
+index efd81766bb5b..16fd811b5dd5 100644
+--- a/gcc/genoutput.cc
++++ b/gcc/genoutput.cc
+@@ -91,6 +91,7 @@ along with GCC; see the file COPYING3. If not see
+ #include "errors.h"
+ #include "read-md.h"
+ #include "gensupport.h"
++#include "hash-table.h"
+
+ /* No instruction can have more operands than this. Sorry for this
+ arbitrary limit, but what machine will have an instruction with
+@@ -112,6 +113,8 @@ static int next_operand_number = 1;
+ struct operand_data
+ {
+ struct operand_data *next;
++ /* Point to the next member with the same hash value in the hash table. */
++ struct operand_data *eq_next;
+ int index;
+ const char *predicate;
+ const char *constraint;
+@@ -127,7 +130,7 @@ struct operand_data
+
+ static struct operand_data null_operand =
+ {
+- 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
++ 0, 0, 0, "", "", E_VOIDmode, 0, 0, 0, 0, 0
+ };
+
+ static struct operand_data *odata = &null_operand;
+@@ -174,8 +177,8 @@ static void output_operand_data (void);
+ static void output_insn_data (void);
+ static void output_get_insn_name (void);
+ static void scan_operands (class data *, rtx, int, int);
+-static int compare_operands (struct operand_data *,
+- struct operand_data *);
++static int compare_operands (const struct operand_data *,
++ const struct operand_data *);
+ static void place_operands (class data *);
+ static void process_template (class data *, const char *);
+ static void validate_insn_alternatives (class data *);
+@@ -528,10 +531,18 @@ scan_operands (class data *d, rtx part, int this_address_p,
+ /* Compare two operands for content equality. */
+
+ static int
+-compare_operands (struct operand_data *d0, struct operand_data *d1)
++compare_operands (const struct operand_data *d0,
++ const struct operand_data *d1)
+ {
+ const char *p0, *p1;
+
++ /* On one hand, comparing strings for predicate and constraint
++ is time-consuming, and on the other hand, the probability of
++ different modes is relatively high. Therefore, checking the mode
++ first can speed up the execution of the program. */
++ if (d0->mode != d1->mode)
++ return 0;
++
+ p0 = d0->predicate;
+ if (!p0)
+ p0 = "";
+@@ -550,9 +561,6 @@ compare_operands (struct operand_data *d0, struct operand_data *d1)
+ if (strcmp (p0, p1) != 0)
+ return 0;
+
+- if (d0->mode != d1->mode)
+- return 0;
+-
+ if (d0->strict_low != d1->strict_low)
+ return 0;
+
+@@ -562,6 +570,46 @@ compare_operands (struct operand_data *d0, struct operand_data *d1)
+ return 1;
+ }
+
++/* This is a class that takes into account the necessary elements for
++ comparing the equality of two operands in its hash value. */
++struct operand_data_hasher : nofree_ptr_hash <operand_data>
++{
++ static inline hashval_t hash (const operand_data *);
++ static inline bool equal (const operand_data *, const operand_data *);
++};
++
++hashval_t
++operand_data_hasher::hash (const operand_data * op_info)
++{
++ inchash::hash h;
++ const char *pred, *cons;
++
++ pred = op_info->predicate;
++ if (!pred)
++ pred = "";
++ h.add (pred, strlen (pred) + 1);
++
++ cons = op_info->constraint;
++ if (!cons)
++ cons = "";
++ h.add (cons, strlen (cons) + 1);
++
++ h.add_object (op_info->mode);
++ h.add_object (op_info->strict_low);
++ h.add_object (op_info->eliminable);
++ return h.end ();
++}
++
++bool
++operand_data_hasher::equal (const operand_data * op_info1,
++ const operand_data * op_info2)
++{
++ return compare_operands (op_info1, op_info2);
++}
++
++/* Hashtable of konwn pattern operands. */
++static hash_table<operand_data_hasher> *operand_datas;
++
+ /* Scan the list of operands we've already committed to output and either
+ find a subsequence that is the same, or allocate a new one at the end. */
+
+@@ -569,6 +617,7 @@ static void
+ place_operands (class data *d)
+ {
+ struct operand_data *od, *od2;
++ struct operand_data **slot;
+ int i;
+
+ if (d->n_operands == 0)
+@@ -577,23 +626,24 @@ place_operands (class data *d)
+ return;
+ }
+
++ od = operand_datas->find (&d->operand[0]);
+ /* Brute force substring search. */
+- for (od = odata, i = 0; od; od = od->next, i = 0)
+- if (compare_operands (od, &d->operand[0]))
+- {
+- od2 = od->next;
+- i = 1;
+- while (1)
+- {
+- if (i == d->n_operands)
+- goto full_match;
+- if (od2 == NULL)
+- goto partial_match;
+- if (! compare_operands (od2, &d->operand[i]))
+- break;
+- ++i, od2 = od2->next;
+- }
+- }
++ for (; od; od = od->eq_next)
++ {
++ od2 = od->next;
++ i = 1;
++ while (1)
++ {
++ if (i == d->n_operands)
++ goto full_match;
++ if (od2 == NULL)
++ goto partial_match;
++ if (! compare_operands (od2, &d->operand[i]))
++ break;
++ ++i, od2 = od2->next;
++ }
++ }
++ i = 0;
+
+ /* Either partial match at the end of the list, or no match. In either
+ case, we tack on what operands are remaining to the end of the list. */
+@@ -605,6 +655,20 @@ place_operands (class data *d)
+ *odata_end = od2;
+ odata_end = &od2->next;
+ od2->index = next_operand_number++;
++ /* Insert the operand_data variable OD2 into the hash table.
++ If a variable with the same hash value already exists in
++ the hash table, insert the element at the end of the
++ linked list connected through the eq_next member. */
++ slot = operand_datas->find_slot (od2, INSERT);
++ if (*slot)
++ {
++ struct operand_data *last = (struct operand_data *) *slot;
++ while (last->eq_next)
++ last = last->eq_next;
++ last->eq_next = od2;
++ }
++ else
++ *slot = od2;
+ }
+ *odata_end = NULL;
+ return;
+@@ -1049,6 +1113,7 @@ main (int argc, const char **argv)
+ progname = "genoutput";
+
+ init_insn_for_nothing ();
++ operand_datas = new hash_table<operand_data_hasher> (1024);
+
+ if (!init_rtx_reader_args (argc, argv))
+ return (FATAL_EXIT_CODE);
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 468a873..1849089 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+10 ????
+
+ + 32_all_genoutput-speedup.patch
+
9 11 August 2024
U 04_all_nossp-on-nostdlib.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-11 22:40 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-11 22:40 UTC (permalink / raw
To: gentoo-commits
commit: 743578d0de067c87f590c9886f14961bb429c1f4
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 11 22:40:21 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 11 22:40:21 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=743578d0
15.0.0: cut patchset 9
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 4b1d9e8..468a873 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-? ????
+9 11 August 2024
U 04_all_nossp-on-nostdlib.patch
- 07_all_libiberty-asprintf.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-09 19:54 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-09 19:54 UTC (permalink / raw
To: gentoo-commits
commit: 5a1f790fc4c95258c646243a30ba7adcecebcdcc
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 19:52:56 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 19:52:56 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=5a1f790f
15.0.0: drop obsolete asprintf patch
Fixed upstream by r10-14-g6b3a5e8a3d18c8 and r6-1038-gf50f17e6707da0.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/07_all_libiberty-asprintf.patch | 18 ------------------
15.0.0/gentoo/README.history | 2 +-
2 files changed, 1 insertion(+), 19 deletions(-)
diff --git a/15.0.0/gentoo/07_all_libiberty-asprintf.patch b/15.0.0/gentoo/07_all_libiberty-asprintf.patch
deleted file mode 100644
index 1ed2ba3..0000000
--- a/15.0.0/gentoo/07_all_libiberty-asprintf.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-2008-07-25 Magnus Granberg <zorry@ume.nu>
-
- * include/libiberty.h (asprintf): Don't declare if defined as a macro
-
---- a/include/libiberty.h
-+++ b/include/libiberty.h
-@@ -652,8 +652,11 @@ extern void *bsearch_r (const void *, const void *,
- /* Like sprintf but provides a pointer to malloc'd storage, which must
- be freed by the caller. */
-
-+/* asprintf may be declared as a macro by glibc with __USE_FORTIFY_LEVEL. */
-+#ifndef asprintf
- extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
- #endif
-+#endif
-
- /* Like asprintf but allocates memory without fail. This works like
- xmalloc. */
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 3c55551..3d561ee 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,7 +1,7 @@
? ????
+ - 07_all_libiberty-asprintf.patch
- 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
- + 32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
8 5 August 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-09 19:54 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-09 19:54 UTC (permalink / raw
To: gentoo-commits
commit: ecc3ba06c22edee6b22d2e8e5e05031d18fa372a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 19:54:09 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 19:54:22 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ecc3ba06
15.0.0: fix comment in 04_all_nossp-on-nostdlib.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/04_all_nossp-on-nostdlib.patch | 3 ++-
15.0.0/gentoo/README.history | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/04_all_nossp-on-nostdlib.patch b/15.0.0/gentoo/04_all_nossp-on-nostdlib.patch
index 30c5825..e17b6a3 100644
--- a/15.0.0/gentoo/04_all_nossp-on-nostdlib.patch
+++ b/15.0.0/gentoo/04_all_nossp-on-nostdlib.patch
@@ -1,4 +1,5 @@
-│Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
+Disable ssp on -nostdlib, -nodefaultlibs and -ffreestanding
+
https://bugs.gentoo.org/484714
--- a/gcc/gcc.cc
+++ b/gcc/gcc.cc
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 3d561ee..4b1d9e8 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,5 +1,6 @@
? ????
+ U 04_all_nossp-on-nostdlib.patch
- 07_all_libiberty-asprintf.patch
- 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-09 19:47 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-09 19:47 UTC (permalink / raw
To: gentoo-commits
commit: b1db6e989802fb46fb5d242f68e3edbc0f0b2cd0
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 19:46:45 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 19:46:45 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b1db6e98
15.0.0: drop LRA revert
It's now reverted upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...emit-caller-save-register-spills-before-c.patch | 101 ---------------------
1 file changed, 101 deletions(-)
diff --git a/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch b/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
deleted file mode 100644
index 6cd1b43..0000000
--- a/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From c67cc1d712f488a93d03dcfcda70e82250e13ab9 Mon Sep 17 00:00:00 2001
-Message-ID: <c67cc1d712f488a93d03dcfcda70e82250e13ab9.1723231445.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Fri, 9 Aug 2024 20:24:00 +0100
-Subject: [PATCH] Revert "lra: emit caller-save register spills before call
- insn [PR116028]"
-
-This reverts commit 3c67a0fa1dd39a3378deb854a7fef0ff7fe38004.
-
-See https://inbox.sourceware.org/gcc-patches/CA+=Sn1=_jL5P1Nbx4b7O-wYttpMsP4N545nk49rXntKnoJ7G-Q@mail.gmail.com/.
----
- gcc/lra-constraints.cc | 28 +++-----------------
- gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c | 2 +-
- gcc/testsuite/gcc.dg/pr10474.c | 2 +-
- 3 files changed, 6 insertions(+), 26 deletions(-)
-
-diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
-index 28c1a877c003..92b343fa99a0 100644
---- a/gcc/lra-constraints.cc
-+++ b/gcc/lra-constraints.cc
-@@ -152,9 +152,6 @@ static machine_mode curr_operand_mode[MAX_RECOG_OPERANDS];
- (e.g. constant) and whose subreg is given operand of the current
- insn. VOIDmode in all other cases. */
- static machine_mode original_subreg_reg_mode[MAX_RECOG_OPERANDS];
--/* The nearest call insn for an insn on which split transformation
-- will be done. The call insn is in the same EBB as the insn. */
--static rtx_insn *latest_call_insn;
-
- \f
-
-@@ -6289,25 +6286,10 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn,
- after_p ? restore : NULL,
- call_save_p
- ? "Add reg<-save" : "Add reg<-split");
-- if (call_save_p && latest_call_insn != NULL)
-- /* PR116028: If original_regno is a pseudo that has been assigned a
-- call-save hard register, then emit the spill insn before the call
-- insn 'latest_call_insn' instead of adjacent to 'insn'. If 'insn'
-- and 'latest_call_insn' belong to the same EBB but to two separate
-- BBs, and if 'insn' is present in the entry BB, then generating the
-- spill insn in the entry BB can prevent shrink wrap from happening.
-- This is because the spill insn references the stack pointer and
-- hence the prolog gets generated in the entry BB itself. It is
-- also more efficient to generate the spill before
-- 'latest_call_insn' as the spill now occurs only in the path
-- containing the call. */
-- lra_process_new_insns (PREV_INSN (latest_call_insn), NULL, save,
-- "Add save<-reg");
-- else
-- lra_process_new_insns (insn, before_p ? save : NULL,
-- before_p ? NULL : save,
-- call_save_p
-- ? "Add save<-reg" : "Add split<-reg");
-+ lra_process_new_insns (insn, before_p ? save : NULL,
-+ before_p ? NULL : save,
-+ call_save_p
-+ ? "Add save<-reg" : "Add split<-reg");
- if (nregs > 1 || original_regno < FIRST_PSEUDO_REGISTER)
- /* If we are trying to split multi-register. We should check
- conflicts on the next assignment sub-pass. IRA can allocate on
-@@ -6791,7 +6773,6 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
- last_processed_bb = NULL;
- CLEAR_HARD_REG_SET (potential_reload_hard_regs);
- live_hard_regs = eliminable_regset | lra_no_alloc_regs;
-- latest_call_insn = NULL;
- /* We don't process new insns generated in the loop. */
- for (curr_insn = tail; curr_insn != PREV_INSN (head); curr_insn = prev_insn)
- {
-@@ -7004,7 +6985,6 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
- last_call_for_abi[callee_abi.id ()] = calls_num;
- full_and_partial_call_clobbers
- |= callee_abi.full_and_partial_reg_clobbers ();
-- latest_call_insn = curr_insn;
- if ((cheap = find_reg_note (curr_insn,
- REG_RETURNED, NULL_RTX)) != NULL_RTX
- && ((cheap = XEXP (cheap, 0)), true)
-diff --git a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
-index 8c150972f952..a95637abbe54 100644
---- a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
-+++ b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
-@@ -26,4 +26,4 @@ bar (long a)
-
- /* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
- /* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! aarch64*-*-* } } } } */
--/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
-+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail powerpc*-*-* } } } */
-diff --git a/gcc/testsuite/gcc.dg/pr10474.c b/gcc/testsuite/gcc.dg/pr10474.c
-index b5393d5b6e3e..a4af536ec284 100644
---- a/gcc/testsuite/gcc.dg/pr10474.c
-+++ b/gcc/testsuite/gcc.dg/pr10474.c
-@@ -13,4 +13,4 @@ void f(int *i)
- }
-
- /* XFAIL due to PR70681. */
--/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* } } } */
-+/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* powerpc*-*-* } } } */
-
-base-commit: 9e4da946c4263a4c89d5fc365b3c97ae244c5018
---
-2.45.2
-
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-09 19:25 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-09 19:25 UTC (permalink / raw
To: gentoo-commits
commit: 3dcc61086076d7c86d43dbad5961fadf1b944d72
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 9 19:24:37 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 9 19:24:37 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3dcc6108
15.0.0: add revert of LRA patch
See https://inbox.sourceware.org/gcc-patches/CA+=Sn1=_jL5P1Nbx4b7O-wYttpMsP4N545nk49rXntKnoJ7G-Q <AT> mail.gmail.com/.
It breaks arm64 bootstrap at least.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...emit-caller-save-register-spills-before-c.patch | 101 +++++++++++++++++++++
15.0.0/gentoo/README.history | 1 +
2 files changed, 102 insertions(+)
diff --git a/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch b/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
new file mode 100644
index 0000000..6cd1b43
--- /dev/null
+++ b/15.0.0/gentoo/32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
@@ -0,0 +1,101 @@
+From c67cc1d712f488a93d03dcfcda70e82250e13ab9 Mon Sep 17 00:00:00 2001
+Message-ID: <c67cc1d712f488a93d03dcfcda70e82250e13ab9.1723231445.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Fri, 9 Aug 2024 20:24:00 +0100
+Subject: [PATCH] Revert "lra: emit caller-save register spills before call
+ insn [PR116028]"
+
+This reverts commit 3c67a0fa1dd39a3378deb854a7fef0ff7fe38004.
+
+See https://inbox.sourceware.org/gcc-patches/CA+=Sn1=_jL5P1Nbx4b7O-wYttpMsP4N545nk49rXntKnoJ7G-Q@mail.gmail.com/.
+---
+ gcc/lra-constraints.cc | 28 +++-----------------
+ gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c | 2 +-
+ gcc/testsuite/gcc.dg/pr10474.c | 2 +-
+ 3 files changed, 6 insertions(+), 26 deletions(-)
+
+diff --git a/gcc/lra-constraints.cc b/gcc/lra-constraints.cc
+index 28c1a877c003..92b343fa99a0 100644
+--- a/gcc/lra-constraints.cc
++++ b/gcc/lra-constraints.cc
+@@ -152,9 +152,6 @@ static machine_mode curr_operand_mode[MAX_RECOG_OPERANDS];
+ (e.g. constant) and whose subreg is given operand of the current
+ insn. VOIDmode in all other cases. */
+ static machine_mode original_subreg_reg_mode[MAX_RECOG_OPERANDS];
+-/* The nearest call insn for an insn on which split transformation
+- will be done. The call insn is in the same EBB as the insn. */
+-static rtx_insn *latest_call_insn;
+
+ \f
+
+@@ -6289,25 +6286,10 @@ split_reg (bool before_p, int original_regno, rtx_insn *insn,
+ after_p ? restore : NULL,
+ call_save_p
+ ? "Add reg<-save" : "Add reg<-split");
+- if (call_save_p && latest_call_insn != NULL)
+- /* PR116028: If original_regno is a pseudo that has been assigned a
+- call-save hard register, then emit the spill insn before the call
+- insn 'latest_call_insn' instead of adjacent to 'insn'. If 'insn'
+- and 'latest_call_insn' belong to the same EBB but to two separate
+- BBs, and if 'insn' is present in the entry BB, then generating the
+- spill insn in the entry BB can prevent shrink wrap from happening.
+- This is because the spill insn references the stack pointer and
+- hence the prolog gets generated in the entry BB itself. It is
+- also more efficient to generate the spill before
+- 'latest_call_insn' as the spill now occurs only in the path
+- containing the call. */
+- lra_process_new_insns (PREV_INSN (latest_call_insn), NULL, save,
+- "Add save<-reg");
+- else
+- lra_process_new_insns (insn, before_p ? save : NULL,
+- before_p ? NULL : save,
+- call_save_p
+- ? "Add save<-reg" : "Add split<-reg");
++ lra_process_new_insns (insn, before_p ? save : NULL,
++ before_p ? NULL : save,
++ call_save_p
++ ? "Add save<-reg" : "Add split<-reg");
+ if (nregs > 1 || original_regno < FIRST_PSEUDO_REGISTER)
+ /* If we are trying to split multi-register. We should check
+ conflicts on the next assignment sub-pass. IRA can allocate on
+@@ -6791,7 +6773,6 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
+ last_processed_bb = NULL;
+ CLEAR_HARD_REG_SET (potential_reload_hard_regs);
+ live_hard_regs = eliminable_regset | lra_no_alloc_regs;
+- latest_call_insn = NULL;
+ /* We don't process new insns generated in the loop. */
+ for (curr_insn = tail; curr_insn != PREV_INSN (head); curr_insn = prev_insn)
+ {
+@@ -7004,7 +6985,6 @@ inherit_in_ebb (rtx_insn *head, rtx_insn *tail)
+ last_call_for_abi[callee_abi.id ()] = calls_num;
+ full_and_partial_call_clobbers
+ |= callee_abi.full_and_partial_reg_clobbers ();
+- latest_call_insn = curr_insn;
+ if ((cheap = find_reg_note (curr_insn,
+ REG_RETURNED, NULL_RTX)) != NULL_RTX
+ && ((cheap = XEXP (cheap, 0)), true)
+diff --git a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
+index 8c150972f952..a95637abbe54 100644
+--- a/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
++++ b/gcc/testsuite/gcc.dg/ira-shrinkwrap-prep-1.c
+@@ -26,4 +26,4 @@ bar (long a)
+
+ /* { dg-final { scan-rtl-dump "Will split live ranges of parameters" "ira" } } */
+ /* { dg-final { scan-rtl-dump "Split live-range of register" "ira" { xfail { ! aarch64*-*-* } } } } */
+-/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" } } */
++/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail powerpc*-*-* } } } */
+diff --git a/gcc/testsuite/gcc.dg/pr10474.c b/gcc/testsuite/gcc.dg/pr10474.c
+index b5393d5b6e3e..a4af536ec284 100644
+--- a/gcc/testsuite/gcc.dg/pr10474.c
++++ b/gcc/testsuite/gcc.dg/pr10474.c
+@@ -13,4 +13,4 @@ void f(int *i)
+ }
+
+ /* XFAIL due to PR70681. */
+-/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* } } } */
++/* { dg-final { scan-rtl-dump "Performing shrink-wrapping" "pro_and_epilogue" { xfail arm*-*-* powerpc*-*-* } } } */
+
+base-commit: 9e4da946c4263a4c89d5fc365b3c97ae244c5018
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index a872a71..3c55551 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,6 +1,7 @@
? ????
- 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
+ + 32_all_Revert-lra-emit-caller-save-register-spills-before-c.patch
8 5 August 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-08 11:10 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-08 11:10 UTC (permalink / raw
To: gentoo-commits
commit: a8f25dda00d49c9a43b19d64fface4a570d6af07
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 8 11:09:50 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 8 11:09:50 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=a8f25dda
15.0.0: add commit ref to eclass change too to patch
See d4c98533530d9478391b0593fd84cf37ac9c97cb.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch | 2 ++
1 file changed, 2 insertions(+)
diff --git a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
index 89e5a8b..ba6d67f 100644
--- a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
+++ b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
@@ -1,5 +1,7 @@
https://inbox.sourceware.org/gcc-patches/87v80cn24t.fsf@gentoo.org/
+See also d4c98533530d9478391b0593fd84cf37ac9c97cb in ::gentoo.
+
From 1e216be94b87d607cafd6f35fd2ece5ba5004a76 Mon Sep 17 00:00:00 2001
Message-ID: <1e216be94b87d607cafd6f35fd2ece5ba5004a76.1723114981.git.sam@gentoo.org>
From: Sam James <sam@gentoo.org>
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-08 11:06 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-08 11:06 UTC (permalink / raw
To: gentoo-commits
commit: bf4ef4b5f40ababd682716570dd5683d154844ca
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 8 11:06:47 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 8 11:06:47 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=bf4ef4b5
15.0.0: add link to upstream discussion/question wrt tests
https://inbox.sourceware.org/gcc-patches/87v80cn24t.fsf <AT> gentoo.org/
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch | 2 ++
1 file changed, 2 insertions(+)
diff --git a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
index 0bf9812..89e5a8b 100644
--- a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
+++ b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
@@ -1,3 +1,5 @@
+https://inbox.sourceware.org/gcc-patches/87v80cn24t.fsf@gentoo.org/
+
From 1e216be94b87d607cafd6f35fd2ece5ba5004a76 Mon Sep 17 00:00:00 2001
Message-ID: <1e216be94b87d607cafd6f35fd2ece5ba5004a76.1723114981.git.sam@gentoo.org>
From: Sam James <sam@gentoo.org>
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-08 11:03 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-08 11:03 UTC (permalink / raw
To: gentoo-commits
commit: 66b7838fff9640206291c609dd07b2bc95c9f128
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 8 11:03:19 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 8 11:03:19 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=66b7838f
15.0.0: add 31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
...ortran-pass-Wcomplain-wrong-lang-where-ap.patch | 104 +++++++++++++++++++++
1 file changed, 104 insertions(+)
diff --git a/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
new file mode 100644
index 0000000..0bf9812
--- /dev/null
+++ b/15.0.0/gentoo/31_all_testsuite-fortran-pass-Wcomplain-wrong-lang-where-ap.patch
@@ -0,0 +1,104 @@
+From 1e216be94b87d607cafd6f35fd2ece5ba5004a76 Mon Sep 17 00:00:00 2001
+Message-ID: <1e216be94b87d607cafd6f35fd2ece5ba5004a76.1723114981.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Thu, 8 Aug 2024 12:00:41 +0100
+Subject: [PATCH] testsuite: fortran: pass -Wcomplain-wrong-lang where
+ appropriate
+
+These tests expect the diagnostic from -Wcomplain-wrong-lang but
+don't explicitly enable it. This causes issues if running the testsuite
+with -Wno-complain-wrong-lang.
+
+gcc/testsuite/ChangeLog:
+ * gfortran.dg/ISO_Fortran_binding_17.f90: Pass -Wcomplain-wrong-lang.
+ * gfortran.dg/c-interop/allocate-errors.f90: Likewise.
+ * gfortran.dg/c-interop/establish-errors.f90: Likewise.
+ * gfortran.dg/c-interop/section-errors.f90: Likewise.
+ * gfortran.dg/c-interop/select-errors.f90: Likewise.
+ * gfortran.dg/c-interop/setpointer-errors.f90: Likewise.
+---
+ gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/section-errors.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/select-errors.f90 | 2 +-
+ gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90 | 2 +-
+ 6 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90 b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90
+index c399e710ce97..c321c7a61f54 100644
+--- a/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90
++++ b/gcc/testsuite/gfortran.dg/ISO_Fortran_binding_17.f90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-additional-sources ISO_Fortran_binding_17.c }
+-! { dg-options "-fcheck=all" }
++! { dg-options "-Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! PR fortran/92470
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90
+index a58d05a33681..1cf3fbd9fdd7 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/allocate-errors.f90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-additional-sources "allocate-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_allocate and CFI_deallocate functions
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90
+index 307a2664b743..c505c1904c75 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/establish-errors.f90
+@@ -1,7 +1,7 @@
+ ! PR101317
+ ! { dg-do run }
+ ! { dg-additional-sources "establish-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_establish function properly detects
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90
+index 28328b799b30..699fa8940849 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/section-errors.f90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-additional-sources "section-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_section function properly detects
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90
+index b719c9e68679..199f314ed359 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/select-errors.f90
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-additional-sources "select-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_select_part function properly detects
+diff --git a/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90 b/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90
+index 84a01ce16b12..3af7cc7f0e0f 100644
+--- a/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90
++++ b/gcc/testsuite/gfortran.dg/c-interop/setpointer-errors.f90
+@@ -1,7 +1,7 @@
+ ! PR 101317
+ ! { dg-do run }
+ ! { dg-additional-sources "setpointer-errors-c.c dump-descriptors.c" }
+-! { dg-additional-options "-Wno-error -fcheck=all" }
++! { dg-additional-options "-Wno-error -Wcomplain-wrong-lang -fcheck=all" }
+ ! { dg-warning "command-line option '-fcheck=all' is valid for Fortran but not for C" "" { target *-*-* } 0 }
+ !
+ ! This program tests that the CFI_setpointer function properly detects
+--
+2.45.2
+
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-05 9:09 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-05 9:09 UTC (permalink / raw
To: gentoo-commits
commit: 767d91209f8983d23caae12e2337eca6c2b5dbdb
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 09:09:04 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 5 09:09:04 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=767d9120
15.0.0: drop 79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
It's been reverted upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-may_trap_p_1-return-false-for-constant-p.patch | 98 ----------------------
1 file changed, 98 deletions(-)
diff --git a/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch b/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
deleted file mode 100644
index c65b792..0000000
--- a/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
+++ /dev/null
@@ -1,98 +0,0 @@
-From 4def9ea5a1511d6adbbd15e59f2542326484454a Mon Sep 17 00:00:00 2001
-Message-ID: <4def9ea5a1511d6adbbd15e59f2542326484454a.1722631128.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Fri, 2 Aug 2024 21:38:28 +0100
-Subject: [PATCH] Revert "Make may_trap_p_1 return false for constant pool
- references [PR116145]"
-
-This reverts commit ba730fd10934e4ca004251aa3748bf9da4d35e62.
-
-Bug: https://gcc.gnu.org/PR116200
----
- gcc/rtlanal.cc | 14 ++----
- .../aarch64/sve/acle/general/pr116145.c | 46 -------------------
- 2 files changed, 4 insertions(+), 56 deletions(-)
- delete mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
-
-diff --git a/gcc/rtlanal.cc b/gcc/rtlanal.cc
-index 893a6afbbc53..4158a531bdd7 100644
---- a/gcc/rtlanal.cc
-+++ b/gcc/rtlanal.cc
-@@ -3152,16 +3152,10 @@ may_trap_p_1 (const_rtx x, unsigned flags)
- && MEM_VOLATILE_P (x)
- && XEXP (x, 0) == stack_pointer_rtx)
- return true;
-- if (/* MEM_READONLY_P means that the memory is both statically
-- allocated and readonly, so MEM_NOTRAP_P should remain true
-- even if the memory reference is moved. This is certainly
-- true for the important case of force_const_mem.
--
-- Otherwise, MEM_NOTRAP_P only relates to the actual position
-- of the memory reference; moving it out of context such as
-- when moving code when optimizing, might cause its address
-- to become invalid. */
-- (code_changed && !MEM_READONLY_P (x))
-+ if (/* MEM_NOTRAP_P only relates to the actual position of the memory
-+ reference; moving it out of context such as when moving code
-+ when optimizing, might cause its address to become invalid. */
-+ code_changed
- || !MEM_NOTRAP_P (x))
- {
- poly_int64 size = MEM_SIZE_KNOWN_P (x) ? MEM_SIZE (x) : -1;
-diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
-deleted file mode 100644
-index a3d93d3e1c84..000000000000
---- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
-+++ /dev/null
-@@ -1,46 +0,0 @@
--// { dg-options "-O2" }
--
--#include <stdlib.h>
--#include <arm_sve.h>
--
--#pragma GCC target "+sve2"
--
--typedef unsigned char uchar;
--
--const uchar *
--search_line_fast (const uchar *s, const uchar *end)
--{
-- size_t VL = svcntb();
-- svuint8_t arr1, arr2;
-- svbool_t pc, pg = svptrue_b8();
--
-- // This should not be loaded inside the loop every time.
-- arr2 = svreinterpret_u8(svdup_u32(0x0a0d5c3f));
--
-- for (; s+VL <= end; s += VL) {
-- arr1 = svld1_u8(pg, s);
-- pc = svmatch_u8(pg, arr1, arr2);
--
-- if (svptest_any(pg, pc)) {
-- pc = svbrkb_z(pg, pc);
-- return s+svcntp_b8(pg, pc);
-- }
-- }
--
-- // Handle remainder.
-- if (s < end) {
-- pg = svwhilelt_b8((size_t)s, (size_t)end);
--
-- arr1 = svld1_u8(pg, s);
-- pc = svmatch_u8(pg, arr1, arr2);
--
-- if (svptest_any(pg, pc)) {
-- pc = svbrkb_z(pg, pc);
-- return s+svcntp_b8(pg, pc);
-- }
-- }
--
-- return end;
--}
--
--// { dg-final { scan-assembler {:\n\tld1b\t[^\n]*\n\tmatch\t[^\n]*\n\tb\.} } }
-
-base-commit: 5ebfaf2d4994c124ce81aa0abd7eaa1529644749
---
-2.45.2
-
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-05 1:54 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-05 1:54 UTC (permalink / raw
To: gentoo-commits
commit: 01af1e42d008b379d7046adce4733b4d67acdcf0
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 01:54:07 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 5 01:54:07 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=01af1e42
15.0.0: re-enable -fext-dce at -O2
All known issues are fixed, let's get testing it again.
I have let Jeff know I spotted a test is failing on s390x at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115912#c21.
Signed-off-by: Sam James <sam <AT> gentoo.org>
...gcc_don-t-enable-fext-dce-with-O2-for-now.patch | 34 ----------------------
15.0.0/gentoo/README.history | 4 +++
2 files changed, 4 insertions(+), 34 deletions(-)
diff --git a/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch b/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
deleted file mode 100644
index 82c5535..0000000
--- a/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From 86de2fd7550f75a318aa9819b115487cd850b4fc Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Mon, 15 Jul 2024 00:32:18 +0100
-Subject: [PATCH] gcc: don't enable -fext-dce with -O2 for now
-
-There's too many bugs involving it for now.
-
- gcc/
- * opts.cc (default_options_table): Don't enable ext-dce at -O2
-
-Bug: https://gcc.gnu.org/PR115876
-Bug: https://gcc.gnu.org/PR115877
-Bug: https://gcc.gnu.org/PR115912
-Bug: https://gcc.gnu.org/PR115916
-Bug: https://gcc.gnu.org/PR115927
----
- gcc/opts.cc | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/gcc/opts.cc b/gcc/opts.cc
-index be90a632338f..e1a1bdf15822 100644
---- a/gcc/opts.cc
-+++ b/gcc/opts.cc
-@@ -634,7 +634,6 @@ static const struct default_options default_options_table[] =
- { OPT_LEVELS_2_PLUS, OPT_fdevirtualize, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fdevirtualize_speculatively, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fexpensive_optimizations, NULL, 1 },
-- { OPT_LEVELS_2_PLUS, OPT_fext_dce, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fgcse, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
- { OPT_LEVELS_2_PLUS, OPT_findirect_inlining, NULL, 1 },
---
-2.45.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 2188207..a872a71 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+? ????
+
+ - 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
+
8 5 August 2024
- 79_all_PR116120-revert-match-pattern.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-05 1:51 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-05 1:51 UTC (permalink / raw
To: gentoo-commits
commit: 2723607b796c54089f8004568fa060c476dc829d
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 5 01:47:39 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 5 01:47:39 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=2723607b
15.0.0: cut patchset 8
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 793fd45..2188207 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,6 +1,7 @@
-8 ????
+8 5 August 2024
- 79_all_PR116120-revert-match-pattern.patch
+ + 79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
7 29 July 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-02 20:39 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-02 20:39 UTC (permalink / raw
To: gentoo-commits
commit: 831195db0373e4954ff47452375844caf997e34b
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 2 20:39:09 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 2 20:39:09 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=831195db
15.0.0: add 79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
Bug: https://gcc.gnu.org/PR116200
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-may_trap_p_1-return-false-for-constant-p.patch | 98 ++++++++++++++++++++++
1 file changed, 98 insertions(+)
diff --git a/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch b/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
new file mode 100644
index 0000000..c65b792
--- /dev/null
+++ b/15.0.0/gentoo/79_all_Revert-Make-may_trap_p_1-return-false-for-constant-p.patch
@@ -0,0 +1,98 @@
+From 4def9ea5a1511d6adbbd15e59f2542326484454a Mon Sep 17 00:00:00 2001
+Message-ID: <4def9ea5a1511d6adbbd15e59f2542326484454a.1722631128.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Fri, 2 Aug 2024 21:38:28 +0100
+Subject: [PATCH] Revert "Make may_trap_p_1 return false for constant pool
+ references [PR116145]"
+
+This reverts commit ba730fd10934e4ca004251aa3748bf9da4d35e62.
+
+Bug: https://gcc.gnu.org/PR116200
+---
+ gcc/rtlanal.cc | 14 ++----
+ .../aarch64/sve/acle/general/pr116145.c | 46 -------------------
+ 2 files changed, 4 insertions(+), 56 deletions(-)
+ delete mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
+
+diff --git a/gcc/rtlanal.cc b/gcc/rtlanal.cc
+index 893a6afbbc53..4158a531bdd7 100644
+--- a/gcc/rtlanal.cc
++++ b/gcc/rtlanal.cc
+@@ -3152,16 +3152,10 @@ may_trap_p_1 (const_rtx x, unsigned flags)
+ && MEM_VOLATILE_P (x)
+ && XEXP (x, 0) == stack_pointer_rtx)
+ return true;
+- if (/* MEM_READONLY_P means that the memory is both statically
+- allocated and readonly, so MEM_NOTRAP_P should remain true
+- even if the memory reference is moved. This is certainly
+- true for the important case of force_const_mem.
+-
+- Otherwise, MEM_NOTRAP_P only relates to the actual position
+- of the memory reference; moving it out of context such as
+- when moving code when optimizing, might cause its address
+- to become invalid. */
+- (code_changed && !MEM_READONLY_P (x))
++ if (/* MEM_NOTRAP_P only relates to the actual position of the memory
++ reference; moving it out of context such as when moving code
++ when optimizing, might cause its address to become invalid. */
++ code_changed
+ || !MEM_NOTRAP_P (x))
+ {
+ poly_int64 size = MEM_SIZE_KNOWN_P (x) ? MEM_SIZE (x) : -1;
+diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
+deleted file mode 100644
+index a3d93d3e1c84..000000000000
+--- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/pr116145.c
++++ /dev/null
+@@ -1,46 +0,0 @@
+-// { dg-options "-O2" }
+-
+-#include <stdlib.h>
+-#include <arm_sve.h>
+-
+-#pragma GCC target "+sve2"
+-
+-typedef unsigned char uchar;
+-
+-const uchar *
+-search_line_fast (const uchar *s, const uchar *end)
+-{
+- size_t VL = svcntb();
+- svuint8_t arr1, arr2;
+- svbool_t pc, pg = svptrue_b8();
+-
+- // This should not be loaded inside the loop every time.
+- arr2 = svreinterpret_u8(svdup_u32(0x0a0d5c3f));
+-
+- for (; s+VL <= end; s += VL) {
+- arr1 = svld1_u8(pg, s);
+- pc = svmatch_u8(pg, arr1, arr2);
+-
+- if (svptest_any(pg, pc)) {
+- pc = svbrkb_z(pg, pc);
+- return s+svcntp_b8(pg, pc);
+- }
+- }
+-
+- // Handle remainder.
+- if (s < end) {
+- pg = svwhilelt_b8((size_t)s, (size_t)end);
+-
+- arr1 = svld1_u8(pg, s);
+- pc = svmatch_u8(pg, arr1, arr2);
+-
+- if (svptest_any(pg, pc)) {
+- pc = svbrkb_z(pg, pc);
+- return s+svcntp_b8(pg, pc);
+- }
+- }
+-
+- return end;
+-}
+-
+-// { dg-final { scan-assembler {:\n\tld1b\t[^\n]*\n\tmatch\t[^\n]*\n\tb\.} } }
+
+base-commit: 5ebfaf2d4994c124ce81aa0abd7eaa1529644749
+--
+2.45.2
+
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-08-01 14:40 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-08-01 14:40 UTC (permalink / raw
To: gentoo-commits
commit: 26118e917fcb919778bc5634c6cd8072ff23c4f6
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 1 14:39:41 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 1 14:39:41 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=26118e91
15.0.0: drop 79_all_PR116120-revert-match-pattern.patch
Part of it is fixed and the other part should be committed soon.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../79_all_PR116120-revert-match-pattern.patch | 199 ---------------------
15.0.0/gentoo/README.history | 4 +
2 files changed, 4 insertions(+), 199 deletions(-)
diff --git a/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch b/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch
deleted file mode 100644
index 6d5b542..0000000
--- a/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch
+++ /dev/null
@@ -1,199 +0,0 @@
-From fd07aecb306c682e1d7255fc01c6c02f3ca4f6f8 Mon Sep 17 00:00:00 2001
-Message-ID: <fd07aecb306c682e1d7255fc01c6c02f3ca4f6f8.1722209590.git.sam@gentoo.org>
-From: Sam James <sam@gentoo.org>
-Date: Mon, 29 Jul 2024 00:32:52 +0100
-Subject: [PATCH] Revert "MATCH: Simplify (a ? x : y) eq/ne (b ? x : y)
- [PR111150]"
-
-This reverts commit 44fcc1ca11e7ea35dc9fb25a5317346bc1eaf7b2.
-
-Avoid a reported & debugged miscompilation until it gets fixed.
-
-Bug: https://gcc.gnu.org/PR116120
----
- gcc/match.pd | 15 -----
- gcc/testsuite/g++.dg/tree-ssa/pr111150.C | 34 ----------
- gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c | 72 ----------------------
- gcc/testsuite/gcc.dg/tree-ssa/pr111150.c | 22 -------
- 4 files changed, 143 deletions(-)
- delete mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr111150.C
- delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
- delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
-
-diff --git a/gcc/match.pd b/gcc/match.pd
-index 1c8601229e3d..b8d0ebee08db 100644
---- a/gcc/match.pd
-+++ b/gcc/match.pd
-@@ -5632,21 +5632,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
- (vec_cond (bit_and (bit_not @0) @1) @2 @3)))
- #endif
-
--/* (a ? x : y) != (b ? x : y) --> (a^b) ? TRUE : FALSE */
--/* (a ? x : y) == (b ? x : y) --> (a^b) ? FALSE : TRUE */
--/* (a ? x : y) != (b ? y : x) --> (a^b) ? FALSE : TRUE */
--/* (a ? x : y) == (b ? y : x) --> (a^b) ? TRUE : FALSE */
--(for cnd (cond vec_cond)
-- (for eqne (eq ne)
-- (simplify
-- (eqne:c (cnd @0 @1 @2) (cnd @3 @1 @2))
-- (cnd (bit_xor @0 @3) { constant_boolean_node (eqne == NE_EXPR, type); }
-- { constant_boolean_node (eqne != NE_EXPR, type); }))
-- (simplify
-- (eqne:c (cnd @0 @1 @2) (cnd @3 @2 @1))
-- (cnd (bit_xor @0 @3) { constant_boolean_node (eqne != NE_EXPR, type); }
-- { constant_boolean_node (eqne == NE_EXPR, type); }))))
--
- /* Canonicalize mask ? { 0, ... } : { -1, ...} to ~mask if the mask
- types are compatible. */
- (simplify
-diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr111150.C b/gcc/testsuite/g++.dg/tree-ssa/pr111150.C
-deleted file mode 100644
-index ac5d3ef15d83..000000000000
---- a/gcc/testsuite/g++.dg/tree-ssa/pr111150.C
-+++ /dev/null
-@@ -1,34 +0,0 @@
--/* PR tree-optimization/111150 */
--/* { dg-do compile } */
--/* { dg-options "-O1 -fdump-tree-forwprop1 -Wno-psabi" } */
--
--typedef int v4si __attribute((__vector_size__(4 * sizeof(int))));
--
--/* Before the patch, VEC_COND_EXPR was generated for each statement in the
-- function. This resulted in 3 VEC_COND_EXPR. */
--v4si f1_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
-- v4si X = a == b ? e : f;
-- v4si Y = c == d ? e : f;
-- return (X != Y);
--}
--
--v4si f2_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
-- v4si X = a == b ? e : f;
-- v4si Y = c == d ? e : f;
-- return (X == Y);
--}
--
--v4si f3_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
-- v4si X = a == b ? e : f;
-- v4si Y = c == d ? f : e;
-- return (X != Y);
--}
--
--v4si f4_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
-- v4si X = a == b ? e : f;
-- v4si Y = c == d ? f : e;
-- return (X == Y);
--}
--
--/* For each testcase, should produce only one VEC_COND_EXPR for X^Y. */
--/* { dg-final { scan-tree-dump-times " VEC_COND_EXPR " 4 "forwprop1" } } */
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
-deleted file mode 100644
-index 6f4b21ac6bcb..000000000000
---- a/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
-+++ /dev/null
-@@ -1,72 +0,0 @@
--/* PR tree-optimization/111150 */
--/* { dg-do compile } */
--/* { dg-options "-O1 -fgimple -fdump-tree-forwprop1-raw" } */
--
--/* Checks if pattern (X ? e : f) == (Y ? e : f) gets optimized. */
--__GIMPLE()
--_Bool f1_(int a, int b, int c, int d, int e, int f) {
-- _Bool X;
-- _Bool Y;
-- _Bool t;
-- int t1;
-- int t2;
-- X = a == b;
-- Y = c == d;
-- /* Before the patch cond_expr was generated for these 2 statements. */
-- t1 = X ? e : f;
-- t2 = Y ? e : f;
-- t = t1 == t2;
-- return t;
--}
--
--/* Checks if pattern (X ? e : f) != (Y ? e : f) gets optimized. */
--__GIMPLE()
--_Bool f2_(int a, int b, int c, int d, int e, int f) {
-- _Bool X;
-- _Bool Y;
-- _Bool t;
-- int t1;
-- int t2;
-- X = a == b;
-- Y = c == d;
-- t1 = X ? e : f;
-- t2 = Y ? e : f;
-- t = t1 != t2;
-- return t;
--}
--
--/* Checks if pattern (X ? e : f) == (Y ? f : e) gets optimized. */
--__GIMPLE()
--_Bool f3_(int a, int b, int c, int d, int e, int f) {
-- _Bool X;
-- _Bool Y;
-- _Bool t;
-- int t1;
-- int t2;
-- X = a == b;
-- Y = c == d;
-- t1 = X ? e : f;
-- t2 = Y ? f : e;
-- t = t1 == t2;
-- return t;
--}
--
--/* Checks if pattern (X ? e : f) != (Y ? f : e) gets optimized. */
--__GIMPLE()
--_Bool f4_(int a, int b, int c, int d, int e, int f) {
-- _Bool X;
-- _Bool Y;
-- _Bool t;
-- int t1;
-- int t2;
-- X = a == b;
-- Y = c == d;
-- t1 = X ? e : f;
-- t2 = Y ? f : e;
-- t = t1 != t2;
-- return t;
--}
--
--/* Should generate one bit_xor_expr for each testcase. */
--/* { dg-final { scan-tree-dump-not "cond_expr, " "forwprop1" } } */
--/* { dg-final { scan-tree-dump-times "bit_xor_expr, " 4 "forwprop1" } } */
-diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
-deleted file mode 100644
-index 568ae9e44b3d..000000000000
---- a/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
-+++ /dev/null
-@@ -1,22 +0,0 @@
--/* PR tree-optimization/111150 */
--/* { dg-do compile } */
--/* { dg-options "-O1 -fdump-tree-forwprop1 -Wno-psabi" } */
--
--typedef int v4si __attribute((__vector_size__(4 * sizeof(int))));
--
--/* Before the patch, VEC_COND_EXPR was generated for each statement in the
-- function. This resulted in 3 VEC_COND_EXPR. */
--v4si f1_(v4si a, v4si b, v4si c, v4si d) {
-- v4si X = a == b;
-- v4si Y = c == d;
-- return (X != Y);
--}
--
--v4si f2_(v4si a, v4si b, v4si c, v4si d) {
-- v4si X = a == b;
-- v4si Y = c == d;
-- return (X == Y);
--}
--
--/* For each testcase, should produce only one VEC_COND_EXPR for X^Y. */
--/* { dg-final { scan-tree-dump-times " VEC_COND_EXPR " 2 "forwprop1" } } */
-
-base-commit: d5f1948640815a554d106542c2e91e4e117aa3bc
---
-2.45.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 93de595..793fd45 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+8 ????
+
+ - 79_all_PR116120-revert-match-pattern.patch
+
7 29 July 2024
+ 79_all_PR116120-revert-match-pattern.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-28 23:34 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-07-28 23:34 UTC (permalink / raw
To: gentoo-commits
commit: 4145ebad1e8382c5ec5ca26dadf21437aa37d172
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 28 23:34:10 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 28 23:34:10 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=4145ebad
15.0.0: add 79_all_PR116120-revert-match-pattern.patch
Bug: https://gcc.gnu.org/PR116120
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../79_all_PR116120-revert-match-pattern.patch | 199 +++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +
2 files changed, 203 insertions(+)
diff --git a/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch b/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch
new file mode 100644
index 0000000..6d5b542
--- /dev/null
+++ b/15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch
@@ -0,0 +1,199 @@
+From fd07aecb306c682e1d7255fc01c6c02f3ca4f6f8 Mon Sep 17 00:00:00 2001
+Message-ID: <fd07aecb306c682e1d7255fc01c6c02f3ca4f6f8.1722209590.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Mon, 29 Jul 2024 00:32:52 +0100
+Subject: [PATCH] Revert "MATCH: Simplify (a ? x : y) eq/ne (b ? x : y)
+ [PR111150]"
+
+This reverts commit 44fcc1ca11e7ea35dc9fb25a5317346bc1eaf7b2.
+
+Avoid a reported & debugged miscompilation until it gets fixed.
+
+Bug: https://gcc.gnu.org/PR116120
+---
+ gcc/match.pd | 15 -----
+ gcc/testsuite/g++.dg/tree-ssa/pr111150.C | 34 ----------
+ gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c | 72 ----------------------
+ gcc/testsuite/gcc.dg/tree-ssa/pr111150.c | 22 -------
+ 4 files changed, 143 deletions(-)
+ delete mode 100644 gcc/testsuite/g++.dg/tree-ssa/pr111150.C
+ delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
+ delete mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
+
+diff --git a/gcc/match.pd b/gcc/match.pd
+index 1c8601229e3d..b8d0ebee08db 100644
+--- a/gcc/match.pd
++++ b/gcc/match.pd
+@@ -5632,21 +5632,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
+ (vec_cond (bit_and (bit_not @0) @1) @2 @3)))
+ #endif
+
+-/* (a ? x : y) != (b ? x : y) --> (a^b) ? TRUE : FALSE */
+-/* (a ? x : y) == (b ? x : y) --> (a^b) ? FALSE : TRUE */
+-/* (a ? x : y) != (b ? y : x) --> (a^b) ? FALSE : TRUE */
+-/* (a ? x : y) == (b ? y : x) --> (a^b) ? TRUE : FALSE */
+-(for cnd (cond vec_cond)
+- (for eqne (eq ne)
+- (simplify
+- (eqne:c (cnd @0 @1 @2) (cnd @3 @1 @2))
+- (cnd (bit_xor @0 @3) { constant_boolean_node (eqne == NE_EXPR, type); }
+- { constant_boolean_node (eqne != NE_EXPR, type); }))
+- (simplify
+- (eqne:c (cnd @0 @1 @2) (cnd @3 @2 @1))
+- (cnd (bit_xor @0 @3) { constant_boolean_node (eqne != NE_EXPR, type); }
+- { constant_boolean_node (eqne == NE_EXPR, type); }))))
+-
+ /* Canonicalize mask ? { 0, ... } : { -1, ...} to ~mask if the mask
+ types are compatible. */
+ (simplify
+diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr111150.C b/gcc/testsuite/g++.dg/tree-ssa/pr111150.C
+deleted file mode 100644
+index ac5d3ef15d83..000000000000
+--- a/gcc/testsuite/g++.dg/tree-ssa/pr111150.C
++++ /dev/null
+@@ -1,34 +0,0 @@
+-/* PR tree-optimization/111150 */
+-/* { dg-do compile } */
+-/* { dg-options "-O1 -fdump-tree-forwprop1 -Wno-psabi" } */
+-
+-typedef int v4si __attribute((__vector_size__(4 * sizeof(int))));
+-
+-/* Before the patch, VEC_COND_EXPR was generated for each statement in the
+- function. This resulted in 3 VEC_COND_EXPR. */
+-v4si f1_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
+- v4si X = a == b ? e : f;
+- v4si Y = c == d ? e : f;
+- return (X != Y);
+-}
+-
+-v4si f2_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
+- v4si X = a == b ? e : f;
+- v4si Y = c == d ? e : f;
+- return (X == Y);
+-}
+-
+-v4si f3_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
+- v4si X = a == b ? e : f;
+- v4si Y = c == d ? f : e;
+- return (X != Y);
+-}
+-
+-v4si f4_(v4si a, v4si b, v4si c, v4si d, v4si e, v4si f) {
+- v4si X = a == b ? e : f;
+- v4si Y = c == d ? f : e;
+- return (X == Y);
+-}
+-
+-/* For each testcase, should produce only one VEC_COND_EXPR for X^Y. */
+-/* { dg-final { scan-tree-dump-times " VEC_COND_EXPR " 4 "forwprop1" } } */
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
+deleted file mode 100644
+index 6f4b21ac6bcb..000000000000
+--- a/gcc/testsuite/gcc.dg/tree-ssa/pr111150-1.c
++++ /dev/null
+@@ -1,72 +0,0 @@
+-/* PR tree-optimization/111150 */
+-/* { dg-do compile } */
+-/* { dg-options "-O1 -fgimple -fdump-tree-forwprop1-raw" } */
+-
+-/* Checks if pattern (X ? e : f) == (Y ? e : f) gets optimized. */
+-__GIMPLE()
+-_Bool f1_(int a, int b, int c, int d, int e, int f) {
+- _Bool X;
+- _Bool Y;
+- _Bool t;
+- int t1;
+- int t2;
+- X = a == b;
+- Y = c == d;
+- /* Before the patch cond_expr was generated for these 2 statements. */
+- t1 = X ? e : f;
+- t2 = Y ? e : f;
+- t = t1 == t2;
+- return t;
+-}
+-
+-/* Checks if pattern (X ? e : f) != (Y ? e : f) gets optimized. */
+-__GIMPLE()
+-_Bool f2_(int a, int b, int c, int d, int e, int f) {
+- _Bool X;
+- _Bool Y;
+- _Bool t;
+- int t1;
+- int t2;
+- X = a == b;
+- Y = c == d;
+- t1 = X ? e : f;
+- t2 = Y ? e : f;
+- t = t1 != t2;
+- return t;
+-}
+-
+-/* Checks if pattern (X ? e : f) == (Y ? f : e) gets optimized. */
+-__GIMPLE()
+-_Bool f3_(int a, int b, int c, int d, int e, int f) {
+- _Bool X;
+- _Bool Y;
+- _Bool t;
+- int t1;
+- int t2;
+- X = a == b;
+- Y = c == d;
+- t1 = X ? e : f;
+- t2 = Y ? f : e;
+- t = t1 == t2;
+- return t;
+-}
+-
+-/* Checks if pattern (X ? e : f) != (Y ? f : e) gets optimized. */
+-__GIMPLE()
+-_Bool f4_(int a, int b, int c, int d, int e, int f) {
+- _Bool X;
+- _Bool Y;
+- _Bool t;
+- int t1;
+- int t2;
+- X = a == b;
+- Y = c == d;
+- t1 = X ? e : f;
+- t2 = Y ? f : e;
+- t = t1 != t2;
+- return t;
+-}
+-
+-/* Should generate one bit_xor_expr for each testcase. */
+-/* { dg-final { scan-tree-dump-not "cond_expr, " "forwprop1" } } */
+-/* { dg-final { scan-tree-dump-times "bit_xor_expr, " 4 "forwprop1" } } */
+diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
+deleted file mode 100644
+index 568ae9e44b3d..000000000000
+--- a/gcc/testsuite/gcc.dg/tree-ssa/pr111150.c
++++ /dev/null
+@@ -1,22 +0,0 @@
+-/* PR tree-optimization/111150 */
+-/* { dg-do compile } */
+-/* { dg-options "-O1 -fdump-tree-forwprop1 -Wno-psabi" } */
+-
+-typedef int v4si __attribute((__vector_size__(4 * sizeof(int))));
+-
+-/* Before the patch, VEC_COND_EXPR was generated for each statement in the
+- function. This resulted in 3 VEC_COND_EXPR. */
+-v4si f1_(v4si a, v4si b, v4si c, v4si d) {
+- v4si X = a == b;
+- v4si Y = c == d;
+- return (X != Y);
+-}
+-
+-v4si f2_(v4si a, v4si b, v4si c, v4si d) {
+- v4si X = a == b;
+- v4si Y = c == d;
+- return (X == Y);
+-}
+-
+-/* For each testcase, should produce only one VEC_COND_EXPR for X^Y. */
+-/* { dg-final { scan-tree-dump-times " VEC_COND_EXPR " 2 "forwprop1" } } */
+
+base-commit: d5f1948640815a554d106542c2e91e4e117aa3bc
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 81978cb..93de595 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+7 29 July 2024
+
+ + 79_all_PR116120-revert-match-pattern.patch
+
6 22 July 2024
- 76_all_ppc_PR97367-power7-cell-altivec.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-22 1:11 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-07-22 1:11 UTC (permalink / raw
To: gentoo-commits
commit: 7203178939395f9d01a60a68073ec175ed0236c8
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 22 01:11:43 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 22 01:11:43 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=72031789
15.0.0: cut patchset 6
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index e7d8bf0..81978cb 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-6 ?? ???? ????
+6 22 July 2024
- 76_all_ppc_PR97367-power7-cell-altivec.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-19 11:14 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-07-19 11:14 UTC (permalink / raw
To: gentoo-commits
commit: 3147d1f67ddd03e579d1ff19aea8b9cfeb490564
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 19 11:14:06 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 19 11:14:06 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3147d1f6
15.0.0: drop upstream power7 patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../76_all_ppc_PR97367-power7-cell-altivec.patch | 109 ---------------------
15.0.0/gentoo/README.history | 4 +
2 files changed, 4 insertions(+), 109 deletions(-)
diff --git a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
deleted file mode 100644
index d4ca6c2..0000000
--- a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-https://gcc.gnu.org/PR97367
-https://inbox.sourceware.org/gcc-patches/5f2b5d5e-a682-4084-b70e-89929f4cc6dc@bergner.org/T/#u
-
-From git@z Thu Jan 1 00:00:00 1970
-Subject: [PATCH v2] rs6000: Fix .machine cpu selection w/ altivec [PR97367]
-From: Peter Bergner <pshop@bergner.org>
-Date: Fri, 12 Jul 2024 16:48:29 -0500
-Message-Id: <5f2b5d5e-a682-4084-b70e-89929f4cc6dc@bergner.org>
-MIME-Version: 1.0
-Content-Type: text/plain; charset="utf-8"
-Content-Transfer-Encoding: 8bit
-
-René's patch seems to have stalled, so here is an updated version of the
-patch with the requested changes to his patch.
-
-I'll note I have added an additional code change, which is to also emit a
-".machine altivec" if Altivec is enabled. The problem this fixes is for
-cpus like the G5, which is basically a power4 plus an Altivec unit, its
-".machine power4" doesn't enable the assembler to recognize Altivec insns.
-That isn't a problem if you use gcc -mcpu=G5 to assemble the assembler file,
-since gcc passes -maltivec to the assembler. However, if you try to assemble
-the assembler file with as by hand, you'll get "unrecognized opcode" errors.
-I did not do the same for VSX, since all ".machine <cpu>" for cpus that
-support VSX already enable VSX insn recognition, so it's not needed.
-
-
-rs6000: Fix .machine cpu selection w/ altivec [PR97367]
-
-There are various non-IBM CPUs with altivec, so we cannot use that
-flag to determine which .machine cpu to use, so ignore it.
-Emit an additional ".machine altivec" if Altivec is enabled so
-that the assembler doesn't require an explicit -maltivec option
-to assemble any Altivec instructions for those targets where
-the ".machine cpu" is insufficient to enable Altivec. For example,
--mcpu=G5 emits a ".machine power4".
-
-This passed bootstrap and regtesting on powrpc64-linux (running the testsuite
-in both 32-bit and 64-bit modes) with no regressions.
-
-Ok for trunk and the release branches after some trunk burn-in time?
-
-Peter
-
-
-2024-07-12 René Rebe <rene@exactcode.de>
- Peter Bergner <bergner@linux.ibm.com>
-
-gcc/
- PR target/97367
- * config/rs6000/rs6000.c (rs6000_machine_from_flags): Do not consider
- OPTION_MASK_ALTIVEC.
- (emit_asm_machine): For Altivec compiles, emit a ".machine altivec".
-
-gcc/testsuite/
- PR target/97367
- * gcc.target/powerpc/pr97367.c: New test.
-
-Signed-of-by: René Rebe <rene@exactcode.de>
----
- gcc/config/rs6000/rs6000.cc | 5 ++++-
- gcc/testsuite/gcc.target/powerpc/pr97367.c | 13 +++++++++++++
- 2 files changed, 17 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/gcc.target/powerpc/pr97367.c
-
-diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
-index 2cbea6ea2d7..2cb8f35739b 100644
---- a/gcc/config/rs6000/rs6000.cc
-+++ b/gcc/config/rs6000/rs6000.cc
-@@ -5888,7 +5888,8 @@ rs6000_machine_from_flags (void)
- HOST_WIDE_INT flags = rs6000_isa_flags;
-
- /* Disable the flags that should never influence the .machine selection. */
-- flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL);
-+ flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL
-+ | OPTION_MASK_ALTIVEC);
-
- if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
- return "power10";
-@@ -5913,6 +5914,8 @@ void
- emit_asm_machine (void)
- {
- fprintf (asm_out_file, "\t.machine %s\n", rs6000_machine);
-+ if (TARGET_ALTIVEC)
-+ fprintf (asm_out_file, "\t.machine altivec\n");
- }
- #endif
-
-diff --git a/gcc/testsuite/gcc.target/powerpc/pr97367.c b/gcc/testsuite/gcc.target/powerpc/pr97367.c
-new file mode 100644
-index 00000000000..f9118dbcdec
---- /dev/null
-+++ b/gcc/testsuite/gcc.target/powerpc/pr97367.c
-@@ -0,0 +1,13 @@
-+/* PR target/97367 */
-+/* { dg-options "-mdejagnu-cpu=G5" } */
-+
-+/* Verify we emit a ".machine power4" and ".machine altivec" rather
-+ than a ".machine power7". */
-+
-+int dummy (void)
-+{
-+ return 0;
-+}
-+
-+/* { dg-final { scan-assembler {\.\mmachine power4\M} } } */
-+/* { dg-final { scan-assembler {\.\mmachine altivec\M} } } */
---
-2.45.2
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index eddda8f..e7d8bf0 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+6 ?? ???? ????
+
+ - 76_all_ppc_PR97367-power7-cell-altivec.patch
+
5 15 July 2024
+ 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-18 0:45 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-07-18 0:45 UTC (permalink / raw
To: gentoo-commits
commit: 3caa1b3eb3879d24c604ffa282b1c4b2c17fc391
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 18 00:44:35 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul 18 00:44:35 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=3caa1b3e
15.0.0: update power7 .feature patch
Switch to Peter's version. Can update older branches once it's merged.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../76_all_ppc_PR97367-power7-cell-altivec.patch | 102 ++++++++++++++++++++-
1 file changed, 99 insertions(+), 3 deletions(-)
diff --git a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
index 154dd0f..d4ca6c2 100644
--- a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
+++ b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
@@ -1,13 +1,109 @@
https://gcc.gnu.org/PR97367
-https://inbox.sourceware.org/gcc-patches/20240308.123342.1112119677226246836.rene@exactcode.de/
+https://inbox.sourceware.org/gcc-patches/5f2b5d5e-a682-4084-b70e-89929f4cc6dc@bergner.org/T/#u
+
+From git@z Thu Jan 1 00:00:00 1970
+Subject: [PATCH v2] rs6000: Fix .machine cpu selection w/ altivec [PR97367]
+From: Peter Bergner <pshop@bergner.org>
+Date: Fri, 12 Jul 2024 16:48:29 -0500
+Message-Id: <5f2b5d5e-a682-4084-b70e-89929f4cc6dc@bergner.org>
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+René's patch seems to have stalled, so here is an updated version of the
+patch with the requested changes to his patch.
+
+I'll note I have added an additional code change, which is to also emit a
+".machine altivec" if Altivec is enabled. The problem this fixes is for
+cpus like the G5, which is basically a power4 plus an Altivec unit, its
+".machine power4" doesn't enable the assembler to recognize Altivec insns.
+That isn't a problem if you use gcc -mcpu=G5 to assemble the assembler file,
+since gcc passes -maltivec to the assembler. However, if you try to assemble
+the assembler file with as by hand, you'll get "unrecognized opcode" errors.
+I did not do the same for VSX, since all ".machine <cpu>" for cpus that
+support VSX already enable VSX insn recognition, so it's not needed.
+
+
+rs6000: Fix .machine cpu selection w/ altivec [PR97367]
+
+There are various non-IBM CPUs with altivec, so we cannot use that
+flag to determine which .machine cpu to use, so ignore it.
+Emit an additional ".machine altivec" if Altivec is enabled so
+that the assembler doesn't require an explicit -maltivec option
+to assemble any Altivec instructions for those targets where
+the ".machine cpu" is insufficient to enable Altivec. For example,
+-mcpu=G5 emits a ".machine power4".
+
+This passed bootstrap and regtesting on powrpc64-linux (running the testsuite
+in both 32-bit and 64-bit modes) with no regressions.
+
+Ok for trunk and the release branches after some trunk burn-in time?
+
+Peter
+
+
+2024-07-12 René Rebe <rene@exactcode.de>
+ Peter Bergner <bergner@linux.ibm.com>
+
+gcc/
+ PR target/97367
+ * config/rs6000/rs6000.c (rs6000_machine_from_flags): Do not consider
+ OPTION_MASK_ALTIVEC.
+ (emit_asm_machine): For Altivec compiles, emit a ".machine altivec".
+
+gcc/testsuite/
+ PR target/97367
+ * gcc.target/powerpc/pr97367.c: New test.
+
+Signed-of-by: René Rebe <rene@exactcode.de>
+---
+ gcc/config/rs6000/rs6000.cc | 5 ++++-
+ gcc/testsuite/gcc.target/powerpc/pr97367.c | 13 +++++++++++++
+ 2 files changed, 17 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/gcc.target/powerpc/pr97367.c
+
+diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
+index 2cbea6ea2d7..2cb8f35739b 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
-@@ -5869,7 +5869,7 @@ rs6000_machine_from_flags (void)
+@@ -5888,7 +5888,8 @@ rs6000_machine_from_flags (void)
HOST_WIDE_INT flags = rs6000_isa_flags;
/* Disable the flags that should never influence the .machine selection. */
- flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL);
-+ flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ALTIVEC | OPTION_MASK_ISEL);
++ flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL
++ | OPTION_MASK_ALTIVEC);
if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
return "power10";
+@@ -5913,6 +5914,8 @@ void
+ emit_asm_machine (void)
+ {
+ fprintf (asm_out_file, "\t.machine %s\n", rs6000_machine);
++ if (TARGET_ALTIVEC)
++ fprintf (asm_out_file, "\t.machine altivec\n");
+ }
+ #endif
+
+diff --git a/gcc/testsuite/gcc.target/powerpc/pr97367.c b/gcc/testsuite/gcc.target/powerpc/pr97367.c
+new file mode 100644
+index 00000000000..f9118dbcdec
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/powerpc/pr97367.c
+@@ -0,0 +1,13 @@
++/* PR target/97367 */
++/* { dg-options "-mdejagnu-cpu=G5" } */
++
++/* Verify we emit a ".machine power4" and ".machine altivec" rather
++ than a ".machine power7". */
++
++int dummy (void)
++{
++ return 0;
++}
++
++/* { dg-final { scan-assembler {\.\mmachine power4\M} } } */
++/* { dg-final { scan-assembler {\.\mmachine altivec\M} } } */
+--
+2.45.2
+
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-07-14 23:36 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-07-14 23:36 UTC (permalink / raw
To: gentoo-commits
commit: f3f27691478a0b256a3b52348bae96f5a6b5f089
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 14 23:35:47 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul 14 23:35:47 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=f3f27691
15.0.0: don't enable -fext-dce with -O2
Bug: https://gcc.gnu.org/PR115876
Bug: https://gcc.gnu.org/PR115877
Bug: https://gcc.gnu.org/PR115912
Bug: https://gcc.gnu.org/PR115916
Bug: https://gcc.gnu.org/PR115927
Signed-off-by: Sam James <sam <AT> gentoo.org>
...gcc_don-t-enable-fext-dce-with-O2-for-now.patch | 34 ++++++++++++++++++++++
15.0.0/gentoo/README.history | 4 +++
2 files changed, 38 insertions(+)
diff --git a/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch b/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
new file mode 100644
index 0000000..82c5535
--- /dev/null
+++ b/15.0.0/gentoo/78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
@@ -0,0 +1,34 @@
+From 86de2fd7550f75a318aa9819b115487cd850b4fc Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 15 Jul 2024 00:32:18 +0100
+Subject: [PATCH] gcc: don't enable -fext-dce with -O2 for now
+
+There's too many bugs involving it for now.
+
+ gcc/
+ * opts.cc (default_options_table): Don't enable ext-dce at -O2
+
+Bug: https://gcc.gnu.org/PR115876
+Bug: https://gcc.gnu.org/PR115877
+Bug: https://gcc.gnu.org/PR115912
+Bug: https://gcc.gnu.org/PR115916
+Bug: https://gcc.gnu.org/PR115927
+---
+ gcc/opts.cc | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/gcc/opts.cc b/gcc/opts.cc
+index be90a632338f..e1a1bdf15822 100644
+--- a/gcc/opts.cc
++++ b/gcc/opts.cc
+@@ -634,7 +634,6 @@ static const struct default_options default_options_table[] =
+ { OPT_LEVELS_2_PLUS, OPT_fdevirtualize, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fdevirtualize_speculatively, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fexpensive_optimizations, NULL, 1 },
+- { OPT_LEVELS_2_PLUS, OPT_fext_dce, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fgcse, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
+ { OPT_LEVELS_2_PLUS, OPT_findirect_inlining, NULL, 1 },
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index efe48af..eddda8f 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+5 15 July 2024
+
+ + 78_all_gcc_don-t-enable-fext-dce-with-O2-for-now.patch
+
4 16 June 2024
- 77_all_PR115387.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-28 12:49 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-28 12:49 UTC (permalink / raw
To: gentoo-commits
commit: b97a75814a0b8969a5669c761dde86dc0d9ee2a1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 28 12:49:23 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 28 12:49:23 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=b97a7581
15.0.0: drop x86 backend fixes
Now fixed upstream.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gentoo/77_all_i386-fix-ix86_expand_move.patch | 47 -----------
.../78_all_i386-fix-recent-alias-set-change.patch | 97 ----------------------
2 files changed, 144 deletions(-)
diff --git a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
deleted file mode 100644
index 2b5b8d4..0000000
--- a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From ec0ead755e65ba51813aa8b66f4eb5574dd8437c Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Wed, 26 Jun 2024 13:19:42 +0100
-Subject: [PATCH 1/2] i386: fix ix86_expand_move
-
-Before r15-1599-g63512c72df09b4, legitimize_pe_coff_symbol would return NULL_RTX
-for non-PECOFF targets, so the else branch would get taken.
-
-(This is a hack which doesn't work for PECOFF targets but fixes miscompilations
-on ELF.)
-
-This partially reverts commit r15-1599-g63512c72df09b4.
-
-Bug: https://gcc.gnu.org/PR115635
-Bug: https://gcc.gnu.org/PR115661
----
- gcc/config/i386/i386-expand.cc | 10 ----------
- 1 file changed, 10 deletions(-)
-
-diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
-index 5dfa7d49f58c..5e0173bc7a84 100644
---- a/gcc/config/i386/i386-expand.cc
-+++ b/gcc/config/i386/i386-expand.cc
-@@ -412,20 +412,10 @@ ix86_expand_move (machine_mode mode, rtx operands[])
- }
- else
- {
--#if TARGET_PECOFF
-- tmp = legitimize_pe_coff_symbol (op1, addend != NULL_RTX);
-- if (tmp)
-- {
-- op1 = tmp;
-- if (!addend)
-- break;
-- }
-- else
- {
- op1 = operands[1];
- break;
- }
--#endif
- }
-
- if (addend)
---
-2.45.2
-
diff --git a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
deleted file mode 100644
index eb8f5bd..0000000
--- a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
+++ /dev/null
@@ -1,97 +0,0 @@
-From 72a4d2d437782afa975f9b29c3ab4a1826ad0cd6 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Wed, 26 Jun 2024 12:54:55 +0100
-Subject: [PATCH 2/2] i386: fix recent alias set change
-
-Before r15-1599-g63512c72df09b4, we would create a new alias set, but now
-we use -1. Go back to using ix86_GOT_alias_set.
-
-(This is a hack which isn't the cleanest way of fixing it.)
-
-This partially reverts commit r15-1599-g63512c72df09b4.
-
-Bug: https://gcc.gnu.org/PR115635
-Bug: https://gcc.gnu.org/PR115661
----
- gcc/config/i386/i386-expand.cc | 2 +-
- gcc/config/i386/i386-expand.h | 1 +
- gcc/config/i386/i386.cc | 17 ++++++++++++++---
- 3 files changed, 16 insertions(+), 4 deletions(-)
-
-diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
-index 5e0173bc7a84..3345f40ad85d 100644
---- a/gcc/config/i386/i386-expand.cc
-+++ b/gcc/config/i386/i386-expand.cc
-@@ -408,7 +408,7 @@ ix86_expand_move (machine_mode mode, rtx operands[])
- : UNSPEC_GOT));
- op1 = gen_rtx_CONST (Pmode, op1);
- op1 = gen_const_mem (Pmode, op1);
-- set_mem_alias_set (op1, GOT_ALIAS_SET);
-+ set_mem_alias_set (op1, ix86_GOT_alias_set ());
- }
- else
- {
-diff --git a/gcc/config/i386/i386-expand.h b/gcc/config/i386/i386-expand.h
-index 5e02df1706df..56bee29253ba 100644
---- a/gcc/config/i386/i386-expand.h
-+++ b/gcc/config/i386/i386-expand.h
-@@ -34,6 +34,7 @@ struct expand_vec_perm_d
- };
-
- rtx legitimize_tls_address (rtx x, enum tls_model model, bool for_mov);
-+alias_set_type ix86_GOT_alias_set (void);
- rtx legitimize_pic_address (rtx orig, rtx reg);
-
- bool insn_defines_reg (unsigned int regno1, unsigned int regno2,
-diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
-index 1f71ed04be67..62fca080f2f5 100644
---- a/gcc/config/i386/i386.cc
-+++ b/gcc/config/i386/i386.cc
-@@ -11823,6 +11823,17 @@ constant_address_p (rtx x)
- }
- \f
-
-+/* Return a unique alias set for the GOT. */
-+
-+alias_set_type
-+ix86_GOT_alias_set (void)
-+{
-+ static alias_set_type set = -1;
-+ if (set == -1)
-+ set = new_alias_set ();
-+ return set;
-+}
-+
- /* Return a legitimate reference for ORIG (an address) using the
- register REG. If REG is 0, a new pseudo is generated.
-
-@@ -11925,7 +11936,7 @@ legitimize_pic_address (rtx orig, rtx reg)
- UNSPEC_GOTPCREL);
- new_rtx = gen_rtx_CONST (Pmode, new_rtx);
- new_rtx = gen_const_mem (Pmode, new_rtx);
-- set_mem_alias_set (new_rtx, GOT_ALIAS_SET);
-+ set_mem_alias_set (new_rtx, ix86_GOT_alias_set ());
- }
- else
- {
-@@ -11947,7 +11958,7 @@ legitimize_pic_address (rtx orig, rtx reg)
- new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx);
-
- new_rtx = gen_const_mem (Pmode, new_rtx);
-- set_mem_alias_set (new_rtx, GOT_ALIAS_SET);
-+ set_mem_alias_set (new_rtx, ix86_GOT_alias_set ());
- }
-
- new_rtx = copy_to_suggested_reg (new_rtx, reg, Pmode);
-@@ -12324,7 +12335,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
- if (pic)
- off = gen_rtx_PLUS (tp_mode, pic, off);
- off = gen_const_mem (tp_mode, off);
-- set_mem_alias_set (off, GOT_ALIAS_SET);
-+ set_mem_alias_set (off, ix86_GOT_alias_set ());
-
- if (TARGET_64BIT || TARGET_ANY_GNU_TLS)
- {
---
-2.45.2
-
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-27 0:02 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-27 0:02 UTC (permalink / raw
To: gentoo-commits
commit: 7760ff0bf2fd5fa05385fc11158cb7efd7a05cc5
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 27 00:02:16 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 27 00:02:16 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7760ff0b
15.0.0: add revert annotation
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch | 2 ++
15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch | 2 ++
2 files changed, 4 insertions(+)
diff --git a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
index 4b42ea9..2b5b8d4 100644
--- a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
+++ b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
@@ -9,6 +9,8 @@ for non-PECOFF targets, so the else branch would get taken.
(This is a hack which doesn't work for PECOFF targets but fixes miscompilations
on ELF.)
+This partially reverts commit r15-1599-g63512c72df09b4.
+
Bug: https://gcc.gnu.org/PR115635
Bug: https://gcc.gnu.org/PR115661
---
diff --git a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
index 6776fdd..eb8f5bd 100644
--- a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
+++ b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
@@ -8,6 +8,8 @@ we use -1. Go back to using ix86_GOT_alias_set.
(This is a hack which isn't the cleanest way of fixing it.)
+This partially reverts commit r15-1599-g63512c72df09b4.
+
Bug: https://gcc.gnu.org/PR115635
Bug: https://gcc.gnu.org/PR115661
---
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-26 23:57 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-26 23:57 UTC (permalink / raw
To: gentoo-commits
commit: e35c53788a928179ef26b76833bcbe297f84fe6a
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 26 23:57:28 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 23:57:52 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=e35c5378
15.0.0: workaround recent x86 changes
Bug: https://gcc.gnu.org/PR115635
Bug: https://gcc.gnu.org/PR115661
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../gentoo/77_all_i386-fix-ix86_expand_move.patch | 45 ++++++++++
.../78_all_i386-fix-recent-alias-set-change.patch | 95 ++++++++++++++++++++++
2 files changed, 140 insertions(+)
diff --git a/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
new file mode 100644
index 0000000..4b42ea9
--- /dev/null
+++ b/15.0.0/gentoo/77_all_i386-fix-ix86_expand_move.patch
@@ -0,0 +1,45 @@
+From ec0ead755e65ba51813aa8b66f4eb5574dd8437c Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 26 Jun 2024 13:19:42 +0100
+Subject: [PATCH 1/2] i386: fix ix86_expand_move
+
+Before r15-1599-g63512c72df09b4, legitimize_pe_coff_symbol would return NULL_RTX
+for non-PECOFF targets, so the else branch would get taken.
+
+(This is a hack which doesn't work for PECOFF targets but fixes miscompilations
+on ELF.)
+
+Bug: https://gcc.gnu.org/PR115635
+Bug: https://gcc.gnu.org/PR115661
+---
+ gcc/config/i386/i386-expand.cc | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
+index 5dfa7d49f58c..5e0173bc7a84 100644
+--- a/gcc/config/i386/i386-expand.cc
++++ b/gcc/config/i386/i386-expand.cc
+@@ -412,20 +412,10 @@ ix86_expand_move (machine_mode mode, rtx operands[])
+ }
+ else
+ {
+-#if TARGET_PECOFF
+- tmp = legitimize_pe_coff_symbol (op1, addend != NULL_RTX);
+- if (tmp)
+- {
+- op1 = tmp;
+- if (!addend)
+- break;
+- }
+- else
+ {
+ op1 = operands[1];
+ break;
+ }
+-#endif
+ }
+
+ if (addend)
+--
+2.45.2
+
diff --git a/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
new file mode 100644
index 0000000..6776fdd
--- /dev/null
+++ b/15.0.0/gentoo/78_all_i386-fix-recent-alias-set-change.patch
@@ -0,0 +1,95 @@
+From 72a4d2d437782afa975f9b29c3ab4a1826ad0cd6 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 26 Jun 2024 12:54:55 +0100
+Subject: [PATCH 2/2] i386: fix recent alias set change
+
+Before r15-1599-g63512c72df09b4, we would create a new alias set, but now
+we use -1. Go back to using ix86_GOT_alias_set.
+
+(This is a hack which isn't the cleanest way of fixing it.)
+
+Bug: https://gcc.gnu.org/PR115635
+Bug: https://gcc.gnu.org/PR115661
+---
+ gcc/config/i386/i386-expand.cc | 2 +-
+ gcc/config/i386/i386-expand.h | 1 +
+ gcc/config/i386/i386.cc | 17 ++++++++++++++---
+ 3 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
+index 5e0173bc7a84..3345f40ad85d 100644
+--- a/gcc/config/i386/i386-expand.cc
++++ b/gcc/config/i386/i386-expand.cc
+@@ -408,7 +408,7 @@ ix86_expand_move (machine_mode mode, rtx operands[])
+ : UNSPEC_GOT));
+ op1 = gen_rtx_CONST (Pmode, op1);
+ op1 = gen_const_mem (Pmode, op1);
+- set_mem_alias_set (op1, GOT_ALIAS_SET);
++ set_mem_alias_set (op1, ix86_GOT_alias_set ());
+ }
+ else
+ {
+diff --git a/gcc/config/i386/i386-expand.h b/gcc/config/i386/i386-expand.h
+index 5e02df1706df..56bee29253ba 100644
+--- a/gcc/config/i386/i386-expand.h
++++ b/gcc/config/i386/i386-expand.h
+@@ -34,6 +34,7 @@ struct expand_vec_perm_d
+ };
+
+ rtx legitimize_tls_address (rtx x, enum tls_model model, bool for_mov);
++alias_set_type ix86_GOT_alias_set (void);
+ rtx legitimize_pic_address (rtx orig, rtx reg);
+
+ bool insn_defines_reg (unsigned int regno1, unsigned int regno2,
+diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc
+index 1f71ed04be67..62fca080f2f5 100644
+--- a/gcc/config/i386/i386.cc
++++ b/gcc/config/i386/i386.cc
+@@ -11823,6 +11823,17 @@ constant_address_p (rtx x)
+ }
+ \f
+
++/* Return a unique alias set for the GOT. */
++
++alias_set_type
++ix86_GOT_alias_set (void)
++{
++ static alias_set_type set = -1;
++ if (set == -1)
++ set = new_alias_set ();
++ return set;
++}
++
+ /* Return a legitimate reference for ORIG (an address) using the
+ register REG. If REG is 0, a new pseudo is generated.
+
+@@ -11925,7 +11936,7 @@ legitimize_pic_address (rtx orig, rtx reg)
+ UNSPEC_GOTPCREL);
+ new_rtx = gen_rtx_CONST (Pmode, new_rtx);
+ new_rtx = gen_const_mem (Pmode, new_rtx);
+- set_mem_alias_set (new_rtx, GOT_ALIAS_SET);
++ set_mem_alias_set (new_rtx, ix86_GOT_alias_set ());
+ }
+ else
+ {
+@@ -11947,7 +11958,7 @@ legitimize_pic_address (rtx orig, rtx reg)
+ new_rtx = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new_rtx);
+
+ new_rtx = gen_const_mem (Pmode, new_rtx);
+- set_mem_alias_set (new_rtx, GOT_ALIAS_SET);
++ set_mem_alias_set (new_rtx, ix86_GOT_alias_set ());
+ }
+
+ new_rtx = copy_to_suggested_reg (new_rtx, reg, Pmode);
+@@ -12324,7 +12335,7 @@ legitimize_tls_address (rtx x, enum tls_model model, bool for_mov)
+ if (pic)
+ off = gen_rtx_PLUS (tp_mode, pic, off);
+ off = gen_const_mem (tp_mode, off);
+- set_mem_alias_set (off, GOT_ALIAS_SET);
++ set_mem_alias_set (off, ix86_GOT_alias_set ());
+
+ if (TARGET_64BIT || TARGET_ANY_GNU_TLS)
+ {
+--
+2.45.2
+
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-16 22:45 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-16 22:45 UTC (permalink / raw
To: gentoo-commits
commit: 9b921e3a315f6c478a72c39a444ed694438fdcb2
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 16 22:45:05 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jun 16 22:45:05 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9b921e3a
15.0.0: cut patchset 4
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 6c43a46..efe48af 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-4 ????
+4 16 June 2024
- 77_all_PR115387.patch
- 78_all_PR115395.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-10 20:18 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-10 20:18 UTC (permalink / raw
To: gentoo-commits
commit: c8bf41759fe849050fcb5c5105483c9db6b15da2
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 20:18:07 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 20:18:07 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c8bf4175
15.0.0: drop upstream 77_all_PR115387.patch
It got merged.
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/77_all_PR115387.patch | 206 ------------------------------------
15.0.0/gentoo/README.history | 1 +
2 files changed, 1 insertion(+), 206 deletions(-)
diff --git a/15.0.0/gentoo/77_all_PR115387.patch b/15.0.0/gentoo/77_all_PR115387.patch
deleted file mode 100644
index bf143e7..0000000
--- a/15.0.0/gentoo/77_all_PR115387.patch
+++ /dev/null
@@ -1,206 +0,0 @@
-https://gcc.gnu.org/PR115387
-https://inbox.sourceware.org/gcc-patches/430da3ad-59a6-4f16-b35f-8bef724a7ed7@gmail.com/T/#t
-
-From mboxrd@z Thu Jan 1 00:00:00 1970
-Return-Path: <SRS0=SYw7=NM=intel.com=pan2.li@sourceware.org>
-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14])
- by sourceware.org (Postfix) with ESMTPS id 48A883858CDB
- for <gcc-patches@gcc.gnu.org>; Mon, 10 Jun 2024 14:49:07 +0000 (GMT)
-DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48A883858CDB
-Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com
-Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com
-ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 48A883858CDB
-Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.14
-ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718030949; cv=none;
- b=sYMAFxaXXHzkHsYoFI0HFGXWzujiQRXs1KA4PpQKerabnFz185hAazNZgv5HRn33NHy30a6CaFSGdNqMzI5rJ/uWP0t/IVSZPws+DkO9GCBPkgQLIHvRRf5J+uf7usxHf+quk0tjfzrDkHctT7riGqQjzSEAkBTwrKXd7X9aQ9k=
-ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
- t=1718030949; c=relaxed/simple;
- bh=p/hDLfesLAxds7UkloKeUvZGINWc0ydc/cnr4ptMBSU=;
- h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=GtE3ODQcVtLdsf2+edm43ZWyfgTSrruAj3RQ1zIcTMeifKot7fY59t2YIAFrSyx/vKLMuPwocIQ8p3VmYLj4DB2f8ybXvEhBcx2pxlh5GNVmPxjGtJsnrv6p7oMG9CA6X/bns8vlMhr2CgwzHRba7bItkwFWjKkI8gbJz3v9zeo=
-ARC-Authentication-Results: i=1; server2.sourceware.org
-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
- d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
- t=1718030948; x=1749566948;
- h=from:to:cc:subject:date:message-id:mime-version:
- content-transfer-encoding;
- bh=p/hDLfesLAxds7UkloKeUvZGINWc0ydc/cnr4ptMBSU=;
- b=biitKQIpbkCUKRo31CQVWz5tQ3QP6AsTulnDi3LB7cDTMJflku4VDWDx
- Dnu97Pvn/2HzgfrZyN+1kVfGvLnehrErvG2qw3kZ2PGu0AiKrtnTRj0ED
- UdyWa4+MQF5nj34UK92MRcA1Ovou3O89YdQ11EmVuL1KynSTtKgwo/d/9
- JsYn3MkWZP6NjVgZteOu5xBZF+J3NxK61azjaUgP8LIxo1bmEKUMBgo0f
- p0gXtZXjZkxtpcqzr++CtB6e4fKUHQK8z/FjOzaHvwIzmxdoEcptRGtl9
- v+2kXKMcvMQGZZlsBfFIewmNKjK6qUYGrDKl1wltMZMkeijuudmObyhaq
- A==;
-X-CSE-ConnectionGUID: JaJ1NR5jSimBRrZvjuM+Lw==
-X-CSE-MsgGUID: Q6rSZfGaQfOHvXT9LPs02g==
-X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="18526139"
-X-IronPort-AV: E=Sophos;i="6.08,227,1712646000";
- d="scan'208";a="18526139"
-Received: from orviesa002.jf.intel.com ([10.64.159.142])
- by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 07:49:07 -0700
-X-CSE-ConnectionGUID: +SJ6B8QPQfWwhjgjPJujEw==
-X-CSE-MsgGUID: eHhYmO22SKyPWaJe7LW77Q==
-X-ExtLoop1: 1
-X-IronPort-AV: E=Sophos;i="6.08,227,1712646000";
- d="scan'208";a="69872329"
-Received: from shvmail03.sh.intel.com ([10.239.245.20])
- by orviesa002.jf.intel.com with ESMTP; 10 Jun 2024 07:49:04 -0700
-Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47])
- by shvmail03.sh.intel.com (Postfix) with ESMTP id E43A71007C1D;
- Mon, 10 Jun 2024 22:49:02 +0800 (CST)
-From: pan2.li@intel.com
-To: gcc-patches@gcc.gnu.org
-Cc: juzhe.zhong@rivai.ai,
- kito.cheng@gmail.com,
- richard.guenther@gmail.com,
- Pan Li <pan2.li@intel.com>
-Subject: [PATCH v1] Widening-Mul: Fix one ICE of gcall insertion for PHI match
-Date: Mon, 10 Jun 2024 22:49:01 +0800
-Message-Id: <20240610144901.3723532-1-pan2.li@intel.com>
-X-Mailer: git-send-email 2.34.1
-MIME-Version: 1.0
-Content-Transfer-Encoding: 8bit
-X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
-X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org
-List-Id: <gcc-patches.gcc.gnu.org>
-
-From: Pan Li <pan2.li@intel.com>
-
-When enabled the PHI handing for COND_EXPR, we need to insert the gcall
-to replace the PHI node. Unfortunately, I made a mistake that insert
-the gcall to before the last stmt of the bb. See below gimple, the PHI
-is located at no.1 but we insert the gcall (aka no.9) to the end of
-the bb. Then the use of _9 in no.2 will have no def and will trigger
-ICE when verify_ssa.
-
- 1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
- 2. prephitmp_36 = (char *) _9;
- 3. buf.write_base = string_13(D);
- 4. buf.write_ptr = string_13(D);
- 5. buf.write_end = prephitmp_36;
- 6. buf.written = 0;
- 7. buf.mode = 3;
- 8. _7 = buf.write_end;
- 9. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to last bb by mistake
-
-This patch would like to insert the gcall to before the start of the bb
-stmt. To ensure the possible use of PHI_result will have a def exists.
-After this patch the above gimple will be:
-
- 0. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to start bb by mistake
- 1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
- 2. prephitmp_36 = (char *) _9;
- 3. buf.write_base = string_13(D);
- 4. buf.write_ptr = string_13(D);
- 5. buf.write_end = prephitmp_36;
- 6. buf.written = 0;
- 7. buf.mode = 3;
- 8. _7 = buf.write_end;
-
-The below test suites are passed for this patch:
-* The rv64gcv fully regression test with newlib.
-* The rv64gcv build with glibc.
-* The x86 regression test with newlib.
-* The x86 bootstrap test with newlib.
-
- PR target/115387
-
-gcc/ChangeLog:
-
- * tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children): Take
- the gsi of start_bb instead of last_bb.
-
-gcc/testsuite/ChangeLog:
-
- * gcc.target/riscv/pr115387-1.c: New test.
- * gcc.target/riscv/pr115387-2.c: New test.
-
-Signed-off-by: Pan Li <pan2.li@intel.com>
----
- gcc/testsuite/gcc.target/riscv/pr115387-1.c | 35 +++++++++++++++++++++
- gcc/testsuite/gcc.target/riscv/pr115387-2.c | 18 +++++++++++
- gcc/tree-ssa-math-opts.cc | 2 +-
- 3 files changed, 54 insertions(+), 1 deletion(-)
- create mode 100644 gcc/testsuite/gcc.target/riscv/pr115387-1.c
- create mode 100644 gcc/testsuite/gcc.target/riscv/pr115387-2.c
-
-diff --git a/gcc/testsuite/gcc.target/riscv/pr115387-1.c b/gcc/testsuite/gcc.target/riscv/pr115387-1.c
-new file mode 100644
-index 00000000000..a1c926977c4
---- /dev/null
-+++ b/gcc/testsuite/gcc.target/riscv/pr115387-1.c
-@@ -0,0 +1,35 @@
-+/* Test there is no ICE when compile. */
-+/* { dg-do compile } */
-+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
-+
-+#define PRINTF_CHK 0x34
-+
-+typedef unsigned long uintptr_t;
-+
-+struct __printf_buffer {
-+ char *write_ptr;
-+ int status;
-+};
-+
-+extern void __printf_buffer_init_end (struct __printf_buffer *, char *, char *);
-+
-+void
-+test (char *string, unsigned long maxlen, unsigned mode_flags)
-+{
-+ struct __printf_buffer buf;
-+
-+ if ((mode_flags & PRINTF_CHK) != 0)
-+ {
-+ string[0] = '\0';
-+ uintptr_t end;
-+
-+ if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
-+ end = -1;
-+
-+ __printf_buffer_init_end (&buf, string, (char *) end);
-+ }
-+ else
-+ __printf_buffer_init_end (&buf, string, (char *) ~(uintptr_t) 0);
-+
-+ *buf.write_ptr = '\0';
-+}
-diff --git a/gcc/testsuite/gcc.target/riscv/pr115387-2.c b/gcc/testsuite/gcc.target/riscv/pr115387-2.c
-new file mode 100644
-index 00000000000..7183bf18dfd
---- /dev/null
-+++ b/gcc/testsuite/gcc.target/riscv/pr115387-2.c
-@@ -0,0 +1,18 @@
-+/* Test there is no ICE when compile. */
-+/* { dg-do compile } */
-+/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
-+
-+#include <stddef.h>
-+#include <stdint-gcc.h>
-+
-+char *
-+test (char *string, size_t maxlen)
-+{
-+ string[0] = '\0';
-+ uintptr_t end;
-+
-+ if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
-+ end = -1;
-+
-+ return (char *) end;
-+}
-diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
-index 173b0366f5e..fbb8e0ea306 100644
---- a/gcc/tree-ssa-math-opts.cc
-+++ b/gcc/tree-ssa-math-opts.cc
-@@ -6102,7 +6102,7 @@ math_opts_dom_walker::after_dom_children (basic_block bb)
- for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
- gsi_next (&psi))
- {
-- gimple_stmt_iterator gsi = gsi_last_bb (bb);
-+ gimple_stmt_iterator gsi = gsi_start_bb (bb);
- match_unsigned_saturation_add (&gsi, psi.phi ());
- }
-
---
-2.34.1
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 81ca552..6c43a46 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,5 +1,6 @@
4 ????
+ - 77_all_PR115387.patch
- 78_all_PR115395.patch
3 10 June 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-10 17:28 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-10 17:28 UTC (permalink / raw
To: gentoo-commits
commit: 75e80ce24ee1b7a17c13e9e513cab5ba81635262
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 17:25:14 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 17:25:14 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=75e80ce2
15.0.0: backport two fixes
A severe miscompilation and a severe ICE fix.
Bug: https://gcc.gnu.org/PR115387
Bug: https://gcc.gnu.org/PR115395
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/77_all_PR115387.patch | 206 ++++++++++++++++++++++++++++++++++++
15.0.0/gentoo/78_all_PR115395.patch | 107 +++++++++++++++++++
15.0.0/gentoo/README.history | 5 +
3 files changed, 318 insertions(+)
diff --git a/15.0.0/gentoo/77_all_PR115387.patch b/15.0.0/gentoo/77_all_PR115387.patch
new file mode 100644
index 0000000..bf143e7
--- /dev/null
+++ b/15.0.0/gentoo/77_all_PR115387.patch
@@ -0,0 +1,206 @@
+https://gcc.gnu.org/PR115387
+https://inbox.sourceware.org/gcc-patches/430da3ad-59a6-4f16-b35f-8bef724a7ed7@gmail.com/T/#t
+
+From mboxrd@z Thu Jan 1 00:00:00 1970
+Return-Path: <SRS0=SYw7=NM=intel.com=pan2.li@sourceware.org>
+Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14])
+ by sourceware.org (Postfix) with ESMTPS id 48A883858CDB
+ for <gcc-patches@gcc.gnu.org>; Mon, 10 Jun 2024 14:49:07 +0000 (GMT)
+DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48A883858CDB
+Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com
+Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com
+ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 48A883858CDB
+Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.14
+ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718030949; cv=none;
+ b=sYMAFxaXXHzkHsYoFI0HFGXWzujiQRXs1KA4PpQKerabnFz185hAazNZgv5HRn33NHy30a6CaFSGdNqMzI5rJ/uWP0t/IVSZPws+DkO9GCBPkgQLIHvRRf5J+uf7usxHf+quk0tjfzrDkHctT7riGqQjzSEAkBTwrKXd7X9aQ9k=
+ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
+ t=1718030949; c=relaxed/simple;
+ bh=p/hDLfesLAxds7UkloKeUvZGINWc0ydc/cnr4ptMBSU=;
+ h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=GtE3ODQcVtLdsf2+edm43ZWyfgTSrruAj3RQ1zIcTMeifKot7fY59t2YIAFrSyx/vKLMuPwocIQ8p3VmYLj4DB2f8ybXvEhBcx2pxlh5GNVmPxjGtJsnrv6p7oMG9CA6X/bns8vlMhr2CgwzHRba7bItkwFWjKkI8gbJz3v9zeo=
+ARC-Authentication-Results: i=1; server2.sourceware.org
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
+ d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
+ t=1718030948; x=1749566948;
+ h=from:to:cc:subject:date:message-id:mime-version:
+ content-transfer-encoding;
+ bh=p/hDLfesLAxds7UkloKeUvZGINWc0ydc/cnr4ptMBSU=;
+ b=biitKQIpbkCUKRo31CQVWz5tQ3QP6AsTulnDi3LB7cDTMJflku4VDWDx
+ Dnu97Pvn/2HzgfrZyN+1kVfGvLnehrErvG2qw3kZ2PGu0AiKrtnTRj0ED
+ UdyWa4+MQF5nj34UK92MRcA1Ovou3O89YdQ11EmVuL1KynSTtKgwo/d/9
+ JsYn3MkWZP6NjVgZteOu5xBZF+J3NxK61azjaUgP8LIxo1bmEKUMBgo0f
+ p0gXtZXjZkxtpcqzr++CtB6e4fKUHQK8z/FjOzaHvwIzmxdoEcptRGtl9
+ v+2kXKMcvMQGZZlsBfFIewmNKjK6qUYGrDKl1wltMZMkeijuudmObyhaq
+ A==;
+X-CSE-ConnectionGUID: JaJ1NR5jSimBRrZvjuM+Lw==
+X-CSE-MsgGUID: Q6rSZfGaQfOHvXT9LPs02g==
+X-IronPort-AV: E=McAfee;i="6600,9927,11099"; a="18526139"
+X-IronPort-AV: E=Sophos;i="6.08,227,1712646000";
+ d="scan'208";a="18526139"
+Received: from orviesa002.jf.intel.com ([10.64.159.142])
+ by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2024 07:49:07 -0700
+X-CSE-ConnectionGUID: +SJ6B8QPQfWwhjgjPJujEw==
+X-CSE-MsgGUID: eHhYmO22SKyPWaJe7LW77Q==
+X-ExtLoop1: 1
+X-IronPort-AV: E=Sophos;i="6.08,227,1712646000";
+ d="scan'208";a="69872329"
+Received: from shvmail03.sh.intel.com ([10.239.245.20])
+ by orviesa002.jf.intel.com with ESMTP; 10 Jun 2024 07:49:04 -0700
+Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47])
+ by shvmail03.sh.intel.com (Postfix) with ESMTP id E43A71007C1D;
+ Mon, 10 Jun 2024 22:49:02 +0800 (CST)
+From: pan2.li@intel.com
+To: gcc-patches@gcc.gnu.org
+Cc: juzhe.zhong@rivai.ai,
+ kito.cheng@gmail.com,
+ richard.guenther@gmail.com,
+ Pan Li <pan2.li@intel.com>
+Subject: [PATCH v1] Widening-Mul: Fix one ICE of gcall insertion for PHI match
+Date: Mon, 10 Jun 2024 22:49:01 +0800
+Message-Id: <20240610144901.3723532-1-pan2.li@intel.com>
+X-Mailer: git-send-email 2.34.1
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
+X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org
+List-Id: <gcc-patches.gcc.gnu.org>
+
+From: Pan Li <pan2.li@intel.com>
+
+When enabled the PHI handing for COND_EXPR, we need to insert the gcall
+to replace the PHI node. Unfortunately, I made a mistake that insert
+the gcall to before the last stmt of the bb. See below gimple, the PHI
+is located at no.1 but we insert the gcall (aka no.9) to the end of
+the bb. Then the use of _9 in no.2 will have no def and will trigger
+ICE when verify_ssa.
+
+ 1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
+ 2. prephitmp_36 = (char *) _9;
+ 3. buf.write_base = string_13(D);
+ 4. buf.write_ptr = string_13(D);
+ 5. buf.write_end = prephitmp_36;
+ 6. buf.written = 0;
+ 7. buf.mode = 3;
+ 8. _7 = buf.write_end;
+ 9. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to last bb by mistake
+
+This patch would like to insert the gcall to before the start of the bb
+stmt. To ensure the possible use of PHI_result will have a def exists.
+After this patch the above gimple will be:
+
+ 0. _9 = .SAT_ADD (string.0_2, maxlen_15(D)); // Insert gcall to start bb by mistake
+ 1. # _9 = PHI <_3(4), 18446744073709551615(3)> // The PHI node to be deleted.
+ 2. prephitmp_36 = (char *) _9;
+ 3. buf.write_base = string_13(D);
+ 4. buf.write_ptr = string_13(D);
+ 5. buf.write_end = prephitmp_36;
+ 6. buf.written = 0;
+ 7. buf.mode = 3;
+ 8. _7 = buf.write_end;
+
+The below test suites are passed for this patch:
+* The rv64gcv fully regression test with newlib.
+* The rv64gcv build with glibc.
+* The x86 regression test with newlib.
+* The x86 bootstrap test with newlib.
+
+ PR target/115387
+
+gcc/ChangeLog:
+
+ * tree-ssa-math-opts.cc (math_opts_dom_walker::after_dom_children): Take
+ the gsi of start_bb instead of last_bb.
+
+gcc/testsuite/ChangeLog:
+
+ * gcc.target/riscv/pr115387-1.c: New test.
+ * gcc.target/riscv/pr115387-2.c: New test.
+
+Signed-off-by: Pan Li <pan2.li@intel.com>
+---
+ gcc/testsuite/gcc.target/riscv/pr115387-1.c | 35 +++++++++++++++++++++
+ gcc/testsuite/gcc.target/riscv/pr115387-2.c | 18 +++++++++++
+ gcc/tree-ssa-math-opts.cc | 2 +-
+ 3 files changed, 54 insertions(+), 1 deletion(-)
+ create mode 100644 gcc/testsuite/gcc.target/riscv/pr115387-1.c
+ create mode 100644 gcc/testsuite/gcc.target/riscv/pr115387-2.c
+
+diff --git a/gcc/testsuite/gcc.target/riscv/pr115387-1.c b/gcc/testsuite/gcc.target/riscv/pr115387-1.c
+new file mode 100644
+index 00000000000..a1c926977c4
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/riscv/pr115387-1.c
+@@ -0,0 +1,35 @@
++/* Test there is no ICE when compile. */
++/* { dg-do compile } */
++/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
++
++#define PRINTF_CHK 0x34
++
++typedef unsigned long uintptr_t;
++
++struct __printf_buffer {
++ char *write_ptr;
++ int status;
++};
++
++extern void __printf_buffer_init_end (struct __printf_buffer *, char *, char *);
++
++void
++test (char *string, unsigned long maxlen, unsigned mode_flags)
++{
++ struct __printf_buffer buf;
++
++ if ((mode_flags & PRINTF_CHK) != 0)
++ {
++ string[0] = '\0';
++ uintptr_t end;
++
++ if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
++ end = -1;
++
++ __printf_buffer_init_end (&buf, string, (char *) end);
++ }
++ else
++ __printf_buffer_init_end (&buf, string, (char *) ~(uintptr_t) 0);
++
++ *buf.write_ptr = '\0';
++}
+diff --git a/gcc/testsuite/gcc.target/riscv/pr115387-2.c b/gcc/testsuite/gcc.target/riscv/pr115387-2.c
+new file mode 100644
+index 00000000000..7183bf18dfd
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/riscv/pr115387-2.c
+@@ -0,0 +1,18 @@
++/* Test there is no ICE when compile. */
++/* { dg-do compile } */
++/* { dg-options "-march=rv64gcv -mabi=lp64d -O3" } */
++
++#include <stddef.h>
++#include <stdint-gcc.h>
++
++char *
++test (char *string, size_t maxlen)
++{
++ string[0] = '\0';
++ uintptr_t end;
++
++ if (__builtin_add_overflow ((uintptr_t) string, maxlen, &end))
++ end = -1;
++
++ return (char *) end;
++}
+diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc
+index 173b0366f5e..fbb8e0ea306 100644
+--- a/gcc/tree-ssa-math-opts.cc
++++ b/gcc/tree-ssa-math-opts.cc
+@@ -6102,7 +6102,7 @@ math_opts_dom_walker::after_dom_children (basic_block bb)
+ for (gphi_iterator psi = gsi_start_phis (bb); !gsi_end_p (psi);
+ gsi_next (&psi))
+ {
+- gimple_stmt_iterator gsi = gsi_last_bb (bb);
++ gimple_stmt_iterator gsi = gsi_start_bb (bb);
+ match_unsigned_saturation_add (&gsi, psi.phi ());
+ }
+
+--
+2.34.1
diff --git a/15.0.0/gentoo/78_all_PR115395.patch b/15.0.0/gentoo/78_all_PR115395.patch
new file mode 100644
index 0000000..d98c043
--- /dev/null
+++ b/15.0.0/gentoo/78_all_PR115395.patch
@@ -0,0 +1,107 @@
+https://gcc.gnu.org/PR115395
+
+From 4ed9c5df7efeb98e190573cca42a4fd40666c45f Mon Sep 17 00:00:00 2001
+From: Richard Biener <rguenther@suse.de>
+Date: Mon, 10 Jun 2024 10:12:52 +0200
+Subject: [PATCH] tree-optimization/115395 - wrong-code with SLP reduction in
+ epilog
+
+When we continue a non-SLP reduction from the main loop in the
+epilog with a SLP reduction we currently fail to handle an
+adjustment by the initial value because that's not a thing with SLP.
+As long as we have the possibility to mix SLP and non-SLP we have
+to handle it though.
+
+ PR tree-optimization/115395
+ * tree-vect-loop.cc (vect_create_epilog_for_reduction):
+ Handle STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT also for SLP
+ reductions of group_size one.
+
+ * gcc.dg/vect/pr115395.c: New testcase.
+---
+ gcc/testsuite/gcc.dg/vect/pr115395.c | 27 +++++++++++++++++++++++++++
+ gcc/tree-vect-loop.cc | 27 ++++++++-------------------
+ 2 files changed, 35 insertions(+), 19 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/vect/pr115395.c
+
+diff --git a/gcc/testsuite/gcc.dg/vect/pr115395.c b/gcc/testsuite/gcc.dg/vect/pr115395.c
+new file mode 100644
+index 00000000000..cd1cee9f3df
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/vect/pr115395.c
+@@ -0,0 +1,27 @@
++/* { dg-additional-options "-mavx2" { target avx2_runtime } } */
++
++#include "tree-vect.h"
++
++struct {
++ long header_size;
++ long start_offset;
++ long end_offset;
++} myrar_dbo[5] = {{0, 87, 6980}, {0, 7087, 13980}, {0, 14087, 0}};
++
++int i;
++long offset;
++
++int main()
++{
++ check_vect ();
++
++ offset += myrar_dbo[0].start_offset;
++ while (i < 2) {
++ i++;
++ offset += myrar_dbo[i].start_offset - myrar_dbo[i - 1].end_offset;
++ }
++ if (offset != 301)
++ abort();
++
++ return 0;
++}
+diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
+index 028692614bb..c471f1564a7 100644
+--- a/gcc/tree-vect-loop.cc
++++ b/gcc/tree-vect-loop.cc
+@@ -6030,25 +6030,14 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
+
+ tree induc_val = NULL_TREE;
+ tree adjustment_def = NULL;
+- if (slp_node)
+- {
+- /* Optimize: for induction condition reduction, if we can't use zero
+- for induc_val, use initial_def. */
+- if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
+- induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
+- /* ??? Coverage for 'else' isn't clear. */
+- }
++ /* Optimize: for induction condition reduction, if we can't use zero
++ for induc_val, use initial_def. */
++ if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
++ induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
++ else if (double_reduc)
++ ;
+ else
+- {
+- /* Optimize: for induction condition reduction, if we can't use zero
+- for induc_val, use initial_def. */
+- if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
+- induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
+- else if (double_reduc)
+- ;
+- else
+- adjustment_def = STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info);
+- }
++ adjustment_def = STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info);
+
+ stmt_vec_info single_live_out_stmt[] = { stmt_info };
+ array_slice<const stmt_vec_info> live_out_stmts = single_live_out_stmt;
+@@ -6873,7 +6862,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
+
+ if (adjustment_def)
+ {
+- gcc_assert (!slp_reduc);
++ gcc_assert (!slp_reduc || group_size == 1);
+ gimple_seq stmts = NULL;
+ if (double_reduc)
+ {
+--
+2.43.0
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index b2b3de3..1573b55 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+3 10 June 2024
+
+ + 77_all_PR115387.patch
+ + 78_all_PR115395.patch
+
2 10 June 2024
- 76_all_ppc_PR112868-no-checking-many.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-10 17:28 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-10 17:28 UTC (permalink / raw
To: gentoo-commits
commit: 98503e61e8b723a012ccef2eed6a8387e43535e7
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 17:28:02 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 17:28:02 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=98503e61
15.0.0: drop upstreamed patch
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/78_all_PR115395.patch | 107 ------------------------------------
15.0.0/gentoo/README.history | 4 ++
2 files changed, 4 insertions(+), 107 deletions(-)
diff --git a/15.0.0/gentoo/78_all_PR115395.patch b/15.0.0/gentoo/78_all_PR115395.patch
deleted file mode 100644
index d98c043..0000000
--- a/15.0.0/gentoo/78_all_PR115395.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-https://gcc.gnu.org/PR115395
-
-From 4ed9c5df7efeb98e190573cca42a4fd40666c45f Mon Sep 17 00:00:00 2001
-From: Richard Biener <rguenther@suse.de>
-Date: Mon, 10 Jun 2024 10:12:52 +0200
-Subject: [PATCH] tree-optimization/115395 - wrong-code with SLP reduction in
- epilog
-
-When we continue a non-SLP reduction from the main loop in the
-epilog with a SLP reduction we currently fail to handle an
-adjustment by the initial value because that's not a thing with SLP.
-As long as we have the possibility to mix SLP and non-SLP we have
-to handle it though.
-
- PR tree-optimization/115395
- * tree-vect-loop.cc (vect_create_epilog_for_reduction):
- Handle STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT also for SLP
- reductions of group_size one.
-
- * gcc.dg/vect/pr115395.c: New testcase.
----
- gcc/testsuite/gcc.dg/vect/pr115395.c | 27 +++++++++++++++++++++++++++
- gcc/tree-vect-loop.cc | 27 ++++++++-------------------
- 2 files changed, 35 insertions(+), 19 deletions(-)
- create mode 100644 gcc/testsuite/gcc.dg/vect/pr115395.c
-
-diff --git a/gcc/testsuite/gcc.dg/vect/pr115395.c b/gcc/testsuite/gcc.dg/vect/pr115395.c
-new file mode 100644
-index 00000000000..cd1cee9f3df
---- /dev/null
-+++ b/gcc/testsuite/gcc.dg/vect/pr115395.c
-@@ -0,0 +1,27 @@
-+/* { dg-additional-options "-mavx2" { target avx2_runtime } } */
-+
-+#include "tree-vect.h"
-+
-+struct {
-+ long header_size;
-+ long start_offset;
-+ long end_offset;
-+} myrar_dbo[5] = {{0, 87, 6980}, {0, 7087, 13980}, {0, 14087, 0}};
-+
-+int i;
-+long offset;
-+
-+int main()
-+{
-+ check_vect ();
-+
-+ offset += myrar_dbo[0].start_offset;
-+ while (i < 2) {
-+ i++;
-+ offset += myrar_dbo[i].start_offset - myrar_dbo[i - 1].end_offset;
-+ }
-+ if (offset != 301)
-+ abort();
-+
-+ return 0;
-+}
-diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc
-index 028692614bb..c471f1564a7 100644
---- a/gcc/tree-vect-loop.cc
-+++ b/gcc/tree-vect-loop.cc
-@@ -6030,25 +6030,14 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
-
- tree induc_val = NULL_TREE;
- tree adjustment_def = NULL;
-- if (slp_node)
-- {
-- /* Optimize: for induction condition reduction, if we can't use zero
-- for induc_val, use initial_def. */
-- if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
-- induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
-- /* ??? Coverage for 'else' isn't clear. */
-- }
-+ /* Optimize: for induction condition reduction, if we can't use zero
-+ for induc_val, use initial_def. */
-+ if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
-+ induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
-+ else if (double_reduc)
-+ ;
- else
-- {
-- /* Optimize: for induction condition reduction, if we can't use zero
-- for induc_val, use initial_def. */
-- if (STMT_VINFO_REDUC_TYPE (reduc_info) == INTEGER_INDUC_COND_REDUCTION)
-- induc_val = STMT_VINFO_VEC_INDUC_COND_INITIAL_VAL (reduc_info);
-- else if (double_reduc)
-- ;
-- else
-- adjustment_def = STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info);
-- }
-+ adjustment_def = STMT_VINFO_REDUC_EPILOGUE_ADJUSTMENT (reduc_info);
-
- stmt_vec_info single_live_out_stmt[] = { stmt_info };
- array_slice<const stmt_vec_info> live_out_stmts = single_live_out_stmt;
-@@ -6873,7 +6862,7 @@ vect_create_epilog_for_reduction (loop_vec_info loop_vinfo,
-
- if (adjustment_def)
- {
-- gcc_assert (!slp_reduc);
-+ gcc_assert (!slp_reduc || group_size == 1);
- gimple_seq stmts = NULL;
- if (double_reduc)
- {
---
-2.43.0
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 1573b55..81ca552 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,7 @@
+4 ????
+
+ - 78_all_PR115395.patch
+
3 10 June 2024
+ 77_all_PR115387.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-10 2:08 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-10 2:08 UTC (permalink / raw
To: gentoo-commits
commit: 6fd8b4c1269795b281ede03ea1e9cd6ed3df1585
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 10 02:05:55 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 10 02:07:30 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=6fd8b4c1
15.0.0: cut patchset 2
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/README.history | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 32feb0a..b2b3de3 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,4 +1,4 @@
-2 ????
+2 10 June 2024
- 76_all_ppc_PR112868-no-checking-many.patch
+ 76_all_ppc_PR97367-power7-cell-altivec.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-08 17:03 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-08 17:03 UTC (permalink / raw
To: gentoo-commits
commit: 57f0631d613835def90f12c998feef13b5b7d629
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 8 17:02:35 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 8 17:02:35 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=57f0631d
15.0.0: drop 76_all_ppc_PR112868-no-checking-many.patch
Drop 76_all_ppc_PR112868-no-checking-many.patch because of
https://gcc.gnu.org/PR113652.
Bug: https://gcc.gnu.org/PR112868
Bug: https://gcc.gnu.org/PR113652
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../76_all_ppc_PR112868-no-checking-many.patch | 42 ----------------------
15.0.0/gentoo/README.history | 5 +++
2 files changed, 5 insertions(+), 42 deletions(-)
diff --git a/15.0.0/gentoo/76_all_ppc_PR112868-no-checking-many.patch b/15.0.0/gentoo/76_all_ppc_PR112868-no-checking-many.patch
deleted file mode 100644
index dc9f5e5..0000000
--- a/15.0.0/gentoo/76_all_ppc_PR112868-no-checking-many.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-https://gcc.gnu.org/PR112868 (specifically https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112868#c8)
-(see also https://gcc.gnu.org/PR113652)
-
---- a/gcc/config/rs6000/rs6000.h
-+++ b/gcc/config/rs6000/rs6000.h
-@@ -94,12 +94,6 @@
- "%{mdejagnu-*: %<mdejagnu-*}", \
- SUBTARGET_DRIVER_SELF_SPECS
-
--#if CHECKING_P
--#define ASM_OPT_ANY ""
--#else
--#define ASM_OPT_ANY " -many"
--#endif
--
- /* Common ASM definitions used by ASM_SPEC among the various targets for
- handling -mcpu=xxx switches. There is a parallel list in driver-rs6000.cc to
- provide the default assembler options if the user uses -mcpu=native, so if
-@@ -166,8 +160,7 @@
- mvsx: -mpower7; \
- mpowerpc64: -mppc64;: %(asm_default)}; \
- :%eMissing -mcpu option in ASM_CPU_SPEC?\n} \
--%{mvsx: -mvsx -maltivec; maltivec: -maltivec}" \
--ASM_OPT_ANY
-+%{mvsx: -mvsx -maltivec; maltivec: -maltivec}"
-
- #define CPP_DEFAULT_SPEC ""
-
---- a/gcc/testsuite/lib/target-supports.exp
-+++ b/gcc/testsuite/lib/target-supports.exp
-@@ -7285,7 +7285,7 @@ proc check_effective_target_powerpc_ppu_ok { } {
- #endif
- return 0;
- }
-- }]
-+ } "-mcpu=cell"]
- } else {
- return 0
- }
-
-
-
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 926ce25..15054c4 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,3 +1,8 @@
+2 ????
+
+ - 76_all_ppc_PR112868-no-checking-many.patch
+
+
1 28 Apr 2024
+ 01_all_default-fortify-source.patch
^ permalink raw reply related [flat|nested] 44+ messages in thread
* [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/
@ 2024-06-08 17:03 Sam James
0 siblings, 0 replies; 44+ messages in thread
From: Sam James @ 2024-06-08 17:03 UTC (permalink / raw
To: gentoo-commits
commit: ab342368b9d0d2ac7f249ca2240644940c51fa78
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 8 17:03:05 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 8 17:03:19 2024 +0000
URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=ab342368
15.0.0: add 76_all_ppc_PR97367-power7-cell-altivec.patch
Requested by ernsteiswuerfel.
Bug: https://gcc.gnu.org/PR97367
Signed-off-by: Sam James <sam <AT> gentoo.org>
15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch | 13 +++++++++++++
15.0.0/gentoo/README.history | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
new file mode 100644
index 0000000..154dd0f
--- /dev/null
+++ b/15.0.0/gentoo/76_all_ppc_PR97367-power7-cell-altivec.patch
@@ -0,0 +1,13 @@
+https://gcc.gnu.org/PR97367
+https://inbox.sourceware.org/gcc-patches/20240308.123342.1112119677226246836.rene@exactcode.de/
+--- a/gcc/config/rs6000/rs6000.cc
++++ b/gcc/config/rs6000/rs6000.cc
+@@ -5869,7 +5869,7 @@ rs6000_machine_from_flags (void)
+ HOST_WIDE_INT flags = rs6000_isa_flags;
+
+ /* Disable the flags that should never influence the .machine selection. */
+- flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ISEL);
++ flags &= ~(OPTION_MASK_PPC_GFXOPT | OPTION_MASK_PPC_GPOPT | OPTION_MASK_ALTIVEC | OPTION_MASK_ISEL);
+
+ if ((flags & (ISA_3_1_MASKS_SERVER & ~ISA_3_0_MASKS_SERVER)) != 0)
+ return "power10";
diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 15054c4..32feb0a 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -1,7 +1,7 @@
2 ????
- 76_all_ppc_PR112868-no-checking-many.patch
-
+ + 76_all_ppc_PR97367-power7-cell-altivec.patch
1 28 Apr 2024
^ permalink raw reply related [flat|nested] 44+ messages in thread
end of thread, other threads:[~2024-10-07 2:45 UTC | newest]
Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-07 2:45 [gentoo-commits] proj/gcc-patches:master commit in: 15.0.0/gentoo/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-10-04 10:37 Sam James
2024-10-04 9:28 Sam James
2024-10-02 19:45 Sam James
2024-09-30 14:05 Sam James
2024-09-29 22:56 Sam James
2024-09-24 1:41 Sam James
2024-09-23 15:23 Sam James
2024-09-02 2:28 Sam James
2024-08-26 13:44 Sam James
2024-08-26 6:24 Sam James
2024-08-23 13:51 Sam James
2024-08-20 20:31 Sam James
2024-08-19 18:43 Sam James
2024-08-14 9:48 Sam James
2024-08-14 2:57 Sam James
2024-08-11 22:40 Sam James
2024-08-09 19:54 Sam James
2024-08-09 19:54 Sam James
2024-08-09 19:47 Sam James
2024-08-09 19:25 Sam James
2024-08-08 11:10 Sam James
2024-08-08 11:06 Sam James
2024-08-08 11:03 Sam James
2024-08-05 9:09 Sam James
2024-08-05 1:54 Sam James
2024-08-05 1:51 Sam James
2024-08-02 20:39 Sam James
2024-08-01 14:40 Sam James
2024-07-28 23:34 Sam James
2024-07-22 1:11 Sam James
2024-07-19 11:14 Sam James
2024-07-18 0:45 Sam James
2024-07-14 23:36 Sam James
2024-06-28 12:49 Sam James
2024-06-27 0:02 Sam James
2024-06-26 23:57 Sam James
2024-06-16 22:45 Sam James
2024-06-10 20:18 Sam James
2024-06-10 17:28 Sam James
2024-06-10 17:28 Sam James
2024-06-10 2:08 Sam James
2024-06-08 17:03 Sam James
2024-06-08 17:03 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox