Commit 97b23853 by Geoffrey Keating Committed by Geoffrey Keating

rs6000.h (ELIMINABLE_REGS): Use RS6000_PIC_OFFSET_TABLE_REGNUM rather than hardcoding 30.

	* config/rs6000/rs6000.h (ELIMINABLE_REGS): Use
	RS6000_PIC_OFFSET_TABLE_REGNUM rather than hardcoding 30.
	(CAN_ELIMINATE): Likewise.
	(INITIAL_ELIMINATION_OFFSET): Likewise.
	(TOC_REGISTER): Likewise.

From-SVN: r57359
parent 46b33600
2002-09-20 Geoffrey Keating <geoffk@apple.com>
* config/rs6000/rs6000.h (ELIMINABLE_REGS): Use
RS6000_PIC_OFFSET_TABLE_REGNUM rather than hardcoding 30.
(CAN_ELIMINATE): Likewise.
(INITIAL_ELIMINATION_OFFSET): Likewise.
(TOC_REGISTER): Likewise.
2002-09-20 Richard Henderson <rth@redhat.com> 2002-09-20 Richard Henderson <rth@redhat.com>
* real.c (real_hash): New. * real.c (real_hash): New.
...@@ -1894,7 +1894,7 @@ typedef struct rs6000_args ...@@ -1894,7 +1894,7 @@ typedef struct rs6000_args
{{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \ { ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM}, \
{ 30, 30} } { RS6000_PIC_OFFSET_TABLE_REGNUM, RS6000_PIC_OFFSET_TABLE_REGNUM } }
/* Given FROM and TO register numbers, say whether this elimination is allowed. /* Given FROM and TO register numbers, say whether this elimination is allowed.
Frame pointer elimination is automatically handled. Frame pointer elimination is automatically handled.
...@@ -1905,10 +1905,11 @@ typedef struct rs6000_args ...@@ -1905,10 +1905,11 @@ typedef struct rs6000_args
We need r30 if -mminimal-toc was specified, and there are constant pool We need r30 if -mminimal-toc was specified, and there are constant pool
references. */ references. */
#define CAN_ELIMINATE(FROM, TO) \ #define CAN_ELIMINATE(FROM, TO) \
((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \ ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
? ! frame_pointer_needed \ ? ! frame_pointer_needed \
: (FROM) == 30 ? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0 \ : (FROM) == RS6000_PIC_OFFSET_TABLE_REGNUM \
? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0 \
: 1) : 1)
/* Define the offset between two registers, one to be eliminated, and the other /* Define the offset between two registers, one to be eliminated, and the other
...@@ -1923,7 +1924,7 @@ typedef struct rs6000_args ...@@ -1923,7 +1924,7 @@ typedef struct rs6000_args
(OFFSET) = info->total_size; \ (OFFSET) = info->total_size; \
else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \ else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
(OFFSET) = (info->push_p) ? info->total_size : 0; \ (OFFSET) = (info->push_p) ? info->total_size : 0; \
else if ((FROM) == 30) \ else if ((FROM) == RS6000_PIC_OFFSET_TABLE_REGNUM) \
(OFFSET) = 0; \ (OFFSET) = 0; \
else \ else \
abort (); \ abort (); \
...@@ -2188,7 +2189,7 @@ do { \ ...@@ -2188,7 +2189,7 @@ do { \
#define RS6000_PIC_OFFSET_TABLE_REGNUM 30 #define RS6000_PIC_OFFSET_TABLE_REGNUM 30
#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? RS6000_PIC_OFFSET_TABLE_REGNUM : INVALID_REGNUM) #define PIC_OFFSET_TABLE_REGNUM (flag_pic ? RS6000_PIC_OFFSET_TABLE_REGNUM : INVALID_REGNUM)
#define TOC_REGISTER (TARGET_MINIMAL_TOC ? 30 : 2) #define TOC_REGISTER (TARGET_MINIMAL_TOC ? RS6000_PIC_OFFSET_TABLE_REGNUM : 2)
/* Define this macro if the register defined by /* Define this macro if the register defined by
`PIC_OFFSET_TABLE_REGNUM' is clobbered by calls. Do not define `PIC_OFFSET_TABLE_REGNUM' is clobbered by calls. Do not define
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment