This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: random thought - optimizer
- To: law at redhat dot com
- Subject: Re: random thought - optimizer
- From: Geert Bosch <bosch at gnat dot com>
- Date: Mon, 2 Jul 2001 11:14:49 -0400 (EDT)
- Cc: gcc at gcc dot gnu dot org
On Mon, 2 Jul 2001 law@redhat.com wrote:
The trick (of course) is proving the MEM is local and not aliased.
I think the front end should be responsible for setting an "aliased"
attribute if an object may be accessed through pointers. This attribute
can easily be set during semantic analysis, when no construct taking
the address of the object is found. Having such an attribute would
also be great for languages like Ada, where it is known that local
object cannot be accessed through pointers unless it is declared with
a special "aliased" keyword.
At the level of trees passed to the back end, and especially at RTL
level, there is no information anymore about "safe" pointer operations
generated by the front end, which do not cause objects to become non-local
or aliased.
In some cases dataflow analysis could prove potentially aliased objects
local and unaliased after all, but such extra analysis should be done
in addition to the initial classification done by the front end.
-Geert