diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2017-11-06 23:04:15 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2017-11-06 15:04:15 -0800 |
commit | 9f8760ed72603aa2abdbf5b83f74cc5737da2a43 (patch) | |
tree | df038db50d2574619f89cd2d3ac6d2d643462d51 /gcc/config | |
parent | 53d855e09df135ea735178521cc7c4cfbfb8a485 (diff) | |
download | gcc-9f8760ed72603aa2abdbf5b83f74cc5737da2a43.zip gcc-9f8760ed72603aa2abdbf5b83f74cc5737da2a43.tar.gz gcc-9f8760ed72603aa2abdbf5b83f74cc5737da2a43.tar.bz2 |
i386: Use reference of struct ix86_frame to avoid copy
When there is no need to make a copy of ix86_frame, we can use reference
of struct ix86_frame to avoid copy.
Tested on x86-64.
* config/i386/i386.c (ix86_can_use_return_insn_p): Use reference
of struct ix86_frame.
(ix86_initial_elimination_offset): Likewise.
(ix86_expand_split_stack_prologue): Likewise.
From-SVN: r254480
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i386/i386.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 0d5e272..1e2709d 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -10486,8 +10486,6 @@ symbolic_reference_mentioned_p (rtx op) bool ix86_can_use_return_insn_p (void) { - struct ix86_frame frame; - if (ix86_function_naked (current_function_decl)) return false; @@ -10502,7 +10500,7 @@ ix86_can_use_return_insn_p (void) if (crtl->args.pops_args && crtl->args.size >= 32768) return 0; - frame = cfun->machine->frame; + struct ix86_frame &frame = cfun->machine->frame; return (frame.stack_pointer_offset == UNITS_PER_WORD && (frame.nregs + frame.nsseregs) == 0); } @@ -10996,7 +10994,7 @@ ix86_can_eliminate (const int from, const int to) HOST_WIDE_INT ix86_initial_elimination_offset (int from, int to) { - struct ix86_frame frame = cfun->machine->frame; + struct ix86_frame &frame = cfun->machine->frame; if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM) return frame.hard_frame_pointer_offset; @@ -14334,7 +14332,6 @@ ix86_split_stack_guard (void) void ix86_expand_split_stack_prologue (void) { - struct ix86_frame frame; HOST_WIDE_INT allocate; unsigned HOST_WIDE_INT args_size; rtx_code_label *label; @@ -14346,7 +14343,7 @@ ix86_expand_split_stack_prologue (void) gcc_assert (flag_split_stack && reload_completed); ix86_finalize_stack_frame_flags (); - frame = cfun->machine->frame; + struct ix86_frame &frame = cfun->machine->frame; allocate = frame.stack_pointer_offset - INCOMING_FRAME_SP_OFFSET; /* This is the label we will branch to if we have enough stack |