From: dj Date: Fri, 26 Jan 2007 01:15:05 +0000 (+0000) Subject: * reload1.c (choose_reload_regs): Check for invalid subregs before X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f82c9309b58e52344feb2159db842c8c78b6f562;p=thirdparty%2Fgcc.git * reload1.c (choose_reload_regs): Check for invalid subregs before computing their locations, not after. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121198 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0791bafb57eb..4cf04ef2a001 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2007-01-25 DJ Delorie + + * reload1.c (choose_reload_regs): Check for invalid subregs before + computing their locations, not after. + 2007-01-25 Geoffrey Keating PR 25127 diff --git a/gcc/reload1.c b/gcc/reload1.c index 8f7c703c4151..5598b7afdba5 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -5653,7 +5653,16 @@ choose_reload_regs (struct insn_chain *chain) regno = subreg_regno (rld[r].in); #endif - if (regno >= 0 && reg_last_reload_reg[regno] != 0) + if (regno >= 0 + && reg_last_reload_reg[regno] != 0 +#ifdef CANNOT_CHANGE_MODE_CLASS + /* Verify that the register it's in can be used in + mode MODE. */ + && !REG_CANNOT_CHANGE_MODE_P (REGNO (reg_last_reload_reg[regno]), + GET_MODE (reg_last_reload_reg[regno]), + mode) +#endif + ) { enum reg_class class = rld[r].class, last_class; rtx last_reg = reg_last_reload_reg[regno]; @@ -5673,13 +5682,6 @@ choose_reload_regs (struct insn_chain *chain) if ((GET_MODE_SIZE (GET_MODE (last_reg)) >= GET_MODE_SIZE (need_mode)) -#ifdef CANNOT_CHANGE_MODE_CLASS - /* Verify that the register in "i" can be obtained - from LAST_REG. */ - && !REG_CANNOT_CHANGE_MODE_P (REGNO (last_reg), - GET_MODE (last_reg), - mode) -#endif && reg_reloaded_contents[i] == regno && TEST_HARD_REG_BIT (reg_reloaded_valid, i) && HARD_REGNO_MODE_OK (i, rld[r].mode)