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 84A453858D1E for ; Fri, 2 Sep 2022 20:50:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 84A453858D1E 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 282KnHWD028368; Fri, 2 Sep 2022 15:49:18 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 282KnHM9028367; Fri, 2 Sep 2022 15:49:17 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 2 Sep 2022 15:49:17 -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: <20220902204917.GY25951@gate.crashing.org> References: <20055172-6ec9-6055-c02a-9f91b26e0296@linux.ibm.com> <20220901160758.GF25951@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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: Hi! On Fri, Sep 02, 2022 at 11:43:28AM +0800, HAO CHEN GUI wrote: > On 2/9/2022 上午 12:07, Segher Boessenkool wrote: > >> +/* { dg-do compile { target { ! has_arch_pwr9 } } } */ > > Please keep dg-do first thing in the file. > Could you inform me if it's a must to put dg-do in the first line? It is customary. If you do differently it will be a lot harder for people to truly understand your tests. > Here I hit a problem. "! has_arch_pwr9" can not be put into > dg-require-effective-target as it has a NOT. dg-require-effective-target has a selector, maybe you can do something with that? dg-require-effective-target { whatever { has_arch_pwr9 } } or something like that? > >> --- 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. > > This case suffer from "empty translation unit" problem and to be > unsupported on all platform. Put dg-options before the check avoid > the problem. Then please fix that problem first! It *will* come back to bite us, multiple times per week, until it is fixed. Segher