Fix AArch64 ILP ICE

Message ID 54a5acc7-0629-32c1-c20e-b922e8809aaa@codesourcery.com
State New
Headers show
Series
  • Fix AArch64 ILP ICE
Related show

Commit Message

Andrew Stubbs Sept. 25, 2018, 2:24 p.m.
On 22/09/18 19:51, Andreas Schwab wrote:
> That breaks aarch64 ILP32.


The problem is that the mode given to expand_expr is just a "hint", 
apparently, and it's being ignored.

I'm testing the attached patch for GCN. It fixes the ICE for AArch64 
just fine.

OK?

Andrew

Comments

Andreas Schwab Sept. 26, 2018, 8:48 a.m. | #1
On Sep 25 2018, Andrew Stubbs <ams@codesourcery.com> wrote:

> Ensure that the address really is the correct mode for an address.

>

> 2018-09-25  Andrew Stubbs  <ams@codesourcery.com>

>

> 	gcc/

> 	* builtins.c (get_builtin_sync_mem): Force address mode conversion.


This has survived bootstrap so far.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."
Richard Biener Sept. 26, 2018, 1:38 p.m. | #2
On Tue, Sep 25, 2018 at 4:25 PM Andrew Stubbs <ams@codesourcery.com> wrote:
>

> On 22/09/18 19:51, Andreas Schwab wrote:

> > That breaks aarch64 ILP32.

>

> The problem is that the mode given to expand_expr is just a "hint",

> apparently, and it's being ignored.

>

> I'm testing the attached patch for GCN. It fixes the ICE for AArch64

> just fine.

>

> OK?


OK.

> Andrew
Andrew Stubbs Sept. 26, 2018, 4:02 p.m. | #3
On 26/09/18 14:38, Richard Biener wrote:
> OK.


Committed, thanks.

Andrew

Patch

Fix AArch64 ILP32 ICE.

Ensure that the address really is the correct mode for an address.

2018-09-25  Andrew Stubbs  <ams@codesourcery.com>

	gcc/
	* builtins.c (get_builtin_sync_mem): Force address mode conversion.

diff --git a/gcc/builtins.c b/gcc/builtins.c
index 1d4de09..956f872 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5869,6 +5869,7 @@  get_builtin_sync_mem (tree loc, machine_mode mode)
   scalar_int_mode addr_mode = targetm.addr_space.address_mode (addr_space);
 
   addr = expand_expr (loc, NULL_RTX, addr_mode, EXPAND_SUM);
+  addr = convert_memory_address (addr_mode, addr);
 
   /* Note that we explicitly do not want any alias information for this
      memory, so that we kill all other live memories.  Otherwise we don't