aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ"orn Rennecke <joern.rennecke@superh.com>2003-07-11 14:09:29 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>2003-07-11 15:09:29 +0100
commitfee226d25fc4af5f577cb05386e44e2dd0aa8fc6 (patch)
tree8b1d45a97235af5156928b537957c4c0a404a581
parent7efa3e22e56fdd56b73deb940c47a5beac0b866e (diff)
downloadgcc-fee226d25fc4af5f577cb05386e44e2dd0aa8fc6.zip
gcc-fee226d25fc4af5f577cb05386e44e2dd0aa8fc6.tar.gz
gcc-fee226d25fc4af5f577cb05386e44e2dd0aa8fc6.tar.bz2
regclass.c (choose_hard_reg_mode): Add third argument.
* 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. From-SVN: r69234
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/i386/i386.h2
-rw-r--r--gcc/dwarf2out.c6
-rw-r--r--gcc/regclass.c22
-rw-r--r--gcc/regs.h2
-rw-r--r--gcc/rtl.h3
6 files changed, 31 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c6b09e7..67ac6cb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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...
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 343cfd1..86efe35 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -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))
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 7537dd1..5ad605d 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -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;
diff --git a/gcc/regclass.c b/gcc/regclass.c
index c24dfd4..46f8cb1 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -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;
}
diff --git a/gcc/regs.h b/gcc/regs.h
index 2206fdc..b2aeb5f 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -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.
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 065e03c..bc9d5ee 100644
--- 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);