Fortran aliasing in tree-ssa-alias.c (may_alias_p).

Toon Moene toon@moene.indiv.nluug.nl
Sun Mar 19 11:13:00 GMT 2006


Diego Novillo wrote:

> On 03/11/06 07:51, Toon Moene wrote:

>>	* tree-ssa-alias.c (may_alias_p): if -fargument-noalias-global > 1,
>>	a pointer argument may not point to anything else.

> Well, that's not what the documentation states.  The pointer could be
> made to point to a local stack variable in the body of the function.  I
> realize that this may not happen in Fortran, but we are in a
> language-independent region of the code here.
> 
> I would propose adding flag_argument_noalias == 3 to convey what Fortran
> guarantees: Pointer arguments that cannot point to globals nor locals.
> Then you can do:
> 
> !   /* If -fargument-noalias-global is > 2, pointer arguments may
> !      not point to anything else.  */
> !   if (flag_argument_noalias > 2 && TREE_CODE (ptr) == PARM_DECL)
> 
> Not only here, but in other parts of alias.c.

OK, the attached patch is what I came up with.

There are two places where I left tests on flag_argument_noalias alone: 
in alias.c and emit-rtl.c.  I believe they are still correct as coded.

I tested this patch by a bootstrap (C and Fortran only), make -k 
check-fortran and a 9-cycle run of HIRLAM on x86_64-unknown-linux-gnu.

Of course, I'll do a complete bootstrap/make -k check on approval, but 
AFAICS, no other front end sets flag_argument_noalias.

Is this OK for mainline ?

Thanks in advance,

-- 
Toon Moene - e-mail: toon@moene.indiv.nluug.nl - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/
My next laptop will have a crank
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: alias-2.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060319/bf8eb2ae/attachment.ksh>


More information about the Gcc-patches mailing list