[Bug c++/115944] Incorrect code generation with -Og
sjames at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 15 20:03:49 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115944
Sam James <sjames at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sjames at gcc dot gnu.org
--- Comment #3 from Sam James <sjames at gcc dot gnu.org> ---
I think the UB makes it hard here. I'll let someone else comment if the
expectation is reasonable, but optimize("O0") on MyClass::call() makes it work.
If you add a __builtin_abort() call underneath the dodgy assignment, it works
fine. Is there a reason you can't use that instead? (Why are we relying on a
segfault?)
More information about the Gcc-bugs
mailing list