caller-save adjust_address fix

Alan Modra amodra@gmail.com
Thu Jun 10 01:56:00 GMT 2010


This patch fixes an ICE in change_address_1 seen when a caller-save
slot is needed in a different mode to that in which it is created, and
the stack offset is too large for valid reg+offset addressing.
Refer http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44364#c38
Fairly obvious, since if no mode change is needed then we simply copy
the mem regardless of whether the offset is valid or not.
Bootstrapped etc. powerpc-linux.  OK to apply?

	PR target/44364
	* caller-save.c (insert_restore, insert_save): Use non-validate
	form of adjust_address.

Index: gcc/caller-save.c
===================================================================
--- gcc/caller-save.c	(revision 160429)
+++ gcc/caller-save.c	(working copy)
@@ -1212,7 +1212,7 @@ insert_restore (struct insn_chain *chain
       /* Check that insn to restore REGNO in save_mode[regno] is
 	 correct.  */
       && reg_save_code (regno, save_mode[regno]) >= 0)
-    mem = adjust_address (mem, save_mode[regno], 0);
+    mem = adjust_address_nv (mem, save_mode[regno], 0);
   else
     mem = copy_rtx (mem);
 
@@ -1293,7 +1293,7 @@ insert_save (struct insn_chain *chain, i
       /* Check that insn to save REGNO in save_mode[regno] is
 	 correct.  */
       && reg_save_code (regno, save_mode[regno]) >= 0)
-    mem = adjust_address (mem, save_mode[regno], 0);
+    mem = adjust_address_nv (mem, save_mode[regno], 0);
   else
     mem = copy_rtx (mem);
 
-- 
Alan Modra
Australia Development Lab, IBM



More information about the Gcc-patches mailing list