From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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-ej1-x635.google.com with SMTP id ft34so13060765ejc.12; Wed, 09 Nov 2022 11:02:39 -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:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JniFKryGt7U/WHxlDgYxNiM9IVmvLlQiEQJuByNMa60=; b=DAM+QCyjRwZ9N1wuvjb5jamHlC5HGU8t45hEZC7OqixvF3ytEqykz1MRi8frXcNioY ZRdzzdpItT/m8xKKu5x7ZeFZZOZATBMYNN0B/R0xfal1Ka4qRB/myvke0Ila85QUAeNO iB0q8RiMn7NuXM4T4ifpLA1al/EXdLEK+hyvYM2NWkmZ6cXV+4Ii0XXQEKt1wRBeltPQ eOtJPbqzs5nA6mMu62oyqC64WfK16SOiYX6Fes7ZDpqa7qCEQXOQv/MuBrIS/3IEvBwT I44ngTavVwKK2jDfUKAcXz48DNhDCkaX0fuggu06Mt/+c1eQmCVp8q6UmY+15ANUESRP l/aQ== 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-Google-Smtp-Source: AMsMyM64fNbv7f+/iqMoAbUBxZyNDlIMZP2gHoVskHbpRq2ekkYERothdX8VdIOzDMPMh/aNbwjiew== 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) From: Bernhard Reutner-Fischer 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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; -- 2.38.1