This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45019] Aliasing of TARGET dummy argument not detected correctly
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2010 16:32:02 -0000
- Subject: [Bug fortran/45019] Aliasing of TARGET dummy argument not detected correctly
- References: <bug-45019-16338@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from burnus at gcc dot gnu dot org 2010-07-21 16:32 -------
For completeness: In F2003, see Section 12.4.1.7 (3)(b) and in F95 see 12.4.1.6
(1)(c).
dependency.c's gfc_check_dependency is the place where a check needs to be
added. As pointerness is already checked, I think one can simply check for:
sym1 = expr1->symtree->n.sym;
sym2 = expr2->symtree->n.sym;
if (sym1.attr.target && sym2->attr.target
&& ((sym1->attr.dummy && !sym1->attr.contiguous
&& sym1->attr.dimension && sym2->as.type == AS_ASSUMED_SHAPE)
||(sym2->attr.dummy && !sym2->attr.contiguous
&& sym2->attr.dimension && sym2->as.type == AS_ASSUMED_SHAPE)
return 1;
Note: This is completely untested - neither compiled not thought about all
cases nor compiled.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45019