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

--- Comment #27 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Werner Zeh from comment #26)

> > Please note that at (*) RBP gets assigned the value of realigned RSP. At
> > (**) RSP gets assigned the value of RBP + 160, but RBP here holds the value
> > of realigned RSP. This will misaling the stack for follow-up POP
> > instructions.
> 
> the observed stack pointer alignment issues are not introduced by the
> proposed fix but were introduced by commit
> 074226d5aa86cd3de517014acfe34c7f69a2ccc7. It is even worse because the RSP
> restoration happens on base of RBP but RBP was aligned already earlier. This
> means the subsequent POP operations can only succeed if the initial RSP
> value was already aligned.

This is g:074226d5aa86cd3de517014acfe34c7f69a2ccc7

author  Eric Botcazou <[email protected]>   2021-03-01 07:53:05 +0100

gcc/
        PR target/99234
        * config/i386/i386.c (ix86_compute_frame_layout): For a SEH target,
        point the hard frame pointer to the SSE register save area instead
        of the general register save area.  Perform only minimal adjustment
        for small frames if it is initially not correctly aligned.
        (ix86_expand_prologue): Remove early saves for a SEH target.
        * config/i386/winnt.c (struct seh_frame_state): Document constraint.
gcc/testsuite/
        * g++.dg/eh/seh-xmm-unwind.C: New test.

Reply via email to