[PATCH] pr82625.C: Compile with -march=x86-64

"H.J. Lu" <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <CAMe9rOqNqXSXfot_2wuVhODmE-+akMEPgmq0_3xkWrqU+V7Yvw@mail.gmail.com>
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.
0001-pr82625.C-Compile-with-march-x86-64.patch (text/x-patch, 1.3 KB)
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
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.