This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/5186: -O works; -O2 doesn't; partial assignment through cast to smaller type
- From: rth at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, tonyb at cybernetics dot com
- Date: 3 Apr 2002 09:48:17 -0000
- Subject: Re: optimization/5186: -O works; -O2 doesn't; partial assignment through cast to smaller type
- Reply-to: rth at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, tonyb at cybernetics dot com, gcc-gnats at gcc dot gnu dot org
Synopsis: -O works; -O2 doesn't; partial assignment through cast to smaller type
State-Changed-From-To: open->closed
State-Changed-By: rth
State-Changed-When: Wed Apr 3 01:48:17 2002
State-Changed-Why:
Not a bug. This code violates ISO C aliasing rules.
Use a union instead.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5186