From ca4adc913ddcaca116b48569ec97c7c7841f2a35 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 6 Mar 2012 19:22:10 +0000 Subject: [PATCH] re PR middle-end/52372 (gcc.target/mips/mips16-attributes{,-4}.c SEGV in dwf_regno) gcc/ 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. From-SVN: r185013 --- gcc/ChangeLog | 11 +++++++++++ gcc/emit-rtl.c | 15 +++++++++++---- gcc/rtl.h | 15 +++++---------- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aee953e0484..3fa5e51649f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2012-03-06 Richard Sandiford + + 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 * config/m68k/m68k.h (ISA_HAS_TAS): New. diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index a95c14611c9..fd19fb6ace0 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -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); } /* Produce exact duplicate of insn INSN after AFTER. diff --git a/gcc/rtl.h b/gcc/rtl.h index b1b681be568..89c1be85424 100644 --- 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. */