OSDN Git Service

* config/rs6000/rs6000.h (ELIMINABLE_REGS): Use
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Sep 2002 18:40:27 +0000 (18:40 +0000)
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Sep 2002 18:40:27 +0000 (18:40 +0000)
RS6000_PIC_OFFSET_TABLE_REGNUM rather than hardcoding 30.
(CAN_ELIMINATE): Likewise.
(INITIAL_ELIMINATION_OFFSET): Likewise.
(TOC_REGISTER): Likewise.

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

gcc/ChangeLog
gcc/config/rs6000/rs6000.h

index 53e5000..59da956 100644 (file)
@@ -1,3 +1,11 @@
+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>
 
        * real.c (real_hash): New.
index 80c365d..b3f1faa 100644 (file)
@@ -1894,7 +1894,7 @@ typedef struct rs6000_args
 {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},        \
  { ARG_POINTER_REGNUM, STACK_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.
    Frame pointer elimination is automatically handled.
@@ -1905,10 +1905,11 @@ typedef struct rs6000_args
    We need r30 if -mminimal-toc was specified, and there are constant pool
    references.  */
 
-#define CAN_ELIMINATE(FROM, TO)                                        \
- ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM \
-  ? ! frame_pointer_needed                                     \
-  : (FROM) == 30 ? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0 \
+#define CAN_ELIMINATE(FROM, TO)                                                \
+ ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM         \
+  ? ! frame_pointer_needed                                             \
+  : (FROM) == RS6000_PIC_OFFSET_TABLE_REGNUM                           \
+  ? ! TARGET_MINIMAL_TOC || TARGET_NO_TOC || get_pool_size () == 0     \
   : 1)
 
 /* Define the offset between two registers, one to be eliminated, and the other
@@ -1923,7 +1924,7 @@ typedef struct rs6000_args
    (OFFSET) = info->total_size;                                                \
  else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM)        \
    (OFFSET) = (info->push_p) ? info->total_size : 0;                   \
-  else if ((FROM) == 30)                                               \
+  else if ((FROM) == RS6000_PIC_OFFSET_TABLE_REGNUM)                   \
     (OFFSET) = 0;                                                      \
   else                                                                 \
     abort ();                                                          \
@@ -2188,7 +2189,7 @@ do {                                                                           \
 #define RS6000_PIC_OFFSET_TABLE_REGNUM 30
 #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
    `PIC_OFFSET_TABLE_REGNUM' is clobbered by calls.  Do not define