https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115477
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Component|c |middle-end Status|UNCONFIRMED |RESOLVED --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- float y = number; i = * ( long * ) &y; This is undefined (not just because of aliasing reasons) because you are reading past the size of y here. If you use int, since `sizeof(int) == sizeof(float)` the code will be less undefined. Note if you used memcpy instead, the code would have been defined.