[Bug middle-end/83215] C++: struct with char-array assumed to alias with everything
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 29 15:24:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83215
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenth at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
The key here is that "mytest" has alias-set zero. It has that because
aggregate copying of it has to transfer whatever is in 'buf'. But if "mytest"
has alias-set zero that means any component of it has that as well.
So this correctness fix is really tied to how we need to handle aggregate
copying
of structs.
I don't like that (and I simply blame the C++ standards commitee). It's a
really bad choice for optimization.
Note making the C++ FE do sth "special" for aggregate copying works only
sofar as the middle-end also sometimes generates such copying (argument
copying during inlining, etc).
More information about the Gcc-bugs
mailing list