jump.c (rtx_renumbered_equal_p): Do not call subreg_regno_offset for unrepresentable...
authorJoseph Myers <joseph@codesourcery.com>
Wed, 6 Aug 2008 15:20:14 +0000 (16:20 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Wed, 6 Aug 2008 15:20:14 +0000 (16:20 +0100)
* jump.c (rtx_renumbered_equal_p): Do not call subreg_regno_offset
for unrepresentable subregs or treat them as equal to other regs
or subregs with the same register number.

From-SVN: r138804

gcc/ChangeLog
gcc/jump.c

index b38ccbb28968d6f6301c4538552d013b640432b0..1e40f07e4f9daa20b389420f113d58eb157d9f8e 100644 (file)
@@ -1,3 +1,9 @@
+2008-08-06  Joseph Myers  <joseph@codesourcery.com>
+
+       * jump.c (rtx_renumbered_equal_p): Do not call subreg_regno_offset
+       for unrepresentable subregs or treat them as equal to other regs
+       or subregs with the same register number.
+
 2008-08-06  Aldy Hernandez  <aldyh@redhat.com>
 
        PR middle-end/35432
index 595363b1adbc2556b7f72aa04918ab3925622aba..c0ab6909a2a79a6084bab97867d762bf7db1422d 100644 (file)
@@ -1552,12 +1552,22 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
 
          if (reg_renumber[reg_x] >= 0)
            {
+             if (!subreg_offset_representable_p (reg_renumber[reg_x],
+                                                 GET_MODE (SUBREG_REG (x)),
+                                                 byte_x,
+                                                 GET_MODE (x)))
+               return 0;
              reg_x = subreg_regno_offset (reg_renumber[reg_x],
                                           GET_MODE (SUBREG_REG (x)),
                                           byte_x,
                                           GET_MODE (x));
              byte_x = 0;
            }
+         else if (!subreg_offset_representable_p (reg_x,
+                                                  GET_MODE (SUBREG_REG (x)),
+                                                  byte_x,
+                                                  GET_MODE (x)))
+           return 0;
        }
       else
        {
@@ -1573,12 +1583,22 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
 
          if (reg_renumber[reg_y] >= 0)
            {
+             if (!subreg_offset_representable_p (reg_renumber[reg_y],
+                                                 GET_MODE (SUBREG_REG (y)),
+                                                 byte_y,
+                                                 GET_MODE (y)))
+               return 0;
              reg_y = subreg_regno_offset (reg_renumber[reg_y],
                                           GET_MODE (SUBREG_REG (y)),
                                           byte_y,
                                           GET_MODE (y));
              byte_y = 0;
            }
+         else if (!subreg_offset_representable_p (reg_y,
+                                                  GET_MODE (SUBREG_REG (y)),
+                                                  byte_y,
+                                                  GET_MODE (y)))
+           return 0;
        }
       else
        {