[Bug c/67090] New: [5/6 Regression] O2/O3 optimizes values away when different type pointers are typecasted

2015-08-01 Thread davispuh at gmail dot com
Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: davispuh at gmail dot com Target Milestone: --- GCC 5.2.0 and also latest trunk 6.0 (compiled from git commit 9b6b471, svn r226241) using O2 or O3 generates invalid

[Bug c/67090] [5/6 Regression] O2/O3 optimizes values away when different type pointers are typecasted

2015-08-01 Thread davispuh at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67090 --- Comment #1 from Dāvis --- Created attachment 36105 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36105&action=edit Testcase

[Bug c/67090] [5/6 Regression] O2/O3 optimizes values away when different type pointers are typecasted

2015-08-01 Thread davispuh at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67090 --- Comment #3 from Dāvis --- (In reply to Andrew Pinski from comment #2) > This is such an obvious violation of aliasing rules in c/c++. > Use memcpy or an Union (gcc extension) to get around the it. You can use > -fno-strict-aliasing too. The