This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Pointer arithmetic rules in the tree optimizers?
- From: Diego Novillo <dnovillo at redhat dot com>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 17 Aug 2004 11:48:55 -0400
- Subject: Pointer arithmetic rules in the tree optimizers?
- Organization: Red Hat Canada
In trying to disentangle the notion of call-clobbering from aliasing,
I've run into a few oddities which I'm not sure how to deal with.
1. In testsuite/gfortran.fortran-torture/execute/forall_5.f90 we
are generating P = &VAR + R, where both P and R are of a pointer
type. Is that correct? In this case we were missing the fact
that 'P' points to 'VAR' because the alias analyzer was only
picking on 'R' and ignoring the other operand (assuming that it
should be an integer offset).
2. In cp/parser.c we are generating 'P = X + Y', where 'P' is of
pointer type, '+' is of pointer type. But *both* 'X' and 'Y'
are plain integers.
Before I go on trying to find where things are going wrong, I'd like to
confirm that these two cases are indeed a problem. For now, I've told
the alias analyzer to never assume anything about pointer arithmetic and
always look at both operands.
Thanks. Diego.