Re: [r16-5526 Regression] FAIL: gcc.dg/vect/bb-slp-41.c scan-tree-dump-not slp1 "vectorizing stmts using SLP" on Linux/x86_64

Kugan Vivekanandarajah <[email protected]>
Newsgroups gmane.comp.gcc.patches,gmane.comp.gcc.regression
Message-ID <[email protected]>
Hi,

I can reproduce this on x86_64. The issue is that bb-slp-41.c expects BB vevtorization to not happen. Look like the original test case had other checks too that has since gone.
I have added -fno-tree-loop-im and tested to keep the behaviour the same. Is this OK?

Thanks,
Kugan



> On 23 Nov 2025, at 7:20 pm, Haochen Jiang <[email protected]> wrote:
>
> External email: Use caution opening links or attachments
>
>
> On Linux/x86_64,
>
> ed1911b9f1f1ab0c1b631f0b6427b798c7056200 is the first bad commit
> commit ed1911b9f1f1ab0c1b631f0b6427b798c7056200
> Author: Kugan Vivekanandarajah <[email protected]>
> Date:   Sun Nov 23 15:27:10 2025 +1100
>
>    [tree-optimization] Allow LICM to hoist loads in "self write" patterns
>
> caused
>
> FAIL: gcc.dg/vect/bb-slp-41.c -flto -ffat-lto-objects  scan-tree-dump-not slp1 "vectorizing stmts using SLP"
> FAIL: gcc.dg/vect/bb-slp-41.c scan-tree-dump-not slp1 "vectorizing stmts using SLP"
>
> with GCC configured with
>
> ../../gcc/configure --prefix=/export/users3/haochenj/src/gcc-bisect/master/master/r16-5526/usr --enable-clocale=gnu --with-system-zlib --with-demangler-in-ld --with-fpmath=sse --enable-languages=c,c++,fortran --enable-cet --without-isl --enable-libmpx x86_64-linux --disable-bootstrap
>
> To reproduce:
>
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="vect.exp=gcc.dg/vect/bb-slp-41.c --target_board='unix{-m32}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="vect.exp=gcc.dg/vect/bb-slp-41.c --target_board='unix{-m32\ -march=cascadelake}'"
> $ cd {build_dir}/gcc && make check RUNTESTFLAGS="vect.exp=gcc.dg/vect/bb-slp-41.c --target_board='unix{-m64\ -march=cascadelake}'"
>
> (Please directly reply to this email for question about this report.)
> (If you met problems with cascadelake related, disabling AVX512F in command line might save that.)
> (However, please make sure that there is no potential problems with AVX512.)
0001-TESTSUITE-bb-slp-41.c-Adjust-to-prevent-LICM-to-keep.patch (application/octet-stream, 1.2 KB)
From 6a37cb2081eec60d4546e690bdf02ebe3baa483a Mon Sep 17 00:00:00 2001
From: Kugan Vivekanandarajah <[email protected]>
Date: Mon, 24 Nov 2025 11:08:44 +1100
Subject: [PATCH] [TESTSUITE][bb-slp-41.c] Adjust to prevent LICM to keep the
 expected behaviour

Now that we do move b[0] in LICM, this is
changing the expected behaviour in:
  for (i = 0; i < (ARR_SIZE - 2); ++i)
  {
    a[i] = b[0];
  }

Added -fno-tree-loop-im to preseve the exisitng behaviour.

gcc/testsuite/ChangeLog:

2025-11-24  Kugan Vivekanandarajah  <[email protected]>

	* gcc.dg/vect/bb-slp-41.c: Adjust to prevent loop invariant code
	motion to keep the expected behaviour.

Signed-off-by: Kugan Vivekanandarajah <[email protected]>
---
 gcc/testsuite/gcc.dg/vect/bb-slp-41.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-41.c b/gcc/testsuite/gcc.dg/vect/bb-slp-41.c
index 5a2bd4d2a33..d7937fa7148 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-41.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-41.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target vect_int } */
+/* { dg-additional-options "-fno-tree-loop-im" } */
 
 #define ARR_SIZE 1000
 
-- 
2.50.1 (Apple Git-155)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.