You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This only happens with a noreturn function has stack arguments, which is rare for Linux. However for Win64, the caller must always reserve 32 bytes of stack space. Currently this bug doesn't happen on Win64, but I plan to make it stop setting TrapUnreachable, which will make it happen for all noreturn calls, and then it will matter.
The text was updated successfully, but these errors were encountered:
I think when you were working on r270109 we were measuring code size of i686-windows-msvc for chromium, which uses /Oy- to preserve frame pointers, so the stack frame was frequently not reserved, which avoided this case.
Extended Description
Here is my gnarly C test case to make this happen on Linux:
attribute((noreturn)) void exit_manyarg(int, int, int, int, int, int, int, int, int, int);
struct ByVal {
int vals[10];
};
struct ByVal getbyval();
void make_push_unprofitable(struct ByVal);
void bar();
extern int gv1, gv2, gv3, gv4, gv5, gv6, gv7, gv8, gv9, gv10;
int foo(int c) {
if (c)
exit_manyarg(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
make_push_unprofitable(getbyval());
make_push_unprofitable(getbyval());
make_push_unprofitable(getbyval());
return 0;
}
$ clang -S -O2 check.c --target=x86_64-linux -o - -fPIC
...
callq exit_manyarg@PLT
subq $32, %rsp
This only happens with a noreturn function has stack arguments, which is rare for Linux. However for Win64, the caller must always reserve 32 bytes of stack space. Currently this bug doesn't happen on Win64, but I plan to make it stop setting TrapUnreachable, which will make it happen for all noreturn calls, and then it will matter.
The text was updated successfully, but these errors were encountered: