This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] PR45019 - Fix FE alias analysis for argument association


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.

Yours,
Daniel

--
http://www.pro-vegan.info/
--
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]