diff options
author | Marcus Shawcroft <marcus.shawcroft@arm.com> | 2014-06-05 12:22:07 +0000 |
---|---|---|
committer | Marcus Shawcroft <mshawcroft@gcc.gnu.org> | 2014-06-05 12:22:07 +0000 |
commit | 97826595b521a73a5557d110c366e3df78c57f69 (patch) | |
tree | 03ae604fd83f1b5e9b676fc2a86c14aa7f63204e | |
parent | 8799637aad7dbb838f262ce23f34ddd457a7ee99 (diff) | |
download | gcc-97826595b521a73a5557d110c366e3df78c57f69.zip gcc-97826595b521a73a5557d110c366e3df78c57f69.tar.gz gcc-97826595b521a73a5557d110c366e3df78c57f69.tar.bz2 |
[AArch64] Restructure callee save slot allocation logic.
Co-Authored-By: Jiong Wang <jiong.wang@arm.com>
From-SVN: r211271
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 22 |
2 files changed, 20 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dccab5e..777eb25 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,11 @@ 2014-06-05 Marcus Shawcroft <marcus.shawcroft@arm.com> + Jiong Wang <jiong.wang@arm.com> + + * config/aarch64/aarch64.c (SLOT_NOT_REQUIRED, SLOT_REQUIRED): Define. + (aarch64_layout_frame): Use SLOT_NOT_REQUIRED and SLOT_REQUIRED. + (aarch64_register_saved_on_entry): Adjust test. + +2014-06-05 Marcus Shawcroft <marcus.shawcroft@arm.com> * config/aarch64/aarch64.h (machine_function): Move saved_varargs_size from here... diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 80530c6..a58d93f 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -1812,28 +1812,32 @@ aarch64_layout_frame (void) if (reload_completed && cfun->machine->frame.laid_out) return; +#define SLOT_NOT_REQUIRED (-2) +#define SLOT_REQUIRED (-1) + /* First mark all the registers that really need to be saved... */ for (regno = R0_REGNUM; regno <= R30_REGNUM; regno++) - cfun->machine->frame.reg_offset[regno] = -1; + cfun->machine->frame.reg_offset[regno] = SLOT_NOT_REQUIRED; for (regno = V0_REGNUM; regno <= V31_REGNUM; regno++) - cfun->machine->frame.reg_offset[regno] = -1; + cfun->machine->frame.reg_offset[regno] = SLOT_NOT_REQUIRED; /* ... that includes the eh data registers (if needed)... */ if (crtl->calls_eh_return) for (regno = 0; EH_RETURN_DATA_REGNO (regno) != INVALID_REGNUM; regno++) - cfun->machine->frame.reg_offset[EH_RETURN_DATA_REGNO (regno)] = 0; + cfun->machine->frame.reg_offset[EH_RETURN_DATA_REGNO (regno)] + = SLOT_REQUIRED; /* ... and any callee saved register that dataflow says is live. */ for (regno = R0_REGNUM; regno <= R30_REGNUM; regno++) if (df_regs_ever_live_p (regno) && !call_used_regs[regno]) - cfun->machine->frame.reg_offset[regno] = 0; + cfun->machine->frame.reg_offset[regno] = SLOT_REQUIRED; for (regno = V0_REGNUM; regno <= V31_REGNUM; regno++) if (df_regs_ever_live_p (regno) && !call_used_regs[regno]) - cfun->machine->frame.reg_offset[regno] = 0; + cfun->machine->frame.reg_offset[regno] = SLOT_REQUIRED; if (frame_pointer_needed) { @@ -1844,14 +1848,14 @@ aarch64_layout_frame (void) /* Now assign stack slots for them. */ for (regno = R0_REGNUM; regno <= R28_REGNUM; regno++) - if (cfun->machine->frame.reg_offset[regno] != -1) + if (cfun->machine->frame.reg_offset[regno] == SLOT_REQUIRED) { cfun->machine->frame.reg_offset[regno] = offset; offset += UNITS_PER_WORD; } for (regno = V0_REGNUM; regno <= V31_REGNUM; regno++) - if (cfun->machine->frame.reg_offset[regno] != -1) + if (cfun->machine->frame.reg_offset[regno] == SLOT_REQUIRED) { cfun->machine->frame.reg_offset[regno] = offset; offset += UNITS_PER_WORD; @@ -1863,7 +1867,7 @@ aarch64_layout_frame (void) offset += UNITS_PER_WORD; } - if (cfun->machine->frame.reg_offset[R30_REGNUM] != -1) + if (cfun->machine->frame.reg_offset[R30_REGNUM] == SLOT_REQUIRED) { cfun->machine->frame.reg_offset[R30_REGNUM] = offset; offset += UNITS_PER_WORD; @@ -1896,7 +1900,7 @@ aarch64_set_frame_expr (rtx frame_pattern) static bool aarch64_register_saved_on_entry (int regno) { - return cfun->machine->frame.reg_offset[regno] != -1; + return cfun->machine->frame.reg_offset[regno] >= 0; } |