From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 38192 invoked by alias); 25 Jul 2019 07:50:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 38184 invoked by uid 89); 25 Jul 2019 07:50:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Received:Thu, designation X-HELO: mail-wr1-f68.google.com Received: from mail-wr1-f68.google.com (HELO mail-wr1-f68.google.com) (209.85.221.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Jul 2019 07:50:49 +0000 Received: by mail-wr1-f68.google.com with SMTP id x4so49583345wrt.6 for ; Thu, 25 Jul 2019 00:50:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=eiUF1zXimlgXa+AjaOeVl5jwlNJpNNYdVd6Lfb4Z+lU=; b=XzMdZouT0e19lVUTqvWd5xM+Ydmu+rnN+MJbf8AZweqvgXe2zzrBWYZ1mlrqaG6ed4 zVhbP50fxqwhpJQnau2Hp2Tq6hW25U1QD1xz7cI5M5nDLFettZoL4qYwo9D4OWR3jW2g nwc88EHwDXDa9SG6QI5IMzvJFKYWkcsIaWGPte9ubGWIxhJilruCdpEKpbe42gq815H7 WdieDoWyc4Ma/QbZjYS5ehdOLQZjaki139nZW713sK53LJgSVdMI236lt3njdfWmJRBU WVl6hzYZ8PLg9DRMlqZh9+SzO9v0WbHlaCT0umdPnHUOTIlZj66R+TkZqC+96YTFkx2b YjhA== Return-Path: Received: from euterpe-sie.home (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id p6sm52246052wrq.97.2019.07.25.00.50.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jul 2019 00:50:46 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH, rs6000] Fix PR91050 by adding a DRIVER_SELF_SPECS spec From: Iain Sandoe In-Reply-To: Date: Thu, 25 Jul 2019 07:59:00 -0000 Cc: GCC Patches , Segher Boessenkool Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Peter Bergner X-SW-Source: 2019-07/txt/msg01624.txt.bz2 Hi Peter, > On 25 Jul 2019, at 04:30, Peter Bergner wrote: >=20 > The -mdejagnu-cpu=3D option was added as a way for a test case to ensure a > particular -mcpu=3D option is used to compile the test, regardless of whe= ther > the user attempts to override it (purposely or accidentally) via RUNTESTF= LAGS. > This was well and good, but the ASM_CPU_SPEC was not updated to handle > -mdejagnu-cpu=3D, so the option passed to the assembler is only determined > by -mcpu=3D, even if that is overridden by -mdejagnu-cpu=3D. This can ca= use > cases of using the wrong assembler option. >=20 > We could just add -mdejagnu-cpu=3D support to ASM_CPU_SPEC, but that spec= entry > is already WAY too huge and ugly and to add support for -mdejagnu-cpu=3D,= we'd > have to essentially double the size of that spec. The patch below takes > a different approach and removes Segher's original patch altogether and > instead implements -mdejagnu-cpu=3D using a DRIVER_SELF_SPECS spec which > simplifies things by not even needing to touch ASM_CPU_SPEC. I also added > support for -mdejagnu-tune=3D, even though we don't have any test cases > at the moment that use it, since it was easy to add. This will break Darwin which has used DRIVER_SELF_SPECS in config/darwin.h since they were introduced (and the equivalent before). This is because Darwin has driver self-specs common to the PPC and X86 port= s. If this change is seen the way to go, then I guess one solution would be to= rename the driver specs in config/darwin.h =3D> SUBTARGET_DRIVER_SELF_SPECS*** and then put a dummy DRIVER_SELF_SPECS in i386/i386.h=20 and append SUBTARGET_DRIVER_SELF_SPECS to both the i386.h and rs6000.h=20 cases. (or something along those lines) > Segher, I tried your suggestion of writing the spec more generically > (ie, %{mdejagnu-*: ... -m*}), which worked in that it did the correct > replacement. However, the % option(s) would need to be written like % at all. not sure what the objective is here - if you want to remove all pre-existin= g -mcpu from the command line won=E2=80=99t % This passed bootstrap and regtesting with no errors on powerpc64le-linux. > Ok for trunk? >=20 > Peter >=20 > gcc/ > PR target/91050 > * config/rs6000/rs6000.opt (mdejagnu-cpu=3D): Delete option. > * config/rs6000/rs6000.c (rs6000_option_override_internal): Remove > use of deleted rs6000_dejagnu_cpu_index variable. > * config/rs6000/rs6000.h (DRIVER_SELF_SPECS): Define. >=20 > Index: gcc/config/rs6000/rs6000.opt > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/config/rs6000/rs6000.opt (revision 273707) > +++ gcc/config/rs6000/rs6000.opt (working copy) > @@ -388,13 +388,6 @@ mtune=3D > Target RejectNegative Joined Var(rs6000_tune_index) Init(-1) Enum(rs6000_= cpu_opt_value) Save > -mtune=3D Schedule code for given CPU. >=20 > -; Only for use in the testsuite. This simply overrides -mcpu=3D. With = older > -; versions of Dejagnu the command line arguments you set in RUNTESTFLAGS > -; override those set in the testcases; with this option, the testcase wi= ll > -; always win. > -mdejagnu-cpu=3D > -Target Undocumented RejectNegative Joined Var(rs6000_dejagnu_cpu_index) = Init(-1) Enum(rs6000_cpu_opt_value) Save > - > mtraceback=3D > Target RejectNegative Joined Enum(rs6000_traceback_type) Var(rs6000_trace= back) > -mtraceback=3D[full,part,no] Select type of traceback table. > Index: gcc/config/rs6000/rs6000.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/config/rs6000/rs6000.c (revision 273707) > +++ gcc/config/rs6000/rs6000.c (working copy) > @@ -3489,9 +3489,6 @@ rs6000_option_override_internal (bool gl > /* Don't override by the processor default if given explicitly. */ > set_masks &=3D ~rs6000_isa_flags_explicit; >=20 > - if (global_init_p && rs6000_dejagnu_cpu_index >=3D 0) > - rs6000_cpu_index =3D rs6000_dejagnu_cpu_index; > - > /* Process the -mcpu=3D and -mtune=3D argument. If the user = changed > the cpu in a target attribute or pragma, but did not specify a tuning > option, use the cpu for the tuning option rather than the option spe= cified > Index: gcc/config/rs6000/rs6000.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- gcc/config/rs6000/rs6000.h (revision 273707) > +++ gcc/config/rs6000/rs6000.h (working copy) > @@ -77,6 +77,15 @@ > #define PPC405_ERRATUM77 0 > #endif >=20 > +/* Only for use in the testsuite: -mdejagnu-cpu=3D simply overrides -mcp= u=3D. > + With older versions of Dejagnu the command line arguments you set in > + RUNTESTFLAGS override those set in the testcases; with this option, > + the testcase will always win. Ditto for -mdejagnu-tune=3D. */ > +#define DRIVER_SELF_SPECS \ > + "%{mdejagnu-cpu=3D*: % + %{mdejagnu-tune=3D*: % + %{mdejagnu-*: % + > #if CHECKING_P > #define ASM_OPT_ANY "" > #else