public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Matthew Malcomson <matmal01@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/vendors/ARM/heads/morello)] Fix use of unmangled names in unwinding info
Date: Mon, 28 Feb 2022 12:08:50 +0000 (GMT)	[thread overview]
Message-ID: <20220228120850.78D783858012@sourceware.org> (raw)

https://gcc.gnu.org/g:c9fb2c79e32f61f89d351f3a9772a9213480963d

commit c9fb2c79e32f61f89d351f3a9772a9213480963d
Author: Alex Coplan <alex.coplan@arm.com>
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;


                 reply	other threads:[~2022-02-28 12:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220228120850.78D783858012@sourceware.org \
    --to=matmal01@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).