This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: subreg_get_info vs mode restrictions in registers?
- From: DJ Delorie <dj at redhat dot com>
- To: iant at google dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 25 Jan 2007 20:15:14 -0500
- Subject: Re: subreg_get_info vs mode restrictions in registers?
- References: <200701242041.l0OKfsL3029775@greed.delorie.com> <m3tzygkt2l.fsf@localhost.localdomain> <200701250139.l0P1dlED004361@greed.delorie.com> <m3fy9zk4kv.fsf@localhost.localdomain>
> This is OK if it passes bootstrap and testsuite on some primary
> platform.
Passes on i386-linux, committed.
2007-01-25 DJ Delorie <dj@redhat.com>
* reload1.c (choose_reload_regs): Check for invalid subregs before
computing their locations, not after.
Index: reload1.c
===================================================================
--- reload1.c (revision 121197)
+++ reload1.c (working copy)
@@ -5653,7 +5653,16 @@
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 @@
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)