From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp002.apm-internet.net (smtp002.apm-internet.net [85.119.248.221]) by sourceware.org (Postfix) with ESMTPS id 6DFD53858413 for ; Thu, 16 Sep 2021 13:52:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6DFD53858413 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 61337 invoked from network); 16 Sep 2021 13:52:22 -0000 X-APM-Out-ID: 16318003426133 X-APM-Authkey: 257869/1(257869/1) 12 Received: from unknown (HELO ?192.168.1.214?) (81.138.1.83) by smtp002.apm-internet.net with SMTP; 16 Sep 2021 13:52:22 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [PATCH 1/N] Rename asm_out_file function arguments. From: Iain Sandoe In-Reply-To: Date: Thu, 16 Sep 2021 14:52:21 +0100 Cc: GCC Patches Content-Transfer-Encoding: quoted-printable Message-Id: References: <8aa1fb10-334d-aa62-13e4-2ebc24d4ea16@suse.cz> To: Martin Liska X-Mailer: Apple Mail (2.3445.104.21) X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 13:52:24 -0000 Hi Martin, > On 16 Sep 2021, at 11:00, Martin Li=C5=A1ka wrote: >=20 > As preparation for a new global object that will encapsulate > asm_out_file, we would need to live with a macro that will > define asm_out_file as casm->out_file and thus the name > can't be used in function arguments. So, if I understand correctly, the motivation is to be able to switch between output file streams for different categories of content? Darwin, actually already does this (manually) with a separate lto_asm_out_name for lto data (so a general solution would be great). =20 What is the reason for associating the section pointers with the casm object? * I can understand that each instance of a casm object would have potentially a different current section (=E2=80=9Cin_section=E2=80=9D), = but it seems that as things stand the section pointers would be duplicates. * In the case that there=E2=80=99s reason that the sections could be = different between casm instances, then would it make sense to have a target hook so that target-specific sections can be added to the local list (via some indirection, I=E2=80=99d assume)? =E2=80=94 (of course, it would be great if one day we could abstract the asm out such that we could switch to a direct-to-object implementation) > I've built all cross compilers with the change and > can bootstrap on x86_64-linux-gnu and survives regression tests. A native bootstrap fails early in stage1 for x86_64-darwin (I=E2=80=99ll = take a look at fixing the issues once the patch series settles down) --- /src-local/gcc-master/gcc/dwarf2asm.c: In function =E2=80=98void = dw2_asm_output_nstring(const char*, size_t, const char*, ...)=E2=80=99: /src-local/gcc-master/gcc/output.h:387:26: error: expected initializer = before =E2=80=98->=E2=80=99 token #define asm_out_file casm->out_file ^ /src-local/gcc-master/gcc/defaults.h:68:13: note: in expansion of macro = =E2=80=98asm_out_file=E2=80=99 FILE *asm_out_file =3D _hide_asm_out_file; \ ^~~~~~~~~~~~ /src-local/gcc-master/gcc/dwarf2asm.c:414:7: note: in expansion of macro = =E2=80=98ASM_OUTPUT_ASCII=E2=80=99 ASM_OUTPUT_ASCII (asm_out_file, str, len); ^~~~~~~~~~~~~~~~ In file included from ./tm.h:42:0, ------ /src-local/gcc-master/gcc/config/i386/darwin.h:219:6: error: = =E2=80=98in_section=E2=80=99 was not declared in this scope if (in_section =3D=3D text_section) \ ^ /src-local/gcc-master/gcc/dwarf2out.c:677:3: note: in expansion of macro = =E2=80=98ASM_OUTPUT_ALIGN=E2=80=99 ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));