diff options
author | J"orn Rennecke <joern.rennecke@superh.com> | 2003-07-11 14:09:29 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2003-07-11 15:09:29 +0100 |
commit | fee226d25fc4af5f577cb05386e44e2dd0aa8fc6 (patch) | |
tree | 8b1d45a97235af5156928b537957c4c0a404a581 /gcc/regclass.c | |
parent | 7efa3e22e56fdd56b73deb940c47a5beac0b866e (diff) | |
download | gcc-fee226d25fc4af5f577cb05386e44e2dd0aa8fc6.tar.gz |
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
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r-- | gcc/regclass.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c index c24dfd4c952..46f8cb1a636 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; } |