[Bug c++/115944] Incorrect code generation with -Og

2024-07-15 Thread blarsen at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115944 Guinevere Larsen changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/115944] Incorrect code generation with -Og

2024-07-15 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115944 --- Comment #5 from Jonathan Wakely --- With -fPIC GCC assumes that a different definition of the functions might be interposed later, so it emits a call (and assumes you're going to link to another object which provides a definition without und

[Bug c++/115944] Incorrect code generation with -Og

2024-07-15 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115944 --- Comment #4 from Sam James --- Ah, Jonathan beat me to it :)

[Bug c++/115944] Incorrect code generation with -Og

2024-07-15 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115944 Sam James changed: What|Removed |Added CC||sjames at gcc dot gnu.org --- Comment #3 fr

[Bug c++/115944] Incorrect code generation with -Og

2024-07-15 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115944 --- Comment #2 from Jonathan Wakely --- Dereferencing a null pointer has undefined behaviour, so the compiler can assume that function is never called. I don't think that's a bug.

[Bug c++/115944] Incorrect code generation with -Og

2024-07-15 Thread blarsen at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115944 Guinevere Larsen changed: What|Removed |Added Component|debug |c++ --- Comment #1 from Guinevere La