This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type based aliasing again
> The question that has been asked by a number of people is whether we
> can make some of the more "obvious" cases work correctly
I don't think we can draw a line that separates the ``obvious'' cases
from the non-obvious ones.
We do not need to draw a line. If we were implementing a new
feature, we might want one. But the goal here is to make SOME
of these cases work as the users intended. We do not want to tell
the users which cases these are, because we are not going to encourage
users to rely on them.
> The change is simply to postpone the type-based check until after the
> other analysis is done. If we detect that the references collide, but
> the types say that we can assume they don't, we issue a warning and
> then tell the compiler that there is aliasing.
I don't think this can detect cases in which pointers are passed into
functions.
You are right, it can't. But the change does its job pretty well anyway.