This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type based aliasing again
- To: jbuck at synopsys dot com
- Subject: Re: type based aliasing again
- From: Richard Stallman <rms at gnu dot org>
- Date: Fri, 10 Sep 1999 02:34:46 -0400
- CC: mark at codesourcery dot com, jbuck at synopsys dot com, gcc at gcc dot gnu dot org
- References: <199909090502.WAA24772@atrus.synopsys.com>
- Reply-to: rms at gnu dot org
But this is just the reverse of what happens now; since -O2 will do
more reordering than -O, we already have programs that work with -O
and don't work with -O2 because of type-based aliasing.
There may also be some that work now with -O2 and not with -O. I
don't know any examples, but if there are two instructions that could
be compiled in either order, it could be that -O chooses the order the
user doesn't want, and -O2 for random reasons chooses the order the
user does want.
In general, for any set of options, there will be a fairly large
number of cases of invalid aliasing that just happen to work,
because the optimizers decide not to do the possible optimizations
that could have changed the behavior.