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
Fix AArch64 ILP32 ICE.

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

2018-09-25  Andrew Stubbs  <a...@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

Reply via email to