pr82625.C has

__attribute__ ((target ("default")))
unsigned bar() {
...
}

and

__attribute__ ((target ("avx")))

unsigned bar() {
...
}

GCC generates different assembly codes on AVX512 machines when GCC is
configured with

--with-arch=native --with-cpu=native

Compile pr82625.C with -march=x86-64 so that only AVX will be enabled by
target attribute.

PR testsuite/126923
* g++.target/i386/pr82625.C (dg-options): Add -march=x86-64.

-- 
H.J.
From 6bb68571f2354ecf2f193da0400e90c3427238d9 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <[email protected]>
Date: Tue, 18 Aug 2026 09:14:47 +0800
Subject: [PATCH] pr82625.C: Compile with -march=x86-64

pr82625.C has

__attribute__ ((target ("default")))
unsigned bar() {
...
}

and

__attribute__ ((target ("avx")))

unsigned bar() {
...
}

GCC generates different assembly codes on AVX512 machines when GCC is
configured with

--with-arch=native --with-cpu=native

Compile pr82625.C with -march=x86-64 so that only AVX will be enabled by
target attribute.

	PR testsuite/126923
	* g++.target/i386/pr82625.C (dg-options): Add -march=x86-64.

Signed-off-by: H.J. Lu <[email protected]>
---
 gcc/testsuite/g++.target/i386/pr82625.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/g++.target/i386/pr82625.C b/gcc/testsuite/g++.target/i386/pr82625.C
index 47bd2df1104..c63d41a233b 100644
--- a/gcc/testsuite/g++.target/i386/pr82625.C
+++ b/gcc/testsuite/g++.target/i386/pr82625.C
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-ifunc "" } */
-/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-options "-O2 -march=x86-64 -fdump-tree-optimized" } */
 
 __attribute__ ((target ("default")))
 static unsigned foo(const char *buf, unsigned size) {
-- 
2.55.0

Reply via email to