From patchwork Wed Nov 9 19:02:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 17763 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp509813wru; Wed, 9 Nov 2022 11:03:58 -0800 (PST) X-Google-Smtp-Source: AMsMyM4ljfckIbbJsm3jcQ9SFK0noQ/xxxHdEUZnYNKX6TtnaH882IE6wpWyC3FkAijrT97nS4XF X-Received: by 2002:a17:907:d08f:b0:7ae:3565:49e8 with SMTP id vc15-20020a170907d08f00b007ae356549e8mr1389135ejc.761.1668020638801; Wed, 09 Nov 2022 11:03:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668020638; cv=none; d=google.com; s=arc-20160816; b=gMN4bC1EHJsSCKPaaFFJFkMjWZxhhVpzd0uGaojUR3+1RdQvPgfiZO4jGo9i0lxLNZ 5Z7CcqFOahrcFkH8dmu2yWpFJaPXlzC/6LTNDOngtcAlkrD5vy0dARZydTfkLb4qxm0V 34mQ9IfASRfllU/Ic+/ZbWiOVfTw0Eu8jAOwu8d78WCa+uhqzC/NM7kHq9u6W+Wiaef8 RWg0+gDLb7O4h163RBI/SzaSH+d+laAvL97s4vAElSey5fxn3C16XX2A37qBYtuL73BN MeRGP76Yq2/8SJQpIIZpo72XTq35z1tSH3fCyMXyi3qV6t4tV6+f4VSYeVFepm0yMllm 1gCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=JniFKryGt7U/WHxlDgYxNiM9IVmvLlQiEQJuByNMa60=; b=uYGOYPjN6NNjeBI3ICZ1g6Lx7qY+LRq5RcbqdTvjySGORzU7wtob8fu1RSB0pQu1V0 hohIx1ZImyJpkTxnQN+yIANGMFL3PXshOJ9G/ZDsm1/OQXt3BZBoAPNhQ1/TL3EMcFIn /3BUDZ1b+U9OH6Y5fA04r0zcXKaHe+YIvG8GOdiTqJGUVQ+8StxRPjskpY2gY7uX/Une LoQWqchVZae1kumSGnLvcTENv8l/YOb5yzhhhKP3hbD6DiSZQpxrerbEaYAiU6/cUiKL brQmg0CKNeS7u8nrK9Z29ZZfdRaY8zDLjGkLgTs67v6E5aD0xoTUvkXRlQAvSta1nGCq iG+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=o+CEz17x; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ba27-20020a0564021adb00b004604dd1cb37si15053724edb.212.2022.11.09.11.03.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 11:03:58 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=o+CEz17x; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 472D63887F69 for ; Wed, 9 Nov 2022 19:03:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 472D63887F69 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668020613; bh=JniFKryGt7U/WHxlDgYxNiM9IVmvLlQiEQJuByNMa60=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=o+CEz17x1uNQXlEkA65GK3g0e/rDQ74RpjVJLRtcD/3NlXr+s5mZxMLS123kKCAzj Ksw4qMOufeayUD4lLykIics32mFp6oxH/+L/XbkrBD9VI0Ib28Tuo7kjSq0UYBdGm2 sBGADDI5YCCx9VwL5Ewplu3+0Guh6P9MaT1EXOX0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id CC0793858D28; Wed, 9 Nov 2022 19:02:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC0793858D28 Received: by mail-ej1-x635.google.com with SMTP id ft34so13060765ejc.12; Wed, 09 Nov 2022 11:02:39 -0800 (PST) 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:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JniFKryGt7U/WHxlDgYxNiM9IVmvLlQiEQJuByNMa60=; b=khpd7FlN/6bsp8mjVPETIZY4gjx2AK+3gAz5uwGP41h5muSKNMFIJ8AAo/eTp8FTT1 vB4MA0b5zWM457FO876yBg8DMK99xih2VCOz+/b7eBdG2488aQ6fCne8isEMguEYtglE TMFPk0Xw1J6AgNAxrb7gnD5sfYMHf98NRF1ChoSPIiANsoJxXVvzYdBOpJxrfeyfH1FX 1Sz8UjG4r4vSW1ypAoiz/OMsfYgVh760cNB/qLvHYPgvhTT9Skh2POCv7sXUBXV3NQIb ywH7QoGt03iH/Q0xkDf49gj9ZHGctNHxb8HB/pXqODowtHEHkv8sBG1c+LUcOHii/9p4 XyPg== X-Gm-Message-State: ACrzQf3d6lrGrfY8V81jTlsDvPYQHkm5elZ0pNLiFPbU7MW0CbyQ4m6d cEalfyg563eCAoV2vl4YL/0= X-Received: by 2002:a17:906:cc4e:b0:7ae:3f78:c8b8 with SMTP id mm14-20020a170906cc4e00b007ae3f78c8b8mr24895593ejb.394.1668020558702; Wed, 09 Nov 2022 11:02:38 -0800 (PST) Received: from nbbrfq (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id i28-20020a1709067a5c00b0077f20a722dfsm6123674ejo.165.2022.11.09.11.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 11:02:37 -0800 (PST) X-Google-Original-From: Bernhard Reutner-Fischer Received: from b by nbbrfq with local (Exim 4.96) (envelope-from ) id 1osqLM-000OzL-1z; Wed, 09 Nov 2022 20:02:36 +0100 To: gcc-patches@gcc.gnu.org Cc: Bernhard Reutner-Fischer , Bernhard Reutner-Fischer , gfortran ML , Jan Hubicka Subject: [PATCH 1/2] symtab: also change RTL decl name Date: Wed, 9 Nov 2022 20:02:24 +0100 Message-Id: <20221109190225.96037-2-aldot@gcc.gnu.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221109190225.96037-1-aldot@gcc.gnu.org> References: <20221109190225.96037-1-aldot@gcc.gnu.org> MIME-Version: 1.0 X-Spam-Status: No, score=-9.6 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 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-Patchwork-Original-From: Bernhard Reutner-Fischer via Gcc-patches From: Bernhard Reutner-Fischer Reply-To: Bernhard Reutner-Fischer Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749046409721028415?= X-GMAIL-MSGID: =?utf-8?q?1749046409721028415?= 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;