From patchwork Thu Jun 10 01:04:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: caller-save adjust_address fix From: Alan Modra X-Patchwork-Id: 55139 Message-Id: <20100610010440.GN7312@bubble.grove.modra.org> To: gcc-patches@gcc.gnu.org Date: Thu, 10 Jun 2010 10:34:40 +0930 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);