From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105976 invoked by alias); 25 Jul 2019 14:52:00 -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 105965 invoked by uid 89); 25 Jul 2019 14:52:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.9 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= 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 14:51:58 +0000 Received: by mail-wr1-f68.google.com with SMTP id g17so51129269wrr.5 for ; Thu, 25 Jul 2019 07:51:57 -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=4gKrKsdKsuFfmEmsWfzxzFsqnSzioF+J7irtxT5C3hA=; b=KSDTRh1zyHMtP9Zo7kjB9VS9h3kdkT66EB1sANicMaTa8C/vKl7jWEUgBC6EbYkxrA KFw1tvcNhBHbHUN8L2gdQ5utcYOpIAvCHQQAT7jnWALoEMAfi1GuKD5mjiAgu2c3IBWA Bcv72MfugmGHqO8qZj6oti/fADK52SHbb1dbEQCwMbCprJq33epQ0byFj6PVWAj/HSHe jbKDxlde5eSbagxDB0Xjw7UJzwo5Ho5TSs3ZKcQ8YxzPabRSa9DUOPJF9KglWl8C34Fm n9wjuvycCFinseLLijIPJXT41QnatHyyz+m3o/HPcAwD2Iy2uWuFW17geuxegeqa16zx psnQ== 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 o7sm22882431wru.58.2019.07.25.07.51.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jul 2019 07:51:55 -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: <39ef9829-c6c2-0ed5-cfaa-3c999af898bb@linux.ibm.com> Date: Thu, 25 Jul 2019 14:52:00 -0000 Cc: GCC Patches , Segher Boessenkool Content-Transfer-Encoding: quoted-printable Message-Id: References: <39ef9829-c6c2-0ed5-cfaa-3c999af898bb@linux.ibm.com> To: Peter Bergner X-SW-Source: 2019-07/txt/msg01643.txt.bz2 Hi Peter, > On 25 Jul 2019, at 15:41, Peter Bergner wrote: >=20 > On 7/25/19 2:50 AM, Iain Sandoe wrote: >> This will break Darwin which has used DRIVER_SELF_SPECS in config/darwin= .h >> since they were introduced (and the equivalent before). >>=20 >> This is because Darwin has driver self-specs common to the PPC and X86 p= orts. >>=20 >> 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) > The patch below uses your suggestion. Does this work for you on x86 and = ppc? It=E2=80=99s in the queue for testing tonight - my ppc h/w is somewhat slow= ,=20 thanks for handling this, Iain >=20 >>> 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. >>=20 >> not sure what the objective is here - if you want to remove all pre-exis= ting -mcpu from >> the command line won=E2=80=99t %> if it gets invented) .. >=20 > We only want to remove all pre-existing -mcpu=3D options IF the user also= used > -mdejagnu-cpu=3D. You do not want to remove -mcpu=3D options if the user= used > -mdejagnu-tune=3D. That's why I tried: >=20 > %{mdejagnu-*: %=20 > so -mdejagnu-cpu=3D would only remove -mcpu options and -mdejagnu-tune=3D= would > only remove -mtune=3D options. The problem is that it doesn't look like = you > can you use %* with %<. >=20 > Peter >=20 >=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. > (SUBTARGET_DRIVER_SELF_SPECS): Likewise. > * config/darwin.h (DRIVER_SELF_SPECS): Rename from this ... > (SUBTARGET_DRIVER_SELF_SPECS): ...to this. > * config/i386/i386.h (DRIVER_SELF_SPECS): Define. > (SUBTARGET_DRIVER_SELF_SPECS): Likewise. >=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,20 @@ > #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-*: % + SUBTARGET_DRIVER_SELF_SPECS > + > +#ifndef SUBTARGET_DRIVER_SELF_SPECS > +# define SUBTARGET_DRIVER_SELF_SPECS > +#endif > + > #if CHECKING_P > #define ASM_OPT_ANY "" > #else > Index: gcc/config/darwin.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/darwin.h (revision 273707) > +++ gcc/config/darwin.h (working copy) > @@ -125,7 +125,7 @@ extern GTY(()) int darwin_ms_struct; >=20 > However, a few can be handled and we can elide options that are silent= ly- > ignored defaults, plus warn on obsolete ones that no longer function. = */ > -#define DRIVER_SELF_SPECS \ > +#define SUBTARGET_DRIVER_SELF_SPECS \ > "%{fapple-kext|mkernel:-static}", \ > "%{gfull:-g -fno-eliminate-unused-debug-symbols} % "%{gsplit-dwarf:%ngsplit-dwarf is not supported on this platform} \ > Index: gcc/config/i386/i386.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/i386/i386.h (revision 273707) > +++ gcc/config/i386/i386.h (working copy) > @@ -677,6 +677,12 @@ extern tree x86_mfence; > with the rounding mode forced to 53 bits. */ > #define TARGET_96_ROUND_53_LONG_DOUBLE 0 >=20 > +#define DRIVER_SELF_SPECS SUBTARGET_DRIVER_SELF_SPECS > + > +#ifndef SUBTARGET_DRIVER_SELF_SPECS > +# define SUBTARGET_DRIVER_SELF_SPECS > +#endif > + > /* -march=3Dnative handling only makes sense with compiler running on > an x86 or x86_64 chip. If changing this condition, also change > the condition in driver-i386.c. */ >=20