OSDN Git Service

* regclass.c (choose_hard_reg_mode): Add third argument.
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jul 2003 14:09:29 +0000 (14:09 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Jul 2003 14:09:29 +0000 (14:09 +0000)
Changed all callers.
* rtl.h (choose_hard_reg_mode): Update declaration.
* dwarf2out.c (expand_builtin_init_dwarf_reg_sizes):
Take HARD_REGNO_CALL_PART_CLOBBERED into account.

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

gcc/ChangeLog
gcc/config/i386/i386.h
gcc/dwarf2out.c
gcc/regclass.c
gcc/regs.h
gcc/rtl.h

index c6b09e7..67ac6cb 100644 (file)
@@ -1,3 +1,11 @@
+2003-07-11  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * regclass.c (choose_hard_reg_mode): Add third argument.
+       Changed all callers.
+       * rtl.h (choose_hard_reg_mode): Update declaration.
+       * dwarf2out.c (expand_builtin_init_dwarf_reg_sizes):
+       Take HARD_REGNO_CALL_PART_CLOBBERED into account.
+
 2003-07-11  Geoffrey Keating  <geoffk@apple.com>
 
        * c-decl.c (finish_decl): Handle 'used' here...
index 343cfd1..86efe35 100644 (file)
@@ -1135,7 +1135,7 @@ do {                                                                      \
 #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE)                        \
   (CC_REGNO_P (REGNO) ? VOIDmode                                       \
    : (MODE) == VOIDmode && (NREGS) != 1 ? VOIDmode                     \
-   : (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS))      \
+   : (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS), false)\
    : (MODE) == HImode && !TARGET_PARTIAL_REG_STALL ? SImode            \
    : (MODE) == QImode && (REGNO) >= 4 && !TARGET_64BIT ? SImode        \
    : (MODE))
index 7537dd1..5ad605d 100644 (file)
@@ -448,8 +448,12 @@ expand_builtin_init_dwarf_reg_sizes (tree address)
     if (DWARF_FRAME_REGNUM (i) < DWARF_FRAME_REGISTERS)
       {
        HOST_WIDE_INT offset = DWARF_FRAME_REGNUM (i) * GET_MODE_SIZE (mode);
-       HOST_WIDE_INT size = GET_MODE_SIZE (reg_raw_mode[i]);
+       enum machine_mode save_mode = reg_raw_mode[i];
+       HOST_WIDE_INT size;
 
+       if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+         save_mode = choose_hard_reg_mode (i, 1, true);
+       size = GET_MODE_SIZE (save_mode);
        if (offset < 0)
          continue;
 
index c24dfd4..46f8cb1 100644 (file)
@@ -553,7 +553,7 @@ init_reg_modes (void)
 
   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
     {
-      reg_raw_mode[i] = choose_hard_reg_mode (i, 1);
+      reg_raw_mode[i] = choose_hard_reg_mode (i, 1, false);
 
       /* If we couldn't find a valid mode, just use the previous mode.
          ??? One situation in which we need to do this is on the mips where
@@ -653,11 +653,12 @@ memory_move_secondary_cost (enum machine_mode mode, enum reg_class class, int in
 #endif
 
 /* Return a machine mode that is legitimate for hard reg REGNO and large
-   enough to save nregs.  If we can't find one, return VOIDmode.  */
+   enough to save nregs.  If we can't find one, return VOIDmode.
+   If CALL_SAVED is true, only consider modes that are call saved.  */
 
 enum machine_mode
 choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
-                     unsigned int nregs)
+                     unsigned int nregs, bool call_saved)
 {
   unsigned int /* enum machine_mode */ m;
   enum machine_mode found_mode = VOIDmode, mode;
@@ -670,7 +671,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
        mode != VOIDmode;
        mode = GET_MODE_WIDER_MODE (mode))
     if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
-       && HARD_REGNO_MODE_OK (regno, mode))
+       && HARD_REGNO_MODE_OK (regno, mode)
+       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
       found_mode = mode;
 
   if (found_mode != VOIDmode)
@@ -680,7 +682,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
        mode != VOIDmode;
        mode = GET_MODE_WIDER_MODE (mode))
     if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
-       && HARD_REGNO_MODE_OK (regno, mode))
+       && HARD_REGNO_MODE_OK (regno, mode)
+       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
       found_mode = mode;
 
   if (found_mode != VOIDmode)
@@ -690,7 +693,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
        mode != VOIDmode;
        mode = GET_MODE_WIDER_MODE (mode))
     if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
-       && HARD_REGNO_MODE_OK (regno, mode))
+       && HARD_REGNO_MODE_OK (regno, mode)
+       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
       found_mode = mode;
 
   if (found_mode != VOIDmode)
@@ -700,7 +704,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
        mode != VOIDmode;
        mode = GET_MODE_WIDER_MODE (mode))
     if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
-       && HARD_REGNO_MODE_OK (regno, mode))
+       && HARD_REGNO_MODE_OK (regno, mode)
+       && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
       found_mode = mode;
 
   if (found_mode != VOIDmode)
@@ -711,7 +716,8 @@ choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
     {
       mode = (enum machine_mode) m;
       if ((unsigned) HARD_REGNO_NREGS (regno, mode) == nregs
-         && HARD_REGNO_MODE_OK (regno, mode))
+         && HARD_REGNO_MODE_OK (regno, mode)
+         && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
        return mode;
     }
 
index 2206fdc..b2aeb5f 100644 (file)
@@ -210,7 +210,7 @@ extern int caller_save_needed;
 /* Select a register mode required for caller save of hard regno REGNO.  */
 #ifndef HARD_REGNO_CALLER_SAVE_MODE
 #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE) \
-  choose_hard_reg_mode (REGNO, NREGS)
+  choose_hard_reg_mode (REGNO, NREGS, false)
 #endif
 
 /* Registers that get partially clobbered by a call in a given mode.
index 065e03c..bc9d5ee 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1602,7 +1602,8 @@ extern rtx avoid_constant_pool_reference (rtx);
 extern rtx gen_mem_addressof (rtx, tree, int);
 
 /* In regclass.c  */
-extern enum machine_mode choose_hard_reg_mode (unsigned int, unsigned int);
+extern enum machine_mode choose_hard_reg_mode (unsigned int, unsigned int,
+                                              bool);
 
 /* In emit-rtl.c  */
 extern rtx set_unique_reg_note (rtx, enum reg_note, rtx);