]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rtl.def (REG): Remove middle field.
authorRichard Sandiford <rdsandiford@googlemail.com>
Tue, 13 May 2014 10:38:38 +0000 (10:38 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Tue, 13 May 2014 10:38:38 +0000 (10:38 +0000)
gcc/
* rtl.def (REG): Remove middle field.
* rtl.h (rtx_def): Add orignal_regno to u2.
(ORIGINAL_REGNO): Use it instead of field 1.
(REG_ATTRS): Lower field index accordingly.
* gengtype.c (adjust_field_rtx_def): Remove handling of
ORIGINAL_REGNO.  Move REG_ATTRS index down.
* print-rtl.c (print_rtx): Move ORIGINAL_REGNO handling to the
code that prints the REGNO.

From-SVN: r210359

gcc/ChangeLog
gcc/gengtype.c
gcc/print-rtl.c
gcc/rtl.def
gcc/rtl.h

index 9634ae3d51144703a681af4e0ff2d99c4be6506c..217579eb62156eef1a259d035e3ffc857a87e628 100644 (file)
@@ -1,3 +1,14 @@
+2014-05-13  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * rtl.def (REG): Remove middle field.
+       * rtl.h (rtx_def): Add orignal_regno to u2.
+       (ORIGINAL_REGNO): Use it instead of field 1.
+       (REG_ATTRS): Lower field index accordingly.
+       * gengtype.c (adjust_field_rtx_def): Remove handling of
+       ORIGINAL_REGNO.  Move REG_ATTRS index down.
+       * print-rtl.c (print_rtx): Move ORIGINAL_REGNO handling to the
+       code that prints the REGNO.
+
 2014-05-13  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * print-rtl.c (print_rtx): Guard whole '0' block with ifndef
index 1c13eeaf7d49fc25721ca49990d886eea8cd089b..dca930f1280bc8f68a20153f6c2b3cb8e459802e 100644 (file)
@@ -1248,8 +1248,6 @@ adjust_field_rtx_def (type_p t, options_p ARG_UNUSED (opt))
              else if (i == DEBUG_EXPR && aindex == 0)
                t = tree_tp, subname = "rt_tree";
              else if (i == REG && aindex == 1)
-               t = scalar_tp, subname = "rt_int";
-             else if (i == REG && aindex == 2)
                t = reg_attrs_tp, subname = "rt_reg";
              else if (i == SCRATCH && aindex == 0)
                t = scalar_tp, subname = "rt_int";
index 64e54532aa4665d47778c63963d03722e4522b9f..cbffadaae689d228209d8cebc0602e49daed1564 100644 (file)
@@ -216,12 +216,7 @@ print_rtx (const_rtx in_rtx)
           that the field has several different valid contents.  */
       case '0':
 #ifndef GENERATOR_FILE
-       if (i == 1 && REG_P (in_rtx))
-         {
-           if (REGNO (in_rtx) != ORIGINAL_REGNO (in_rtx))
-             fprintf (outfile, " [%d]", ORIGINAL_REGNO (in_rtx));
-         }
-       else if (i == 1 && GET_CODE (in_rtx) == SYMBOL_REF)
+       if (i == 1 && GET_CODE (in_rtx) == SYMBOL_REF)
          {
            int flags = SYMBOL_REF_FLAGS (in_rtx);
            if (flags)
@@ -491,6 +486,8 @@ print_rtx (const_rtx in_rtx)
                           REG_OFFSET (in_rtx));
                fputs (" ]", outfile);
              }
+           if (REG_P (in_rtx) && REGNO (in_rtx) != ORIGINAL_REGNO (in_rtx))
+             fprintf (outfile, " [%d]", ORIGINAL_REGNO (in_rtx));
 #endif
 
            if (is_insn && &INSN_CODE (in_rtx) == &XINT (in_rtx, i)
index 2d7847d415732d4e9beee4a5bdecad1f634f3156..19a0fa173b8f656f7449769e1fa2681b3d1749e3 100644 (file)
@@ -378,12 +378,10 @@ DEF_RTL_EXPR(PC, "pc", "", RTX_OBJ)
 /* A register.  The "operand" is the register number, accessed with
    the REGNO macro.  If this number is less than FIRST_PSEUDO_REGISTER
    than a hardware register is being referred to.  The second operand
-   holds the original register number - this will be different for a
-   pseudo register that got turned into a hard register.  The third
-   operand points to a reg_attrs structure.
+   points to a reg_attrs structure.
    This rtx needs to have as many (or more) fields as a MEM, since we
    can change REG rtx's into MEMs during reload.  */
-DEF_RTL_EXPR(REG, "reg", "i00", RTX_OBJ)
+DEF_RTL_EXPR(REG, "reg", "i0", RTX_OBJ)
 
 /* A scratch register.  This represents a register used only within a
    single insn.  It will be turned into a REG during register allocation
index 8a93ae1fb2b2bcf6db7ab09214d7be3a89eb0a80..487bfd08538eef223063e4c831b701473ad8f70f 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -352,6 +352,9 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"),
        layout for that case and use the gap for extra code-specific
        information.  */
 
+    /* The ORIGINAL_REGNO of a REG.  */
+    unsigned int original_regno;
+
     /* In a CONST_WIDE_INT (aka hwivec_def), this is the number of
        HOST_WIDE_INTs in the hwivec_def.  */
     unsigned int num_elem;
@@ -1194,7 +1197,8 @@ enum label_kind
 /* ORIGINAL_REGNO holds the number the register originally had; for a
    pseudo register turned into a hard reg this will hold the old pseudo
    register number.  */
-#define ORIGINAL_REGNO(RTX) X0UINT (RTX, 1)
+#define ORIGINAL_REGNO(RTX) \
+  (RTL_FLAG_CHECK1 ("ORIGINAL_REGNO", (RTX), REG)->u2.original_regno)
 
 /* Force the REGNO macro to only be used on the lhs.  */
 static inline unsigned int
@@ -1641,7 +1645,7 @@ do {                                                                      \
 
 /* The register attribute block.  We provide access macros for each value
    in the block and provide defaults if none specified.  */
-#define REG_ATTRS(RTX) X0REGATTR (RTX, 2)
+#define REG_ATTRS(RTX) X0REGATTR (RTX, 1)
 
 #ifndef GENERATOR_FILE
 /* For a MEM rtx, the alias set.  If 0, this MEM is not in any alias