This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/82365] stack locations are consolidated if noreturn function is on the path
- From: "arnd at linaro dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 02 Oct 2017 07:49:06 +0000
- Subject: [Bug middle-end/82365] stack locations are consolidated if noreturn function is on the path
- Auto-submitted: auto-generated
- References: <bug-82365-4@http.gcc.gnu.org/bugzilla/>
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.