This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: type based aliasing again


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]