OSDN Git Service

2009-03-27 H.J. Lu <hongjiu.lu@intel.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Mar 2009 22:25:36 +0000 (22:25 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 Mar 2009 22:25:36 +0000 (22:25 +0000)
* jump.c (rtx_renumbered_equal_p): Use subreg_get_info.
(true_regnum): Likewise.

* rtlanal.c (subreg_info): Moved to ...
* rtl.h (subreg_info): Here.  New.
(subreg_get_info): New.

* rtlanal.c (subreg_get_info): Make it extern.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145134 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/jump.c
gcc/rtl.h
gcc/rtlanal.c

index d874d24..f4da0b9 100644 (file)
@@ -1,5 +1,16 @@
 2009-03-27  H.J. Lu  <hongjiu.lu@intel.com>
 
+       * jump.c (rtx_renumbered_equal_p): Use subreg_get_info.
+       (true_regnum): Likewise.
+
+       * rtlanal.c (subreg_info): Moved to ...
+       * rtl.h (subreg_info): Here.  New.
+       (subreg_get_info): New.
+
+       * rtlanal.c (subreg_get_info): Make it extern.
+
+2009-03-27  H.J. Lu  <hongjiu.lu@intel.com>
+
        PR target/39472
        * config/i386/i386.c (ix86_abi): New.
        (override_options): Handle -mabi=.
index 2b9a954..1189f81 100644 (file)
@@ -1536,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;
@@ -1552,15 +1553,12 @@ 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)))
+             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 = subreg_regno_offset (reg_renumber[reg_x],
-                                          GET_MODE (SUBREG_REG (x)),
-                                          byte_x,
-                                          GET_MODE (x));
+             reg_x = info.offset;
              byte_x = 0;
            }
        }
@@ -1578,15 +1576,12 @@ 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)))
+             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 = subreg_regno_offset (reg_renumber[reg_y],
-                                          GET_MODE (SUBREG_REG (y)),
-                                          byte_y,
-                                          GET_MODE (y));
+             reg_y = info.offset;
              byte_y = 0;
            }
        }
@@ -1728,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;
 }
index e8d42c8..bdb41d6 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1806,6 +1806,22 @@ extern rtx canonicalize_condition (rtx, rtx, int, rtx *, rtx, int, int);
    being made.  */
 extern rtx get_condition (rtx, rtx *, int, int);
 
+/* Information about a subreg of a hard register.  */
+struct subreg_info
+{
+  /* Offset of first hard register involved in the subreg.  */
+  int offset;
+  /* Number of hard registers involved in the subreg.  */
+  int nregs;
+  /* Whether this subreg can be represented as a hard reg with the new
+     mode.  */
+  bool representable_p;
+};
+
+extern void subreg_get_info (unsigned int, enum machine_mode,
+                            unsigned int, enum machine_mode,
+                            struct subreg_info *);
+
 /* lists.c */
 
 extern void free_EXPR_LIST_list                (rtx *);
index b35d774..73d3b08 100644 (file)
@@ -39,18 +39,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "df.h"
 #include "tree.h"
 
-/* Information about a subreg of a hard register.  */
-struct subreg_info
-{
-  /* Offset of first hard register involved in the subreg.  */
-  int offset;
-  /* Number of hard registers involved in the subreg.  */
-  int nregs;
-  /* Whether this subreg can be represented as a hard reg with the new
-     mode.  */
-  bool representable_p;
-};
-
 /* Forward declarations */
 static void set_of_1 (rtx, const_rtx, void *);
 static bool covers_regno_p (const_rtx, unsigned int);
@@ -58,9 +46,6 @@ static bool covers_regno_no_parallel_p (const_rtx, unsigned int);
 static int rtx_referenced_p_1 (rtx *, void *);
 static int computed_jump_p_1 (const_rtx);
 static void parms_set (rtx, const_rtx, void *);
-static void subreg_get_info (unsigned int, enum machine_mode,
-                            unsigned int, enum machine_mode,
-                            struct subreg_info *);
 
 static unsigned HOST_WIDE_INT cached_nonzero_bits (const_rtx, enum machine_mode,
                                                    const_rtx, enum machine_mode,
@@ -3090,7 +3075,7 @@ subreg_lsb (const_rtx x)
    offset - The byte offset.
    ymode  - The mode of a top level SUBREG (or what may become one).
    info   - Pointer to structure to fill in.  */
-static void
+void
 subreg_get_info (unsigned int xregno, enum machine_mode xmode,
                 unsigned int offset, enum machine_mode ymode,
                 struct subreg_info *info)