Patchwork [alpha] : Fix ICE in mems_in_disjoint_alias_sets_p

login
register
mail settings
Submitter Uros Bizjak
Date March 29, 2011, 11:26 a.m.
Message ID <AANLkTinFdqJVmuygD6VbPp9u3SPAPQ0qkE1DR6QyU9tJ@mail.gmail.com>
Download mbox | patch
Permalink /patch/88749/
State New
Headers show

Comments

Uros Bizjak - March 29, 2011, 11:26 a.m.
Hello!

Attached patch fixes the same ICE as seen on sparc [1], where it was
fixed by [2].

2011-03-29  Uros Bizjak  <ubizjak@gmail.com>

	* config/alpha/alpha.c (alpha_sr_alias_set): Don't define.
	(alpha_option_override): Don't set alpha_sr_alias_set.
	(emit_frame_store_1): Use gen_frame_mem rather than calling
	set_mem_alias_set.
	(alpha_expand_epilogue): Ditto.

This patch is prerequisite to build libgo on alpha. Due to
binutils-2.21 bug [3] and independently of this patch, the bootstrap
with go enabled fails with an (otherwise harmless) compare failure in
the go directory.

Patch was bootstrapped and regression tested on alphaev68-pc-linux-gnu.

OK for 4.7 and 4.6.1?

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47219
[2] http://gcc.gnu.org/ml/gcc-patches/2011-01/msg00916.html

[3] http://sourceware.org/bugzilla/show_bug.cgi?id=12610

Uros.
Richard Henderson - March 29, 2011, 4:19 p.m.
On 03/29/2011 04:26 AM, Uros Bizjak wrote:
> 2011-03-29  Uros Bizjak  <ubizjak@gmail.com>
> 
> 	* config/alpha/alpha.c (alpha_sr_alias_set): Don't define.
> 	(alpha_option_override): Don't set alpha_sr_alias_set.
> 	(emit_frame_store_1): Use gen_frame_mem rather than calling
> 	set_mem_alias_set.
> 	(alpha_expand_epilogue): Ditto.

Ok.


r~

Patch

Index: alpha.c
===================================================================
--- alpha.c	(revision 171651)
+++ alpha.c	(working copy)
@@ -95,10 +95,6 @@  int alpha_memory_latency = 3;
 
 static int alpha_function_needs_gp;
 
-/* The alias set for prologue/epilogue register save/restore.  */
-
-static GTY(()) alias_set_type alpha_sr_alias_set;
-
 /* The assembler name of the current function.  */
 
 static const char *alpha_fnname;
@@ -476,9 +472,6 @@  alpha_option_override (void)
   if (align_functions <= 0)
     align_functions = 16;
 
-  /* Acquire a unique set number for our register saves and restores.  */
-  alpha_sr_alias_set = new_alias_set ();
-
   /* Register variables and functions with the garbage collector.  */
 
   /* Set up function hooks.  */
@@ -7448,8 +7441,7 @@  emit_frame_store_1 (rtx value, rtx base_
   rtx addr, mem, insn;
 
   addr = plus_constant (base_reg, base_ofs);
-  mem = gen_rtx_MEM (DImode, addr);
-  set_mem_alias_set (mem, alpha_sr_alias_set);
+  mem = gen_frame_mem (DImode, addr);
 
   insn = emit_move_insn (mem, value);
   RTX_FRAME_RELATED_P (insn) = 1;
@@ -8056,9 +8048,7 @@  alpha_expand_epilogue (void)
 
       /* Restore registers in order, excepting a true frame pointer.  */
 
-      mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, reg_offset));
-      if (! eh_ofs)
-        set_mem_alias_set (mem, alpha_sr_alias_set);
+      mem = gen_frame_mem (DImode, plus_constant (sa_reg, reg_offset));
       reg = gen_rtx_REG (DImode, REG_RA);
       emit_move_insn (reg, mem);
       cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg, cfa_restores);
@@ -8073,8 +8063,8 @@  alpha_expand_epilogue (void)
 	      fp_offset = reg_offset;
 	    else
 	      {
-		mem = gen_rtx_MEM (DImode, plus_constant(sa_reg, reg_offset));
-		set_mem_alias_set (mem, alpha_sr_alias_set);
+		mem = gen_frame_mem (DImode,
+				     plus_constant (sa_reg, reg_offset));
 		reg = gen_rtx_REG (DImode, i);
 		emit_move_insn (reg, mem);
 		cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg,
@@ -8086,8 +8076,7 @@  alpha_expand_epilogue (void)
       for (i = 0; i < 31; ++i)
 	if (fmask & (1UL << i))
 	  {
-	    mem = gen_rtx_MEM (DFmode, plus_constant(sa_reg, reg_offset));
-	    set_mem_alias_set (mem, alpha_sr_alias_set);
+	    mem = gen_frame_mem (DFmode, plus_constant (sa_reg, reg_offset));
 	    reg = gen_rtx_REG (DFmode, i+32);
 	    emit_move_insn (reg, mem);
 	    cfa_restores = alloc_reg_note (REG_CFA_RESTORE, reg, cfa_restores);
@@ -8145,8 +8134,7 @@  alpha_expand_epilogue (void)
       if (fp_is_frame_pointer)
 	{
 	  emit_insn (gen_blockage ());
-	  mem = gen_rtx_MEM (DImode, plus_constant (sa_reg, fp_offset));
-	  set_mem_alias_set (mem, alpha_sr_alias_set);
+	  mem = gen_frame_mem (DImode, plus_constant (sa_reg, fp_offset));
 	  emit_move_insn (hard_frame_pointer_rtx, mem);
 	  cfa_restores = alloc_reg_note (REG_CFA_RESTORE,
 					 hard_frame_pointer_rtx, cfa_restores);