https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89561

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note that iff GCC could easily see "what you want" and see that some undefined
behavior rule contradicts this then from a QOI perspective GCC already tries
to do what you want.  The difficult thing is to detect what you want (from
inside generic analysis infrastructure).

For example GCC will not misoptimize

int i;

int main() { *(float *)&i = 0.0; return i; }

even if it could (because type-based alias rules make the code undefined)
because it sees the must-alias.

That is, -fundefined-behavior=XYZ is impossible besides making all undefined
behavior implementation-defined (there are many options to individually control
such thing already, like -fwrapv for example).

Reply via email to