From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id B3A793860744; Mon, 21 Nov 2022 19:02:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B3A793860744 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 98E49284A6F; Mon, 21 Nov 2022 20:02:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1669057369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=r1WNpAUdup5eLnmlanNdqbrNugNiGuc2/79mj3C8Emw=; b=iNbUk4B7qsFHX9koK6HWZf1J5bs2NMjUIWzZIxm+Cpce3eYUvXL4F2VpAba7fSQJdYoW0K tlIpKFh3FSREXW9E8H3YX4e5566ZbIZat35JP1DaCySO5fWOtcX5fpDBspu/sdkwQv1jTu GGMT4LboAbBA/kDkdhGLaqVdtJgvGcQ= Date: Mon, 21 Nov 2022 20:02:49 +0100 From: Jan Hubicka To: Bernhard Reutner-Fischer Cc: gcc-patches@gcc.gnu.org, Bernhard Reutner-Fischer , gfortran ML Subject: Re: [PATCH 1/2] symtab: also change RTL decl name Message-ID: References: <20221109190225.96037-1-aldot@gcc.gnu.org> <20221109190225.96037-2-aldot@gcc.gnu.org> <20221117090219.2884af08@nbbrfq> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221117090219.2884af08@nbbrfq> X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP 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 Honza, Ping. > Regtests cleanly for c,fortran,c++,ada,d,go,lto,objc,obj-c++ > Ok? > I'd need this for attribute target_clones for the Fortran FE. Sorry for delay here. > > void > > @@ -303,6 +301,10 @@ symbol_table::change_decl_assembler_name (tree decl, tree name) > > warning (0, "%qD renamed after being referenced in assembly", decl); > > > > SET_DECL_ASSEMBLER_NAME (decl, name); > > + /* Set the new name in rtl. */ > > + if (DECL_RTL_SET_P (decl)) > > + XSTR (XEXP (DECL_RTL (decl), 0), 0) = IDENTIFIER_POINTER (name); I am not quite sure how safe this is. We generally produce DECL_RTL when we produce assembly file. So if DECL_RTL is set then we probably already output the original function name and it is too late to change it. Also RTL is shared so changing it in-place is going to rewrite all the existing RTL expressions using it. Why the DECL_RTL is produced for function you want to rename? Honza > > + > > if (alias) > > { > > IDENTIFIER_TRANSPARENT_ALIAS (name) = 1; >