This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR target/69454] Disable TARGET_STV when stack is not properly aligned
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Uros Bizjak <ubizjak at gmail dot com>, Ilya Enkovich <enkovich dot gnu at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 2 Feb 2016 05:17:24 -0800
- Subject: Re: [PATCH, PR target/69454] Disable TARGET_STV when stack is not properly aligned
- Authentication-results: sourceware.org; auth=none
- References: <CAMbmDYbGp6WxxCh0rKUsU+UD70KfR=8G8dNQbCegoSBanB3NRw at mail dot gmail dot com> <CAMe9rOrDbzVCRfkLFiCCbF80D3R2XyMm6REbSsTZGhjdfbP2fQ at mail dot gmail dot com> <CAMe9rOqywZwxDSO+9SyF8HoG=ai=26MMBnBGKPCvz_wxFhEB0g at mail dot gmail dot com> <CAMbmDYbkroApwkXDrvZbdCtMAJPrSZSmzxhRunc2TprKce4e0A at mail dot gmail dot com> <CAMe9rOodyrX36aFM=sv98+cvWskRdKnmJEdsvU6nQdRhs5UoCA at mail dot gmail dot com> <20160202115338 dot GP3017 at tucnak dot redhat dot com> <CAFULd4YKsOs6bdsOQ-P0HbU0NvDAS8asEdYUR3Yh=Fa5=0F53w at mail dot gmail dot com> <20160202122922 dot GQ3017 at tucnak dot redhat dot com> <CAMe9rOr4z3W6k=GrecTQPTJcdD_yZd4=9jA5R=768rS1NTuxcw at mail dot gmail dot com> <CAMe9rOq31Td2SJuaQBXGu-q36dgyDL2E+AUNwZJr+y6=RD+neA at mail dot gmail dot com> <20160202130947 dot GT3017 at tucnak dot redhat dot com>
On Tue, Feb 2, 2016 at 5:09 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, Feb 02, 2016 at 04:46:26AM -0800, H.J. Lu wrote:
>> >> So, is http://gcc.gnu.org/ml/gcc-patches/2016-01/msg02129.html
>> >> ok for trunk then (alone or with additional sorry, incremental or not?)?
>> >> I believe it does just that.
>> >
>> > This patch is WRONG.
>> >
>> > --
>> > H.J.
>>
>> You will run into the same ICE with
>>
>> -mincoming-stack-boundary=2 -msse2 -O2 -m32
>>
>> in a leaf function which needs DImode spill/fill.
>
> So are you arguing for changing
> + /* Disable STV if -mpreferred-stack-boundary=2 - the needed
> + stack realignment will be extra cost the pass doesn't take into
> + account and the pass can't realign the stack. */
> + if (ix86_preferred_stack_boundary < 64)
> + opts->x_target_flags &= ~MASK_STV;
> to
> + /* Disable STV if -m{preferred,incoming}-stack-boundary=2 - the needed
> + stack realignment will be extra cost the pass doesn't take into
> + account and the pass can't realign the stack. */
> + if (ix86_preferred_stack_boundary < 64
> + || ix86_incoming_stack_boundary < 64)
> + opts->x_target_flags &= ~MASK_STV;
> I'm fine with that.
>
There are many checks/asserts for stack alignment. At minimum,
we should assert STV is off in ix86_minimum_alignment before
returning 32 for DImode.
--
H.J.