This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Restrict pointers
- From: Jim Wilson <wilson at specifixinc dot com>
- To: Jan Hoogerbrugge <hoogerbrugge at hotmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 11 Mar 2004 11:43:57 -0800
- Subject: Re: Restrict pointers
- References: <BAY9-F191lxACi32wfM00002ace@hotmail.com>
Jan Hoogerbrugge wrote:
As far as I know, memory references via two pointers where one of them
is a restrict pointer and the other pointer is not restricted and is not
derived from the first one are independent.
I believe the problem here is "derived from". If two pointers are both
restricted, then clearly they don't alias.
If one pointer is restricted, then you have to perform tests to
determine if the second pointer might be derived from the first. These
tests have not been implemented yet, and may be infeasible to implement
in the current alias analysis code. This is because the current code is
based on RTL, and RTL is so low level that it is very hard to track
pointer relationships.
It is probably more feasible to implement this in tree-ssa, where we
have more info about declarations and assignments. The derived from
test should be much more feasible there.
Compilers are allowed to ignore restrict, so there is no bug here. The
only problem is that we have a missed optimization, because we don't
have the infrastructure needed to implement the missed optimization.
tree-ssa probably helps with the infrastructure problem.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com