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

--- Comment #28 from LIU Hao <lh_mouse at 126 dot com> ---
In addition to this issue, I notice that compiling
gcc/testsuite/g++.dg/eh/seh-xmm-unwind.C (with `exit (0);` deleted) with GCC
master now produces this in the end of main:

.L11:
        movups  xmm6, XMMWORD PTR 0[rbp]
        movups  xmm7, XMMWORD PTR 16[rbp]
        movups  xmm8, XMMWORD PTR 32[rbp]
        movups  xmm9, XMMWORD PTR 48[rbp]
        movups  xmm10, XMMWORD PTR 64[rbp]
        movups  xmm11, XMMWORD PTR 80[rbp]
        movups  xmm12, XMMWORD PTR 96[rbp]
        movups  xmm13, XMMWORD PTR 112[rbp]
        movups  xmm14, XMMWORD PTR 128[rbp]
        movups  xmm15, XMMWORD PTR 144[rbp]
        lea     rsp, 200[rsp]                 # <===============
        pop     rbx
        pop     rbp
        ret

`lea rsp, 200[rsp]` is prohibited: It must be either `add rsp, 200` or `lea
rsp, [rbp + 168]`.

(https://learn.microsoft.com/en-us/cpp/build/prolog-and-epilog?view=msvc-170#epilog-code)
> When a frame pointer is not used, the epilog must use `add RSP,constant`
> to deallocate the fixed part of the stack. It may not use
> `lea RSP,constant[RSP]` instead. This restriction exists so the unwind
> code has fewer patterns to recognize when searching for epilogs.

Reply via email to