From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E2B3F3857C72 for ; Fri, 21 Jan 2022 00:08:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E2B3F3857C72 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-338-EltpR8FCNdeqLKkoE6jL4A-1; Thu, 20 Jan 2022 19:08:46 -0500 X-MC-Unique: EltpR8FCNdeqLKkoE6jL4A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FB502F4B; Fri, 21 Jan 2022 00:08:44 +0000 (UTC) Received: from t14s.localdomain.com (unknown [10.2.16.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id EDA71108CE; Fri, 21 Jan 2022 00:08:36 +0000 (UTC) From: David Malcolm To: FX , Hans-Peter Nilsson Cc: GCC Mailing List , Iain Sandoe , David Malcolm Subject: [PATCH] testsuite: avoid analyzer asm failures on non-Linux Date: Thu, 20 Jan 2022 19:08:35 -0500 Message-Id: <20220121000835.2354878-1-dmalcolm@redhat.com> In-Reply-To: <37DCD537-51A8-4376-B244-61432E10748D@gmail.com> References: <37DCD537-51A8-4376-B244-61432E10748D@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Jan 2022 00:08:51 -0000 On Sun, 2022-01-16 at 12:11 +0100, FX wrote: > > No, that's "dg-do compile" (as in "compile but don't assemble"). > > I can confirm that this patch: > > diff --git a/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c > b/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c > index c235e22fd01..4730255bb3c 100644 > --- a/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c > +++ b/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c > @@ -1,4 +1,4 @@ > -/* { dg-do assemble { target x86_64-*-* } } */ > +/* { dg-do compile { target x86_64-*-* } } */ > /* { dg-require-effective-target lp64 } */ > > #include "analyzer-decls.h” > > > fixes the gcc.dg/analyzer/asm-x86-lp64-1.c failure on > x86_64-apple-darwin. The same is true of this one: > > diff --git > a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c > b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c > index e90dccf58dd..4cbf43206dc 100644 > --- > a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c > +++ > b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c > @@ -1,4 +1,4 @@ > -/* { dg-do assemble { target x86_64-*-* } } */ > +/* { dg-do compile { target x86_64-*-* } } */ > /* { dg-require-effective-target lp64 } */ > /* { dg-additional-options "-fsanitize=bounds > -fno-analyzer-call-summaries" } */ > /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ > > > > These other three: > FAIL: gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c > FAIL: gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c > FAIL: gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c > > still fail with dg-do compile, as explained, become the error comes > from the C front-end, not the assembler: > > /Users/fx/gcc/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c:27:3: > warning: 'asm' operand 6 probably does not match constraints > /Users/fx/gcc/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c:27:3: > error: impossible constraint in 'asm' Thanks. I extended your patch as follows, which works successfully for me on x86_64-pc-linux-gnu. Does the following look OK for the analyzer asm failures on x86_64-apple-darwin? Dave gcc/testsuite/ChangeLog: * gcc.dg/analyzer/asm-x86-1.c: Use dg-do "compile" rather than "assemble". * gcc.dg/analyzer/asm-x86-lp64-1.c: Likewise. * gcc.dg/analyzer/asm-x86-lp64-2.c: Likewise. * gcc.dg/analyzer/torture/asm-x86-linux-array_index_mask_nospec.c: Likewise. * gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c: Likewise, and restrict to x86_64-pc-linux-gnu. * gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c: Likewise. * gcc.dg/analyzer/torture/asm-x86-linux-cpuid.c: Use dg-do "compile" rather than "assemble". * gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c: Likewise, and restrict to x86_64-pc-linux-gnu. * gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c: Use dg-do "compile" rather than "assemble". * gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c: Likewise. * gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-reduced.c: Likewise. Signed-off-by: David Malcolm --- gcc/testsuite/gcc.dg/analyzer/asm-x86-1.c | 2 +- gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c | 2 +- gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-2.c | 2 +- .../analyzer/torture/asm-x86-linux-array_index_mask_nospec.c | 2 +- .../gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c | 2 +- .../gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c | 2 +- gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid.c | 2 +- .../gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c | 2 +- gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c | 2 +- .../analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c | 2 +- .../analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-reduced.c | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gcc/testsuite/gcc.dg/analyzer/asm-x86-1.c b/gcc/testsuite/gcc.dg/analyzer/asm-x86-1.c index f6026b7e288..a3f86e440b5 100644 --- a/gcc/testsuite/gcc.dg/analyzer/asm-x86-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/asm-x86-1.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-*-* } } */ #include "analyzer-decls.h" diff --git a/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c b/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c index c235e22fd01..4730255bb3c 100644 --- a/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-1.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-*-* } } */ /* { dg-require-effective-target lp64 } */ #include "analyzer-decls.h" diff --git a/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-2.c b/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-2.c index fa507395ec7..2864ab69d2a 100644 --- a/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-2.c +++ b/gcc/testsuite/gcc.dg/analyzer/asm-x86-lp64-2.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-*-* } } */ /* { dg-require-effective-target lp64 } */ /* Adapted from Linux x86: page_ref_dec_and_test.c (GPL-2.0). */ diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-array_index_mask_nospec.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-array_index_mask_nospec.c index 6201fdb498f..b2d615c22b9 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-array_index_mask_nospec.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-array_index_mask_nospec.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-*-* } } */ /* { dg-require-effective-target lp64 } */ /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c index cf5cf97367d..9861c2d15ca 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-pc-linux-gnu } } */ /* { dg-require-effective-target lp64 } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c index c4b365f1e6e..09fef5ddfcc 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-pc-linux-gnu } } */ /* { dg-require-effective-target lp64 } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid.c index 243931aebc8..518fe8c286c 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-*-* } } */ /* { dg-require-effective-target lp64 } */ #include "../analyzer-decls.h" diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c index d9947871235..ed807ab8fc8 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c @@ -1,6 +1,6 @@ /* Adapted from Linux: arch/x86/include/asm/paravirt.h */ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-pc-linux-gnu } } */ /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c index 69d0165aefe..3735d33444e 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-rdmsr.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-*-* } } */ /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */ #include "../analyzer-decls.h" diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c index e90dccf58dd..4cbf43206dc 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-*-* } } */ /* { dg-require-effective-target lp64 } */ /* { dg-additional-options "-fsanitize=bounds -fno-analyzer-call-summaries" } */ /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */ diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-reduced.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-reduced.c index a18c58c5e61..e046d8c03b1 100644 --- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-reduced.c +++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-reduced.c @@ -1,4 +1,4 @@ -/* { dg-do assemble { target x86_64-*-* } } */ +/* { dg-do compile { target x86_64-*-* } } */ /* { dg-require-effective-target lp64 } */ /* Reproducer for false positive from -Wanalyzer-null-dereference seen -- 2.26.3