https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83330

--- Comment #8 from hjl at gcc dot gnu.org <hjl at gcc dot gnu.org> ---
Author: hjl
Date: Mon Jan 15 16:13:23 2018
New Revision: 256703

URL: https://gcc.gnu.org/viewcvs?rev=256703&root=gcc&view=rev
Log:
i386: Align stack frame if argument is passed on stack

When a function call is removed, it may become a leaf function.  But if
argument may be passed on stack, we need to align the stack frame when
there is no tail call.

Tested on Linux/i686 and Linux/x86-64.

gcc/

        Backport from mainline
        PR target/83330
        * config/i386/i386.c (ix86_function_arg_advance): Set
        outgoing_args_on_stack to true if there are outgoing arguments
        on stack.
        (ix86_function_arg): Likewise.
        (ix86_compute_frame_layout): Align stack frame if argument is
        passed on stack.
        * config/i386/i386.h (machine_function): Add
        outgoing_args_on_stack.

gcc/testsuite/

        Backport from mainline
        PR target/83330
        * gcc.target/i386/pr83330.c: New test.

Added:
    branches/gcc-7-branch/gcc/testsuite/gcc.target/i386/pr83330.c
Modified:
    branches/gcc-7-branch/gcc/ChangeLog
    branches/gcc-7-branch/gcc/config/i386/i386.c
    branches/gcc-7-branch/gcc/config/i386/i386.h
    branches/gcc-7-branch/gcc/testsuite/ChangeLog

Reply via email to