aboutsummaryrefslogtreecommitdiff
path: root/15.0.0
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-07-29 00:34:10 +0100
committerSam James <sam@gentoo.org>2024-07-29 00:34:10 +0100
commit4145ebad1e8382c5ec5ca26dadf21437aa37d172 (patch)
tree39f3a3315cea6a08bfa8061d2f910be95bb73291 /15.0.0
parent13.2.0: drop 93_all_ppc_PR97367-power7-cell-altivec.patch (diff)
downloadgcc-patches-4145ebad1e8382c5ec5ca26dadf21437aa37d172.tar.gz
gcc-patches-4145ebad1e8382c5ec5ca26dadf21437aa37d172.tar.bz2
gcc-patches-4145ebad1e8382c5ec5ca26dadf21437aa37d172.zip
15.0.0: add 79_all_PR116120-revert-match-pattern.patch
Bug: https://gcc.gnu.org/PR116120 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to '15.0.0')
-rw-r--r--15.0.0/gentoo/79_all_PR116120-revert-match-pattern.patch199
-rw-r--r--15.0.0/gentoo/README.history4
2 files changed, 203 insertions, 0 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
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