This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/82365] stack locations are consolidated if noreturn function is on the path


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

--- Comment #3 from Arnd Bergmann <arnd at linaro dot org> ---
I tried replacing the call to a noreturn function with a
__builtin_unreachable() statement, same result.

However, adding an empty assembler statement before the noreturn statement or
the __builtin_unreachable() appears to work around the problem:

void __fortify_panic() __noreturn;
extern inline __attribute__((always_inline)) fortify_panic()
{
      asm volatile("");
      __fortify_panic();
}

I need to look at the resulting object code some more to see if that has other
downsides or if we can use that trick in the kernel to work around compilers
without a fix.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]