On 9/24/24 14:08, haochen.jiang wrote:
On Linux/x86_64,

96246bff0bcd9e5cdec9e6cf811ee3db4997f6d4 is the first bad commit
commit 96246bff0bcd9e5cdec9e6cf811ee3db4997f6d4
Author: Sandra Loosemore <sloosem...@baylibre.com>
Date:   Fri Sep 6 20:58:13 2024 +0000

     OpenMP: Check additional restrictions on context selector properties

caused

FAIL: c-c++-common/gomp/declare-variant-duplicates.c  (test for errors, line 11)
FAIL: c-c++-common/gomp/declare-variant-duplicates.c (test for excess errors)

with GCC configured with

../../gcc/configure 
--prefix=/export/users/haochenj/src/gcc-bisect/master/master/r15-3834/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="gomp.exp=c-c++-common/gomp/declare-variant-duplicates.c 
--target_board='unix{-m32}'"
$ cd {build_dir}/gcc && make check 
RUNTESTFLAGS="gomp.exp=c-c++-common/gomp/declare-variant-duplicates.c 
--target_board='unix{-m32\ -march=cascadelake}'"

It turns out the problem here is that with -m32, "i386" is defined as a built-in preprocessor macro :-O so it cannot be used as an identifier. I've pushed the attached patch to adjust the testcase not to do that.

-Sandra

From 6935bddd8f90dde6009a1b8dea9745788ceeefb1 Mon Sep 17 00:00:00 2001
From: Sandra Loosemore <sloosem...@baylibre.com>
Date: Wed, 25 Sep 2024 02:59:53 +0000
Subject: [PATCH] OpenMP: Fix testsuite failure on x86 with -m32

The testcase decare-variant-duplicates.c added in commit
96246bff0bcd9e5cdec9e6cf811ee3db4997f6d4 failed on 32-bit x86
because on that target "i386" is defined as a preprocessor macro
and cannot be used as an identifier.  Fixed by rewriting that test
not to do that.

gcc/testsuite/ChangeLog
	* c-c++-common/gomp/declare-variant-duplicates.c: Avoid using
	"i386" as an identifier.
---
 gcc/testsuite/c-c++-common/gomp/declare-variant-duplicates.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/c-c++-common/gomp/declare-variant-duplicates.c b/gcc/testsuite/c-c++-common/gomp/declare-variant-duplicates.c
index 47d34fc52e2..9f319c72449 100644
--- a/gcc/testsuite/c-c++-common/gomp/declare-variant-duplicates.c
+++ b/gcc/testsuite/c-c++-common/gomp/declare-variant-duplicates.c
@@ -8,6 +8,6 @@ extern int f4 (int);
 
 #pragma omp declare variant (f1) match (device={kind(cpu,gpu,"cpu")})  /* { dg-error "trait-property .cpu. specified more than once" } */
 #pragma omp declare variant (f2) match (device={isa(sse4,"avx",avx)})  /* { dg-error "trait-property .avx. specified more than once" } */
-#pragma omp declare variant (f3) match (device={arch(x86_64,i386,aarch64,"i386")})  /* { dg-error "trait-property .i386. specified more than once" } */
+#pragma omp declare variant (f3) match (device={arch(x86_64,"i386",aarch64,"x86_64")})  /* { dg-error "trait-property .x86_64. specified more than once" } */
 #pragma omp declare variant (f4) match (implementation={vendor(llvm,gnu,"arm",gnu)})  /* { dg-error "trait-property .gnu. specified more than once" } */
 int f (int);
-- 
2.25.1

Reply via email to