RFR: 8302124: HotSpot Style Guide should permit noreturn attribute
Andrew Haley
aph at openjdk.org
Sun Feb 12 12:00:27 UTC 2023
On Sun, 12 Feb 2023 01:11:25 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> > I'd be careful. A call to an error routine marked noreturn can turn into a tail call (i.e. a jump) to it. That messes up backtraces.
>
> Explicitly not so for gcc. https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Function-Attributes.html#Common-Function-Attributes Under "noreturn" "In order to preserve backtraces, GCC will never turn calls to noreturn functions into tail calls." I don't know about other compilers, but I would think they would want to do something similar.
Mm, interesting. I see it's been like that for a while, but only recently has that been explicit in the docs. I think we'd want to check for other compilers.
-------------
PR: https://git.openjdk.org/jdk/pull/12507
More information about the hotspot-dev
mailing list