http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47796
qihua.dai at intel dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
--- Comment #3 from qihua.dai at intel dot com 2011-02-21 04:58:48 UTC ---
(In reply to comment #1)
> You are violating C/C++ aliasing rules:
> pData = (unsigned int *)pTmp;
> data = *pData;
> printf("data = 0x%x\n", data);
> You access a tmp_t via an unsigned int which is undefined.
If it's not a bug, why is there the different behavior for -O0 and -O2