This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/35200] [4.3 Regression] bogus aliasing warning
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Feb 2008 20:54:18 -0000
- Subject: [Bug tree-optimization/35200] [4.3 Regression] bogus aliasing warning
- References: <bug-35200-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from hjl dot tools at gmail dot com 2008-02-14 20:54 -------
(In reply to comment #5)
> Can you when you debug the function, please dump the VOPs also since then it
> should become obvious the issue.
>
> Anyways I don't think this an bogus warning and really I think this is a code
> issue.
>
> This is actually documented this way in fact unions cannot be used this way.
>
> That is you cannot do:
>
> float f(int a)
> {
> union {
> int i[1];
> float f[1];
> } g;
>
> int *d = g.i;
> float *f = g.f;
> *d = a;
> return *f;
> }
>
> -- Pinski
>
Where is this documented in ISO C?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35200