From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id F23F0388B685 for ; Wed, 7 Dec 2022 07:10:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F23F0388B685 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,223,1665475200"; d="scan'208";a="89243387" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 06 Dec 2022 23:10:34 -0800 IronPort-SDR: 4HPDy5ERYcEHztdtjugAQCEmxaoTN11QZzUyI3XPzklpunnoOQPDTCV9qCXKh5aqNY2pZ9EfZ4 D65UpEAo8zrvZmbVf28eHHq07dBHl0r56Eche06z57mhu113MaZxtLnJc4qB+TB68e3QPnV9ia ydTRJiHbv0l67kPF1FPvuow4xFOe13QCTHkOA2p9YOo2MBOszOZ5ZVxWLnXNOtnmdg6u9wASAz Kep50mgjD8aumwmS94HhRVVx28m+k3OtXLIBj3GEHgIEqVPVumXqCCCyrzcGbqAfgtdeUhxN6g LMw= From: Thomas Schwinge To: Sebastian Huber CC: Jeff Law , , Iain Sandoe Subject: Re: [PATCH v2 1/2] Allow subtarget customization of CC1_SPEC In-Reply-To: References: <20221121072526.103446-1-sebastian.huber@embedded-brains.de> <87k034s0lz.fsf@dirichlet.schwinge.homeip.net> User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Wed, 7 Dec 2022 08:10:24 +0100 Message-ID: <87tu278za7.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham 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 2022-12-07T07:04:10+0100, Sebastian Huber wrote: > On 06.12.22 22:06, Thomas Schwinge wrote: > I suppose I just fail to see some detail here, but: > >> On 2022-11-21T08:25:25+0100, Sebastian Huber wrote: >>> gcc/ChangeLog: >>> >>> * gcc.cc (SUBTARGET_CC1_SPEC): Define if not defined. >>> (cc1_spec): Append SUBTARGET_CC1_SPEC. >>> --- >>> v2: Append SUBTARGET_CC1_SPEC directly to cc1_spec and not through CC1_= SPEC. >>> This avoids having to modify all the CC1_SPEC definitions in the t= argets. >>> >>> gcc/gcc.cc | 9 ++++++++- >>> 1 file changed, 8 insertions(+), 1 deletion(-) >>> >>> diff --git a/gcc/gcc.cc b/gcc/gcc.cc >>> index 830ab88701f..4e1574a4df1 100644 >>> --- a/gcc/gcc.cc >>> +++ b/gcc/gcc.cc >>> @@ -706,6 +706,13 @@ proper position among the other output files. */ >>> #define CPP_SPEC "" >>> #endif >>> >>> +/* Subtargets can define SUBTARGET_CC1_SPEC to provide extra args to c= c1 and >>> + cc1plus or extra switch-translations. The SUBTARGET_CC1_SPEC is ap= pended >>> + to CC1_SPEC. */ >>> +#ifndef SUBTARGET_CC1_SPEC >>> +#define SUBTARGET_CC1_SPEC "" >>> +#endif >>> + >>> /* config.h can define CC1_SPEC to provide extra args to cc1 and cc1p= lus >>> or extra switch-translations. */ >>> #ifndef CC1_SPEC >>> @@ -1174,7 +1181,7 @@ proper position among the other output files. */ >>> static const char *asm_debug =3D ASM_DEBUG_SPEC; >>> static const char *asm_debug_option =3D ASM_DEBUG_OPTION_SPEC; >>> static const char *cpp_spec =3D CPP_SPEC; >>> -static const char *cc1_spec =3D CC1_SPEC; >>> +static const char *cc1_spec =3D CC1_SPEC SUBTARGET_CC1_SPEC; >>> static const char *cc1plus_spec =3D CC1PLUS_SPEC; >>> static const char *link_gcc_c_sequence_spec =3D LINK_GCC_C_SEQUENCE_S= PEC; >>> static const char *link_ssp_spec =3D LINK_SSP_SPEC; >> >> ... doesn't this (at least potentially?) badly interact with any existin= g >> 'SUBTARGET_CC1_SPEC' definitions -- which pe rabove get appended to >> 'cc1_spec'? >> >> gcc/config/loongarch/gnu-user.h- and provides this hook instead. = */ >> gcc/config/loongarch/gnu-user.h:#undef SUBTARGET_CC1_SPEC >> gcc/config/loongarch/gnu-user.h:#define SUBTARGET_CC1_SPEC GNU_USER= _TARGET_CC1_SPEC >> gcc/config/loongarch/gnu-user.h- >> -- >> gcc/config/loongarch/loongarch.h-#define EXTRA_SPECS \ >> gcc/config/loongarch/loongarch.h: {"subtarget_cc1_spec", SUBTARGET= _CC1_SPEC}, \ >> gcc/config/loongarch/loongarch.h- {"subtarget_cpp_spec", SUBTARGET= _CPP_SPEC}, \ >> -- >> gcc/config/mips/gnu-user.h- and provides this hook instead. */ >> gcc/config/mips/gnu-user.h:#undef SUBTARGET_CC1_SPEC >> gcc/config/mips/gnu-user.h:#define SUBTARGET_CC1_SPEC GNU_USER_TARG= ET_CC1_SPEC >> gcc/config/mips/gnu-user.h- >> -- >> gcc/config/mips/linux-common.h- >> gcc/config/mips/linux-common.h:#undef SUBTARGET_CC1_SPEC >> gcc/config/mips/linux-common.h:#define SUBTARGET_CC1_SPEC = \ >> gcc/config/mips/linux-common.h- LINUX_OR_ANDROID_CC (GNU_USER_TARG= ET_CC1_SPEC, \ >> -- >> gcc/config/mips/mips.h- >> gcc/config/mips/mips.h:/* SUBTARGET_CC1_SPEC is passed to the compi= ler proper. It may be >> gcc/config/mips/mips.h- overridden by subtargets. */ >> gcc/config/mips/mips.h:#ifndef SUBTARGET_CC1_SPEC >> gcc/config/mips/mips.h:#define SUBTARGET_CC1_SPEC "" >> gcc/config/mips/mips.h-#endif >> -- >> gcc/config/mips/mips.h-#define EXTRA_SPECS = \ >> gcc/config/mips/mips.h: { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC= }, \ >> gcc/config/mips/mips.h- { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC= }, \ >> -- >> gcc/config/mips/r3900.h-/* By default (if not mips-something-else) = produce code for the r3900 */ >> gcc/config/mips/r3900.h:#undef SUBTARGET_CC1_SPEC >> gcc/config/mips/r3900.h:#define SUBTARGET_CC1_SPEC "\ >> gcc/config/mips/r3900.h-%{mhard-float:%e-mhard-float not supported}= \ > > Oh, I came up with the name SUBTARGET_CC1_SPEC after a discussion on the > mailing list I've put Iain in CC. > and I have to admit that I didn't check that it was > actually already in use. Always one of the first things I do. ;-) > What about renaming the loongarch/mips define > to LOONGARCH_CC1_SPEC and MIPS_CC1_SPEC? Also in use are a number of other 'SUBTARGET_[...]_SPEC' and corresponding 'subtarget_[...]_spec' in 'EXTRA_SPECS', for example: gcc/config/mips/mips.h-#define EXTRA_SPECS = \ gcc/config/mips/mips.h: { "subtarget_cc1_spec", SUBTARGET_CC1_SPEC }, = \ gcc/config/mips/mips.h: { "subtarget_cpp_spec", SUBTARGET_CPP_SPEC }, = \ gcc/config/mips/mips.h: { "subtarget_asm_debugging_spec", SUBTARGET_AS= M_DEBUGGING_SPEC }, \ gcc/config/mips/mips.h: { "subtarget_asm_spec", SUBTARGET_ASM_SPEC }, = \ gcc/config/mips/mips.h- { "asm_abi_default_spec", "-" MULTILIB_ABI_DEF= AULT }, \ gcc/config/mips/mips.h- { "endian_spec", ENDIAN_SPEC }, = \ gcc/config/mips/mips.h: SUBTARGET_EXTRA_SPECS Do we need/want to keep the association of same-name upper-case/lower-case variants; in your proposal you'd then get '{ "subtarget_cc1_spec", MIPS_CC1_SPEC }', for example? (I didn't quickly grok all 'EXTRA_SPECS' usage.) Alternatively, what about renaming your 'SUBTARGET_CC1_SPEC' to 'CC1_SPEC_EXTRA' -- if that makes sense? static const char *cc1_spec =3D CC1_SPEC CC1_SPEC_EXTRA; But doesn't somehow this whole thing feel a bit like "chating the system"? ;-) Can't you actually achieve your thing (TLS model) via (new) 'EXTRA_SPECS' in 'gcc/config/rtems.h', for example? Gr=C3=BC=C3=9Fe Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955