Thankfully this "bug" is just a case where after Robin's change we're
vectorizing cases we weren't before which in turn doesn't give predcom
the opportunity to optimize the code.
Like on existing predcom test we can restore the test's intent by using
-fno-tree-vectorize.
Tested x86_64 and the various crosses to ensure nothing regressed.
Pushing to the trunk.
jeff
commit 8cd878a2f0a56059cac99c260771c283091d0601
Author: Jeff Law <[email protected]>
Date: Tue Jan 6 16:16:56 2026 -0700
[PR target/123269] Adjust predcomm testcases to avoid vectorization
Thankfully this "bug" is just a case where after Robin's change we're
vectorizing cases we weren't before which in turn doesn't give predcom the
opportunity to optimize the code.
Like on existing predcom test we can restore the test's intent by using
-fno-tree-vectorize.
Tested x86_64 and the various crosses to ensure nothing regressed. Pushing
to
the trunk.
PR target/123269
gcc/testsuite
* gcc.dg/tree-ssa/predcom-dse-4.c: Disable vectorization.
* gcc.dg/tree-ssa/predcom-dse-7.c: Likewise.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-4.c
b/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-4.c
index 0d64bc72f82..5fdd39c3f79 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-4.c
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-options "-O2 -fno-inline -fno-tree-loop-distribute-patterns
-fpredictive-commoning -fdump-tree-pcom-details-blocks" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fno-inline
-fno-tree-loop-distribute-patterns -fpredictive-commoning
-fdump-tree-pcom-details-blocks" } */
int arr[105] = {2, 3, 5, 7, 11};
int result0[10] = {2, 3, 5, 7, 11};
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-7.c
b/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-7.c
index cfe44a06ce4..24c06d59d18 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/predcom-dse-7.c
@@ -1,5 +1,5 @@
/* { dg-do run } */
-/* { dg-options "-O2 -fno-inline -fpredictive-commoning
-fdump-tree-pcom-details-blocks" } */
+/* { dg-options "-O2 -fno-tree-vectorize -fno-inline -fpredictive-commoning
-fdump-tree-pcom-details-blocks" } */
int arr[105] = {2, 3, 5, 7, 11, 13, 17, 19};
int result0[10] = {2, 3, 5, 7, 11, 13, 17, 19};