This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Wrong RTL instruction deleted
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Uros Bizjak <uros at kss-loka dot si>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 27 Dec 2004 12:01:19 +0100
- Subject: Re: Wrong RTL instruction deleted
- References: <41CFC09C.5020302@kss-loka.si>
- Reply-to: Richard Guenther <richard dot guenther at gmail dot com>
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.