From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2049) id 78D783858012; Mon, 28 Feb 2022 12:08:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 78D783858012 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Matthew Malcomson To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/morello)] Fix use of unmangled names in unwinding info X-Act-Checkin: gcc X-Git-Author: Alex Coplan X-Git-Refname: refs/vendors/ARM/heads/morello X-Git-Oldrev: 8067f214025fd95aaa0fc3af962bb22efede8a67 X-Git-Newrev: c9fb2c79e32f61f89d351f3a9772a9213480963d Message-Id: <20220228120850.78D783858012@sourceware.org> Date: Mon, 28 Feb 2022 12:08:50 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2022 12:08:50 -0000 https://gcc.gnu.org/g:c9fb2c79e32f61f89d351f3a9772a9213480963d commit c9fb2c79e32f61f89d351f3a9772a9213480963d Author: Alex Coplan Date: Tue Feb 8 10:02:21 2022 +0000 Fix use of unmangled names in unwinding info Commit dbc45b10e6 introduced assembly failures for purecap and fakecap by emitting unmangled names in assembly. As it stands, the code builds a SYMBOL_REF of current_function_name (), but this is the raw unmangled name and is not suitable for use in assembly. This patch simply changes the call to get_fnname_from_decl (current_function_decl) which gets the mangled name from the decl's DECL_RTL. Note that the code later calls switch_to_exception_section (name), and indeed by inspecting other call sites of this function in the file, we can see that they get the function name using the pattern above (with get_fnname_from_decl). There is a separate issue where we use the new exception table scheme even for fakecap (we should just do it for purecap), but that should be fixed separately. Diff: --- gcc/except.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/except.c b/gcc/except.c index d1b99c14570..22715ce06e1 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2907,7 +2907,7 @@ dw2_output_call_site_table (int cs_format, int section) /* First create SYMBOL_REFs to the function name, the label at the start of the function, and the landing pad label. */ - const char * name = ggc_strdup (current_function_name()); + const char * name = get_fnname_from_decl (current_function_decl); rtx named_function_symbol = gen_rtx_SYMBOL_REF (Pmode, name); SYMBOL_REF_FLAGS (named_function_symbol) = SYMBOL_FLAG_LOCAL;