]> git.ipfire.org Git - thirdparty/gcc.git/commit
Update preferred_stack_boundary only when expanding function call
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Jun 2019 16:24:56 +0000 (16:24 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Jun 2019 16:24:56 +0000 (16:24 +0000)
commit2e24a52c0311ba7f65382be8115c7ca36bf2c49b
tree35f27a49da3ff03bcfef1dce5de62f8d966ed6d5
parent6bc936d3dfb950092c5ee24a197cc468ea70b55c
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@272296 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/calls.c
gcc/function.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr90765-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr90765-2.c [new file with mode: 0644]