This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, Fortran] PR45019 - Fix FE alias analysis for argument association
- From: Daniel Kraft <d at domob dot eu>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 22 Jul 2010 12:03:45 +0200
- Subject: Re: [Patch, Fortran] PR45019 - Fix FE alias analysis for argument association
- References: <4C4810B9.email@example.com>
Tobias Burnus wrote:
This fixes an alias analysis bug for argument association; if two
variables are both TARGET and (at least) one is a dummy (plus some other
constraints) then the variables might alias.
gfortran and five other compilers get this wrong, only three of my nine
tested compilers give the correct result: Sun, NAG and Cray.
The test case only checks the gfc_symbols_could_alias code path; I think
it should be possible to find a test case, which goes through
gfc_check_dependency, but I could not find one. (I have not tried
extensively.) If someone has (or wants to create) such a test case, I
would like to add it to the test suite.
Build and regtested on x86-64-linux.
OK for the trunk, 4.5 and 4.4? Does anyone care about 4.3?
As discussed on IRC, the patch is ok if you change
+ && (sym1->attr.dimension
+ || sym2->as->type == AS_ASSUMED_SHAPE))
+ || (sym2->attr.dummy && !sym2->attr.contiguous
+ && (sym2->attr.dimension
such that we have !sym1->attr.dimension and !sym2->attr.dimension here.
To go: Hea-Kni-Mon-Pri