diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2019-06-14 16:24:56 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2019-06-14 09:24:56 -0700 |
commit | 957ed7386177e7d5da6b2908ec576906b784c892 (patch) | |
tree | 35f27a49da3ff03bcfef1dce5de62f8d966ed6d5 /gcc/function.c | |
parent | 84d38abbc982db405cfe7a45ed53c64745da5511 (diff) | |
download | gcc-957ed7386177e7d5da6b2908ec576906b784c892.zip gcc-957ed7386177e7d5da6b2908ec576906b784c892.tar.gz gcc-957ed7386177e7d5da6b2908ec576906b784c892.tar.bz2 |
Update preferred_stack_boundary only when expanding function call
locate_and_pad_parm is called when expanding function call from
initialize_argument_information and when generating function body
from assign_parm_find_entry_rtl:
/* Remember if the outgoing parameter requires extra alignment on the
calling function side. */
if (crtl->stack_alignment_needed < boundary)
crtl->stack_alignment_needed = boundary;
if (crtl->preferred_stack_boundary < boundary)
crtl->preferred_stack_boundary = boundary;
stack_alignment_needed and preferred_stack_boundary should be updated
only when expanding function call, not when generating function body.
Add update_stack_alignment_for_call to update stack alignment when
outgoing parameter is passed in the stack.
gcc/
PR rtl-optimization/90765
* calls.c (update_stack_alignment_for_call): New function.
(expand_call): Call update_stack_alignment_for_call when
outgoing parameter is passed in the stack.
(emit_library_call_value_1): Likewise.
* function.c (locate_and_pad_parm): Don't update
stack_alignment_needed and preferred_stack_boundary.
gcc/testsuite/
PR rtl-optimization/90765
* gcc.target/i386/pr90765-1.c: New test.
* gcc.target/i386/pr90765-2.c: Likewise.
From-SVN: r272296
Diffstat (limited to 'gcc/function.c')
-rw-r--r-- | gcc/function.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/gcc/function.c b/gcc/function.c index e30ee25..45b65dc 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4021,13 +4021,6 @@ locate_and_pad_parm (machine_mode passed_mode, tree type, int in_regs, } } - /* Remember if the outgoing parameter requires extra alignment on the - calling function side. */ - if (crtl->stack_alignment_needed < boundary) - crtl->stack_alignment_needed = boundary; - if (crtl->preferred_stack_boundary < boundary) - crtl->preferred_stack_boundary = boundary; - if (ARGS_GROW_DOWNWARD) { locate->slot_offset.constant = -initial_offset_ptr->constant; |