http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47796
--- Comment #7 from qihua.dai at intel dot com 2011-02-21 13:02:41 UTC ---
Hi,
I used -Wall -O2. But no warning for this situation.
gcc will print strict-aliasing related warning.
struct tmp1_s tmp;
tmp.a = 0xc; // this code line is
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47796
qihua.dai at intel dot com changed:
What|Removed |Added
Status|RESOLVED|UNCONFIRMED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47796
qihua.dai at intel dot com changed:
What|Removed |Added
Status|RESOLVED|UNCONFIRMED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47796
--- Comment #2 from qihua.dai at intel dot com 2011-02-18 07:54:15 UTC ---
(In reply to comment #1)
> You are violating C/C++ aliasing rules:
> pData = (unsigned int *)pTmp;
> data = *pData;
> printf("data = 0x%x
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47796
Summary: The code to write to a bit_field data strucuture will
be removed unexpectedly with gcc 4.5.1 -O2 option
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: cr