https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104884
--- Comment #2 from zamfofex at twdb dot moe --- Isn’t it dangerous to allow the control to accidentally leak out of a function like that, though? If a function is written in a way that expects the compiler to not allow the control to leak out of the function and it is compiled with ‘-O3’, then that can lead to code being executed in unexpected situations, which feels like a fairly significant attack vector. Imagine e.g. the code in the executable immediately after the function definition contains some kind of secretive functionality, and the program is being run as some kind of server. That could allow attackers to exploit that compiler behavior in programs that use undefined behavior by accident.