From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id DA5B53858C52 for ; Thu, 1 Sep 2022 16:08:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DA5B53858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 281G7wsO026534; Thu, 1 Sep 2022 11:07:59 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 281G7wSC026533; Thu, 1 Sep 2022 11:07:58 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 1 Sep 2022 11:07:58 -0500 From: Segher Boessenkool To: HAO CHEN GUI Cc: gcc-patches , David , "Kewen.Lin" , Peter Bergner Subject: Re: [PATCH v2, rs6000] Put dg-options before effective target checks Message-ID: <20220901160758.GF25951@gate.crashing.org> References: <20055172-6ec9-6055-c02a-9f91b26e0296@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20055172-6ec9-6055-c02a-9f91b26e0296@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Sep 01, 2022 at 01:30:18PM +0800, HAO CHEN GUI wrote: > --- a/gcc/testsuite/gcc.target/powerpc/pr92398.p9+.c > +++ b/gcc/testsuite/gcc.target/powerpc/pr92398.p9+.c > @@ -1,6 +1,10 @@ > -/* { dg-do compile { target { lp64 && has_arch_pwr9 } } } */ > +/* { dg-do compile } */ > +/* { dg-options "-O2 -mdejagnu-cpu=power9 -mvsx" } */ -mcpu=power9 already implies -mvsx. If you would keep -mvsx, that belongs *after* testing powerpc_vsx_ok. > +/* { dg-require-effective-target has_arch_ppc64 } */ > +/* { dg-require-effective-target int128 } */ > /* { dg-require-effective-target powerpc_vsx_ok } */ > -/* { dg-options "-O2 -mvsx" } */ > +/* The test case can be compiled on all platforms with compiling option > + -mdejagnu-cpu=power9. */ Please don't put in comments like this: that is what the code already *does*, after all :-) > --- a/gcc/testsuite/gcc.target/powerpc/pr92398.p9-.c > +++ b/gcc/testsuite/gcc.target/powerpc/pr92398.p9-.c > @@ -1,6 +1,8 @@ > -/* { dg-do compile { target { lp64 && {! has_arch_pwr9} } } } */ > -/* { dg-require-effective-target powerpc_vsx_ok } */ > /* { dg-options "-O2 -mvsx" } */ You cannot add -mvsx without first testing powerpc_vsx_ok (unless it is guaranteed some other way of course; here, it isn't). > +/* { dg-do compile { target { ! has_arch_pwr9 } } } */ Please keep dg-do first thing in the file. > --- a/gcc/testsuite/gcc.target/powerpc/pr93453-1.c > +++ b/gcc/testsuite/gcc.target/powerpc/pr93453-1.c > @@ -1,5 +1,6 @@ > -/* { dg-do compile { target has_arch_ppc64 } } */ > +/* { dg-do compile } */ > /* { dg-options "-mdejagnu-cpu=power6 -O2" } */ > +/* { dg-require-effective-target has_arch_ppc64 } */ This is fine, but it doesn't change anything, unless we have a bug. Segher