testsuite: Fix vector-subscript-4.c [PR116421]

Message ID 20250916142355.1117523-1-stefansf@linux.ibm.com
State Committed
Commit 08970b2cb27931cf7e28842948b8a96a777be2a3
Headers
Series testsuite: Fix vector-subscript-4.c [PR116421] |

Commit Message

Stefan Schulze Frielinghaus Sept. 16, 2025, 2:23 p.m. UTC
  From: Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org>

Verify we don't have any vector temporaries in the IL at least until
ISEL which may introduce VEC_EXTRACTs on targets which support
non-constant indices (see PR116421).

As a pass I chose NRV for no particular reason except that it is
literally the last pass prior ISEL.  At least at time of writing this.

gcc/testsuite/ChangeLog:

	* c-c++-common/vector-subscript-4.c: Check for vectors prior
	ISEL.
---
 Ok for mainline?

 gcc/testsuite/c-c++-common/vector-subscript-4.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
  

Comments

Stefan Schulze Frielinghaus Oct. 10, 2025, 1:04 p.m. UTC | #1
On Tue, Sep 16, 2025 at 04:23:55PM +0200, Stefan Schulze Frielinghaus wrote:
> From: Stefan Schulze Frielinghaus <stefansf@gcc.gnu.org>
> 
> Verify we don't have any vector temporaries in the IL at least until
> ISEL which may introduce VEC_EXTRACTs on targets which support
> non-constant indices (see PR116421).
> 
> As a pass I chose NRV for no particular reason except that it is
> literally the last pass prior ISEL.  At least at time of writing this.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* c-c++-common/vector-subscript-4.c: Check for vectors prior
> 	ISEL.
> ---
>  Ok for mainline?

Pushed as obvious in r16-4363-g08970b2cb27.
  

Patch

diff --git a/gcc/testsuite/c-c++-common/vector-subscript-4.c b/gcc/testsuite/c-c++-common/vector-subscript-4.c
index 2c2481f88b7..3138dc619d3 100644
--- a/gcc/testsuite/c-c++-common/vector-subscript-4.c
+++ b/gcc/testsuite/c-c++-common/vector-subscript-4.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized -w -Wno-psabi" } */
+/* { dg-options "-O2 -fdump-tree-nrv -w -Wno-psabi" } */
 
 #define foobar(n) \
     typedef int v##n##si __attribute__ ((vector_size (4 * n))); \
@@ -25,5 +25,7 @@  foobar(16)
 foobar(32)
 foobar(64)
 
-/* Verify we don't have any vector temporaries in the IL.  */
-/* { dg-final { scan-tree-dump-not "vector" "optimized" } } */
+/* Verify we don't have any vector temporaries in the IL at least until ISEL
+   which may introduce VEC_EXTRACTs on targets which support non-constant
+   indices (see PR116421).  */
+/* { dg-final { scan-tree-dump-not "vector" "nrv" } } */