This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type based aliasing again
- To: Marcel Cox <Marcel dot Cox at cie dot etat dot lu>
- Subject: Re: type based aliasing again
- From: Bernd Schmidt <bernds at cygnus dot co dot uk>
- Date: Tue, 14 Sep 1999 14:50:45 +0100 (BST)
- cc: gcc at gcc dot gnu dot org, jbuck at synopsys dot COM, rms at gnu dot org
> I used the following test program with the following version of GCC:
> gcc version 2.96 19990912 (experimental) i486-pc-linux-gnu
>
> It showed that all union constructs were alias safe when compared to the
> plain typecast version
You can't show that something is safe this way. If your programs work, then
the compiler did not choose to take advantage of its aliasing information
for this input. That doesn't mean it won't do so for any other program. It
takes only one counterexample to show that the "cast to union" method is not
safe either, and such an example exists.
Bernd