Wrong RTL instruction deleted
Richard Guenther
richard.guenther@gmail.com
Mon Dec 27 11:39:00 GMT 2004
On Mon, 27 Dec 2004 08:58:20 +0100, Uros Bizjak <uros@kss-loka.si> wrote:
> Hello!
>
> The testcase below produces different results when compiled with
> different optimization levels:
>
> --cut here--
> #include <stdio.h>
>
> float foo ()
> {
> unsigned int MASK = 0x80000000;
> return (float &) MASK;
> }
Isn't this invalid code wrt aliasing? Wouldn't you need to do
float foo()
{
union {
unsigned int MASK;
float f;
} u;
u.MASK = 0x80000000;
return u.f;
}
? But at least we are missing a warning for this.
More information about the Gcc
mailing list