[Bug tree-optimization/92765] [10 Regression] Wrong code caused by folding of -Wstring-compare since r276773

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 18 08:14:00 GMT 2019


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

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
We explicitly document supporting type punning through unions as an extension,
so it is valid in C++ too.  And, what union member is active at which point
really doesn't matter for the testcases, e.g. in #c6 you could very well pass
the union address to bar too and store there to the union member you want
active afterwards (or have the union address in some global var from before the
function and do it in bar again).  The #c7 testcase doesn't contain any union. 
The #c10 testcase could be changes similarly to the #c6 one.


More information about the Gcc-bugs mailing list