gcc/
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Mar 2012 19:22:10 +0000 (19:22 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Mar 2012 19:22:10 +0000 (19:22 +0000)
PR middle-end/52372
* rtl.h (pc_rtx, ret_rtx, simple_return_rtx, cc0_rtx): Redefine as
variables.
(GR_PC, GR_CC0, GR_RETURN, GR_SIMPLE_RETURN): Delete.
* emit-rtl.c (pc_rtx, ret_rtx, simple_return_rtx, cc0_rtx): New
variables.
(init_emit_regs): Move associated initialization to...
(init_emit_once): ...here.

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

gcc/ChangeLog
gcc/emit-rtl.c
gcc/rtl.h

index aee953e..3fa5e51 100644 (file)
@@ -1,3 +1,14 @@
+2012-03-06  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       PR middle-end/52372
+       * rtl.h (pc_rtx, ret_rtx, simple_return_rtx, cc0_rtx): Redefine as
+       variables.
+       (GR_PC, GR_CC0, GR_RETURN, GR_SIMPLE_RETURN): Delete.
+       * emit-rtl.c (pc_rtx, ret_rtx, simple_return_rtx, cc0_rtx): New
+       variables.
+       (init_emit_regs): Move associated initialization to...
+       (init_emit_once): ...here.
+
 2012-03-06  Richard Henderson  <rth@redhat.com>
 
        * config/m68k/m68k.h (ISA_HAS_TAS): New.
index a95c146..fd19fb6 100644 (file)
@@ -117,6 +117,12 @@ FIXED_VALUE_TYPE fconst1[MAX_FCONST1];
 
 rtx const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1];
 
+/* Standard pieces of rtx, to be substituted directly into things.  */
+rtx pc_rtx;
+rtx ret_rtx;
+rtx simple_return_rtx;
+rtx cc0_rtx;
+
 /* A hash table storing CONST_INTs whose absolute value is greater
    than MAX_SAVED_CONST_INT.  */
 
@@ -5536,10 +5542,6 @@ init_emit_regs (void)
   init_reg_modes_target ();
 
   /* Assign register numbers to the globally defined register rtx.  */
-  pc_rtx = gen_rtx_fmt_ (PC, VOIDmode);
-  ret_rtx = gen_rtx_fmt_ (RETURN, VOIDmode);
-  simple_return_rtx = gen_rtx_fmt_ (SIMPLE_RETURN, VOIDmode);
-  cc0_rtx = gen_rtx_fmt_ (CC0, VOIDmode);
   stack_pointer_rtx = gen_raw_REG (Pmode, STACK_POINTER_REGNUM);
   frame_pointer_rtx = gen_raw_REG (Pmode, FRAME_POINTER_REGNUM);
   hard_frame_pointer_rtx = gen_raw_REG (Pmode, HARD_FRAME_POINTER_REGNUM);
@@ -5855,6 +5857,11 @@ init_emit_once (void)
   const_tiny_rtx[0][(int) BImode] = const0_rtx;
   if (STORE_FLAG_VALUE == 1)
     const_tiny_rtx[1][(int) BImode] = const1_rtx;
+
+  pc_rtx = gen_rtx_fmt_ (PC, VOIDmode);
+  ret_rtx = gen_rtx_fmt_ (RETURN, VOIDmode);
+  simple_return_rtx = gen_rtx_fmt_ (SIMPLE_RETURN, VOIDmode);
+  cc0_rtx = gen_rtx_fmt_ (CC0, VOIDmode);
 }
 \f
 /* Produce exact duplicate of insn INSN after AFTER.
index b1b681b..89c1be8 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2089,6 +2089,11 @@ extern GTY(()) rtx const_tiny_rtx[4][(int) MAX_MACHINE_MODE];
 #define CONST2_RTX(MODE) (const_tiny_rtx[2][(int) (MODE)])
 #define CONSTM1_RTX(MODE) (const_tiny_rtx[3][(int) (MODE)])
 
+extern rtx pc_rtx;
+extern rtx cc0_rtx;
+extern rtx ret_rtx;
+extern rtx simple_return_rtx;
+
 /* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg
    is used to represent the frame pointer.  This is because the
    hard frame pointer and the automatic variables are separated by an amount
@@ -2112,10 +2117,6 @@ extern GTY(()) rtx const_tiny_rtx[4][(int) MAX_MACHINE_MODE];
 /* Index labels for global_rtl.  */
 enum global_rtl_index
 {
-  GR_PC,
-  GR_CC0,
-  GR_RETURN,
-  GR_SIMPLE_RETURN,
   GR_STACK_POINTER,
   GR_FRAME_POINTER,
 /* For register elimination to work properly these hard_frame_pointer_rtx,
@@ -2208,12 +2209,6 @@ extern struct target_rtl *this_target_rtl;
 #define mode_mem_attrs \
   (this_target_rtl->x_mode_mem_attrs)
 
-/* Standard pieces of rtx, to be substituted directly into things.  */
-#define pc_rtx                  (global_rtl[GR_PC])
-#define ret_rtx                 (global_rtl[GR_RETURN])
-#define simple_return_rtx       (global_rtl[GR_SIMPLE_RETURN])
-#define cc0_rtx                 (global_rtl[GR_CC0])
-
 /* All references to certain hard regs, except those created
    by allocating pseudo regs into them (when that's possible),
    go through these unique rtx objects.  */