public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@redhat.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [i386, darwin] Fix pr/49714
Date: Tue, 12 Jul 2011 18:42:00 -0000	[thread overview]
Message-ID: <4E1C91A9.90403@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 394 bytes --]

It *appears* as if the references we were generating before
switching the thunk to rtl weren't valid.  Certainly those
same references don't pass legitimate_address_p, which is
the direct cause of the assertion failure.

Fixed by using the same address transformation that 
ix86_expand_call would have used, rather than doing
something by hand.

Thanks to Dominiq for testing.  Committed.


r~

[-- Attachment #2: z --]
[-- Type: text/plain, Size: 816 bytes --]

        PR target/49714
        * config/i386/i386.c (x86_output_mi_thunk): Use
        machopic_indirect_call_target instead of machopic_indirection_name 
        directly.

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 4ca95ab..9f63bf7 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -29409,12 +29409,8 @@ x86_output_mi_thunk (FILE *file,
 #if TARGET_MACHO
       else if (TARGET_MACHO)
 	{
-	  rtx sym_ref = XEXP (DECL_RTL (function), 0);
-	  if (TARGET_MACHO_BRANCH_ISLANDS)
-	    sym_ref = (gen_rtx_SYMBOL_REF
-		   (Pmode,
-		    machopic_indirection_name (sym_ref, /*stub_p=*/true)));
-	  fnaddr = gen_rtx_MEM (Pmode, sym_ref);
+	  fnaddr = machopic_indirect_call_target (DECL_RTL (function));
+	  fnaddr = XEXP (fnaddr, 0);
 	}
 #endif /* TARGET_MACHO */
       else

                 reply	other threads:[~2011-07-12 18:26 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=4E1C91A9.90403@redhat.com \
    --to=rth@redhat.com \
    --cc=gcc-patches@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).