This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH 3/4] aarch64: Tidy prologue local variables
- From: Richard Henderson <rth at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: marcus dot shawcroft at arm dot com, richard dot earnshaw at arm dot com
- Date: Fri, 22 Aug 2014 15:05:30 -0700
- Subject: [PATCH 3/4] aarch64: Tidy prologue local variables
- Authentication-results: sourceware.org; auth=none
- References: <1408745131-24297-1-git-send-email-rth at redhat dot com>
Don't continually re-read data from cfun->machine.
* config/aarch64/aarch64.c (aarch64_expand_prologue): Load
cfun->machine->frame.hard_fp_offset into a local variable.
---
gcc/config/aarch64/aarch64.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index dcca446..c890773 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -2194,18 +2194,18 @@ aarch64_expand_prologue (void)
*/
HOST_WIDE_INT frame_size, offset;
HOST_WIDE_INT fp_offset; /* Offset from hard FP to SP. */
+ HOST_WIDE_INT hard_fp_offset;
rtx insn;
aarch64_layout_frame ();
- if (flag_stack_usage_info)
- current_function_static_stack_size = cfun->machine->frame.frame_size;
-
frame_size = cfun->machine->frame.frame_size;
- offset = cfun->machine->frame.frame_size;
+ hard_fp_offset = cfun->machine->frame.hard_fp_offset;
+ offset = frame_size;
+ fp_offset = frame_size - hard_fp_offset;
- fp_offset = cfun->machine->frame.frame_size
- - cfun->machine->frame.hard_fp_offset;
+ if (flag_stack_usage_info)
+ current_function_static_stack_size = frame_size;
/* Store pairs and load pairs have a range only -512 to 504. */
if (offset >= 512)
@@ -2216,7 +2216,7 @@ aarch64_expand_prologue (void)
register area. This will allow the pre-index write-back
store pair instructions to be used for setting up the stack frame
efficiently. */
- offset = cfun->machine->frame.hard_fp_offset;
+ offset = hard_fp_offset;
if (offset >= 512)
offset = cfun->machine->frame.saved_regs_size;
--
1.8.3.1