[PATCH] x86: Compile some check-function-bodies tests with -mtune=generic

"H.J. Lu" <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <CAMe9rOrWuzeZ5-rmP=VFrjruc4ZLxZnx+gRkgZW7T4zmbZ6oqA@mail.gmail.com>
Compile some check-function-bodies tests with -mtune=generic to avoid

FAIL: gcc.target/i386/memset-pr120683-10.c check-function-bodies foo
FAIL: gcc.target/i386/memset-pr120683-12.c check-function-bodies foo
FAIL: gcc.target/i386/pr122343-1b.c check-function-bodies foo
FAIL: gcc.target/i386/pr122343-5b.c check-function-bodies foo

due to the generated sequence

movq $0, 29(%rdi)
movq $0, 37(%rdi)
movq $0, 45(%rdi)
movq $0, 53(%rdi)
movq $0, (%rdi)
movq $0, 8(%rdi)
movq $0, 16(%rdi)
movq $0, 24(%rdi)

vs the expected sequence

movq $0, 48(%rdi)
movq $0, (%rdi)
movq $0, 8(%rdi)
movq $0, 16(%rdi)
movq $0, 24(%rdi)
movq $0, 32(%rdi)
movq $0, 40(%rdi)
movq $0, 53(%rdi)

when a different tuning is enabled by default.

PR testsuite/126923
* gcc.target/i386/memset-pr120683-10.c (dg-options): Add
-mtune=generic.
* gcc.target/i386/memset-pr120683-12.c (dg-options): Likewise.
* gcc.target/i386/pr122343-1b.c (dg-options): Likewise.
* gcc.target/i386/pr122343-1b.c (dg-options): Likewise.

-- 
H.J.
0001-x86-Compile-some-check-function-bodies-tests-with-mt.patch (text/x-patch, 4.3 KB)
From 47d10af3bc56ca4e9edf9db6dbbd37da33f9bb9d Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <[email protected]>
Date: Thu, 20 Aug 2026 07:44:54 +0800
Subject: [PATCH] x86: Compile some check-function-bodies tests with
 -mtune=generic

Compile some check-function-bodies tests with -mtune=generic to avoid

FAIL: gcc.target/i386/memset-pr120683-10.c check-function-bodies foo
FAIL: gcc.target/i386/memset-pr120683-12.c check-function-bodies foo
FAIL: gcc.target/i386/pr122343-1b.c check-function-bodies foo
FAIL: gcc.target/i386/pr122343-5b.c check-function-bodies foo

due to the generated sequence

	movq	$0, 29(%rdi)
	movq	$0, 37(%rdi)
	movq	$0, 45(%rdi)
	movq	$0, 53(%rdi)
	movq	$0, (%rdi)
	movq	$0, 8(%rdi)
	movq	$0, 16(%rdi)
	movq	$0, 24(%rdi)

vs the expected sequence

	movq	$0, 48(%rdi)
	movq	$0, (%rdi)
	movq	$0, 8(%rdi)
	movq	$0, 16(%rdi)
	movq	$0, 24(%rdi)
	movq	$0, 32(%rdi)
	movq	$0, 40(%rdi)
	movq	$0, 53(%rdi)

when a different tuning is enabled by default.

	PR testsuite/126923
	* gcc.target/i386/memset-pr120683-10.c (dg-options): Add
	-mtune=generic.
	* gcc.target/i386/memset-pr120683-12.c (dg-options): Likewise.
	* gcc.target/i386/pr122343-1b.c (dg-options): Likewise.
	* gcc.target/i386/pr122343-1b.c (dg-options): Likewise.

Signed-off-by: H.J. Lu <[email protected]>
---
 gcc/testsuite/gcc.target/i386/memset-pr120683-10.c | 2 +-
 gcc/testsuite/gcc.target/i386/memset-pr120683-12.c | 2 +-
 gcc/testsuite/gcc.target/i386/pr122343-1b.c        | 2 +-
 gcc/testsuite/gcc.target/i386/pr122343-5b.c        | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-10.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-10.c
index a450dbbe336..cf4313397e1 100644
--- a/gcc/testsuite/gcc.target/i386/memset-pr120683-10.c
+++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-10.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mno-sse -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */
+/* { dg-options "-O2 -mno-sse -mtune=generic -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */
 /* { dg-final { check-function-bodies "**" "*#" "" { target { lp64 && { ! *-*-darwin* } } } {^\t?\.} } } */
 /* { dg-final { check-function-bodies "*D" "*E" "" { target { lp64 && *-*-darwin* } } {^\t?\.} } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/memset-pr120683-12.c b/gcc/testsuite/gcc.target/i386/memset-pr120683-12.c
index 15987a6451f..daa1fe9232e 100644
--- a/gcc/testsuite/gcc.target/i386/memset-pr120683-12.c
+++ b/gcc/testsuite/gcc.target/i386/memset-pr120683-12.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -mno-sse -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */
+/* { dg-options "-O2 -mno-sse -mtune=generic -mmemset-strategy=unrolled_loop:256:noalign,libcall:-1:noalign" } */
 /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
 /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } */
 
diff --git a/gcc/testsuite/gcc.target/i386/pr122343-1b.c b/gcc/testsuite/gcc.target/i386/pr122343-1b.c
index a687ce7bf41..94801d08b89 100644
--- a/gcc/testsuite/gcc.target/i386/pr122343-1b.c
+++ b/gcc/testsuite/gcc.target/i386/pr122343-1b.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */
+/* { dg-options "-O2 -mtune=generic -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */
 /* { dg-additional-options "-mregparm=1" { target ia32 } } */
 /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
 /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr122343-5b.c b/gcc/testsuite/gcc.target/i386/pr122343-5b.c
index 16e8f05eaa3..8a1a5649f27 100644
--- a/gcc/testsuite/gcc.target/i386/pr122343-5b.c
+++ b/gcc/testsuite/gcc.target/i386/pr122343-5b.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */
+/* { dg-options "-O2 -mtune=generic -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" } */
 /* { dg-additional-options "-mregparm=1" { target ia32 } } */
 /* { dg-final { check-function-bodies "**" "*#" "" { target { ! *-*-darwin* } } {^\t?\.} } } */
 /* { dg-final { check-function-bodies "*D" "*E" "" { target { *-*-darwin* && lp64 } } {^\t?\.} } } */
-- 
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.