https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124481

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-03-13
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
It looks like sparc eventually ends up not vectorizing the loop but only
the stores on the unrolled body?

I can observe a similar result on x86_64 with adding -fno-tree-loop-vectorize.
DOM cannot handle CSE of

  MEM <vector(4) int> [(int *)&a] = { 0, 1, 2, 3 };
  _22 = a[0];

FRE can.  So iff we want to test DOM (which I assume), then I would
suggest to either XFAIL with a mightly complicated condition
(not loop vectorizing but BB vectorizing), or simply disable BB
vectorization by adding a -fno-tree-slp-vectorize, like

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c
b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c
index 8fda129c3eb..ea6100f9d60 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-cse-2.c
@@ -6,6 +6,8 @@
 /* Use generic tuning on x86 for the same reasons as why alpha, powerpc etc.
are
    xfailed below.
    { dg-additional-options "-mtune=generic" { target i?86-*-* x86_64-*-* } }
*/
+/* DOM cannot handle BB vectorizing the stores but not the reduction.
+   { dg-additional-options "-fno-tree-slp-vectorize" } */

 int
 foo ()


I'm not sure what changed from GCC 15 in this regard - maybe we did not
BB vectorize the unrolled unvectorized body?

Reply via email to