--- Comment #4 from rguenth at gcc dot gnu dot org 2006-04-11 10:33 ---
Oh, right. I was confused about 'char' and didn't see the alias violating.
*** This bug has been marked as a duplicate of 21920 ***
--
rguenth at gcc dot gnu dot org changed:
What|Removed
--- Comment #3 from pluto at agmk dot net 2006-04-11 10:03 ---
-O2 -fno-inline works (tested on x86-64).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27114
--- Comment #2 from falk at debian dot org 2006-04-11 09:40 ---
It seems to me that t.p, which is of type char*, is accessed via an lvalue
of type long. So this is undefined behavior. Or am I missing something?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27114
--- Comment #1 from rguenth at gcc dot gnu dot org 2006-04-11 08:28 ---
Confirmed. The following aborts with -O2 and works with -O, optimized tree
dumps are identical.
extern "C" void abort(void);
struct Test { char *p; };
inline void align(char* &p)
{
((long &)p) += 3;
((long