From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id B7713388E80D; Thu, 17 Nov 2022 08:02:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B7713388E80D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52b.google.com with SMTP id x102so1461650ede.0; Thu, 17 Nov 2022 00:02:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Z+jIR+4DDtRpR9pizLRo//ikzK328Wz5JSVhaQJpPQw=; b=lDLztlPgPTEl5iCjoIoD6QwHlePP/ioIZHZe+GK7XRy8hAZCa5l65QBctD7TtbqPgM tId70cXd4LeOma7FCCFyZO13+sNvrRW02Gqt+1D/iyV0Bh1qyh3sv3NfPiYVJarj1zZO +qr4H8m7WJwfo61vMAmRsfJZCKDxw6QtF3q9cZiGSZ6qO9vGXeSW/v9iZpTx2kaSMbOZ PzllIzmcI1F6TvNCJ6ilLLQq8KKxV+v+POgQzwN+uSrvHz/tM7fmSLePq1SJENXID+Rv l/wF6gqPeNQ52chhUP8TzznVlKmkmtfiwBXxYpLZOyeT3Y1JUxaCqz2qVq/NEmGMll7D Mqlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z+jIR+4DDtRpR9pizLRo//ikzK328Wz5JSVhaQJpPQw=; b=iNu38XGzc3VLRgv6uyHaCjkNKEyDzijdhRxMg6Mz8HJAUitP9m9WSkCWkLwafXVhGO l1yZR4MfW82Hqk1PM6NvShHEBKmVizeM1XgGPhd9WFBvANa6El5u/A1yMysK7JWfxDKt S38gByvryiXdxskflArpN8lPV+3xJHmnUUedaqp6CYATa3MJNqJNbKi45C4H0NrqAvA4 +YiIFoos+PVOUpt+s19LNbUVz4MxmaGcihEYjKzU3ate1tUmW9ewlMzfJ5EaK8cXsQeh A36/I604UozqbBRP+6Iufmr5n759xof3fpil11NxrtFdHExiuwAosSk0cQl5KSZ1HyXo cD1Q== X-Gm-Message-State: ANoB5pmIcpCKum9vEwasMubH2z5rYasNxBy861iwuAdqlGYzRXyss8QG NEArM/DfLKjnONGo2dSo95k= X-Google-Smtp-Source: AA0mqf4tnOEikxav3SpLecJyoRdXI4nCDoHpH6zeyuMLrUAVZ6hY7VgHQbTIdJHTpCQdWp7gYu7Jxw== X-Received: by 2002:a05:6402:22f7:b0:462:5f37:5a22 with SMTP id dn23-20020a05640222f700b004625f375a22mr1133431edb.226.1668672143102; Thu, 17 Nov 2022 00:02:23 -0800 (PST) Received: from nbbrfq (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id r11-20020a056402034b00b004587f9d3ce8sm195161edw.56.2022.11.17.00.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 00:02:22 -0800 (PST) Date: Thu, 17 Nov 2022 09:02:19 +0100 From: Bernhard Reutner-Fischer To: gcc-patches@gcc.gnu.org, Jan Hubicka Cc: rep.dot.nop@gmail.com, Bernhard Reutner-Fischer , gfortran ML Subject: Re: [PATCH 1/2] symtab: also change RTL decl name Message-ID: <20221117090219.2884af08@nbbrfq> In-Reply-To: <20221109190225.96037-2-aldot@gcc.gnu.org> References: <20221109190225.96037-1-aldot@gcc.gnu.org> <20221109190225.96037-2-aldot@gcc.gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 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. thanks, On Wed, 9 Nov 2022 20:02:24 +0100 Bernhard Reutner-Fischer wrote: > We were changing the ASSEMBLER_NAME of the function decl > but not the name in DECL_RTL which is used as the function name > fnname in rest_of_handle_final(). This led to using the old, wrong name > for the attribute target default function when using target_clones. > > Bootstrapped and regtested cleanly on x86_64-unknown-linux > for c,c++,fortran,lto. > Ok for trunk? > > gcc/ChangeLog: > > * symtab.cc: Remove stray comment. > (symbol_table::change_decl_assembler_name): Also update the > name in DECL_RTL. > > Cc: Jan Hubicka > --- > gcc/symtab.cc | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/gcc/symtab.cc b/gcc/symtab.cc > index f2d96c0268b..2e20bf5fefc 100644 > --- a/gcc/symtab.cc > +++ b/gcc/symtab.cc > @@ -154,8 +154,6 @@ symbol_table::decl_assembler_name_equal (tree decl, const_tree asmname) > } > > > -/* Returns nonzero if P1 and P2 are equal. */ > - > /* Insert NODE to assembler name hash. */ > > 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); > + > if (alias) > { > IDENTIFIER_TRANSPARENT_ALIAS (name) = 1;