OSDN Git Service

2009-04-15 Rafael Avila de Espindola <espindola@google.com>
[pf3gnuchains/gcc-fork.git] / gcc / jump.c
index 23d183e..1189f81 100644 (file)
@@ -1,6 +1,6 @@
 /* Optimize jump instructions, for GNU compiler.
    Copyright (C) 1987, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
-   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -351,7 +351,7 @@ reversed_comparison_code_parts (enum rtx_code code, const_rtx arg0,
        return UNKNOWN;
 
       /* These CONST_CAST's are okay because prev_nonnote_insn just
-        returns it's argument and we assign it to a const_rtx
+        returns its argument and we assign it to a const_rtx
         variable.  */
       for (prev = prev_nonnote_insn (CONST_CAST_RTX(insn));
           prev != 0 && !LABEL_P (prev);
@@ -1068,8 +1068,7 @@ mark_jump_label_1 (rtx x, rtx insn, bool in_mem, bool is_target)
                   a label, except for the primary target of a jump,
                   must have such a note.  */
                if (! find_reg_note (insn, kind, label))
-                 REG_NOTES (insn)
-                   = gen_rtx_INSN_LIST (kind, label, REG_NOTES (insn));
+                 add_reg_note (insn, kind, label);
              }
          }
        return;
@@ -1537,6 +1536,7 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
     {
       int reg_x = -1, reg_y = -1;
       int byte_x = 0, byte_y = 0;
+      struct subreg_info info;
 
       if (GET_MODE (x) != GET_MODE (y))
        return 0;
@@ -1553,10 +1553,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
 
          if (reg_renumber[reg_x] >= 0)
            {
-             reg_x = subreg_regno_offset (reg_renumber[reg_x],
-                                          GET_MODE (SUBREG_REG (x)),
-                                          byte_x,
-                                          GET_MODE (x));
+             subreg_get_info (reg_renumber[reg_x],
+                              GET_MODE (SUBREG_REG (x)), byte_x,
+                              GET_MODE (x), &info);
+             if (!info.representable_p)
+               return 0;
+             reg_x = info.offset;
              byte_x = 0;
            }
        }
@@ -1574,10 +1576,12 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
 
          if (reg_renumber[reg_y] >= 0)
            {
-             reg_y = subreg_regno_offset (reg_renumber[reg_y],
-                                          GET_MODE (SUBREG_REG (y)),
-                                          byte_y,
-                                          GET_MODE (y));
+             subreg_get_info (reg_renumber[reg_y],
+                              GET_MODE (SUBREG_REG (y)), byte_y,
+                              GET_MODE (y), &info);
+             if (!info.representable_p)
+               return 0;
+             reg_y = info.offset;
              byte_y = 0;
            }
        }
@@ -1719,13 +1723,17 @@ true_regnum (const_rtx x)
     {
       int base = true_regnum (SUBREG_REG (x));
       if (base >= 0
-         && base < FIRST_PSEUDO_REGISTER
-         && subreg_offset_representable_p (REGNO (SUBREG_REG (x)),
-                                           GET_MODE (SUBREG_REG (x)),
-                                           SUBREG_BYTE (x), GET_MODE (x)))
-       return base + subreg_regno_offset (REGNO (SUBREG_REG (x)),
-                                          GET_MODE (SUBREG_REG (x)),
-                                          SUBREG_BYTE (x), GET_MODE (x));
+         && base < FIRST_PSEUDO_REGISTER)
+       {
+         struct subreg_info info;
+
+         subreg_get_info (REGNO (SUBREG_REG (x)),
+                          GET_MODE (SUBREG_REG (x)),
+                          SUBREG_BYTE (x), GET_MODE (x), &info);
+
+         if (info.representable_p)
+           return base + info.offset;
+       }
     }
   return -1;
 }