This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49076] ASSOCIATE: Array descriptor passed to explicit-shaped dummy
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 May 2011 22:06:27 +0000
- Subject: [Bug fortran/49076] ASSOCIATE: Array descriptor passed to explicit-shaped dummy
- Auto-submitted: auto-generated
- References: <bug-49076-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49076
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-20 21:50:25 UTC ---
If one places a break point in gfc_conv_array_parameter - which is called
during gfc_conv_procedure_call, one finds that "foo" is of type "AS_DEFERRED"
and not "AS_ASSUMED_SHAPE"; at the same time, it is not attr.allocatable, thus,
it is mishandled as one then enters:
/* Passing address of the array if it is not pointer or assumed-shape. */
if (full_array_var && g77 && !this_array_result)
[...]
if (!sym->attr.pointer
&& sym->as
&& sym->as->type != AS_ASSUMED_SHAPE
&& !sym->attr.allocatable)
{
[...]
else
se->expr = gfc_build_addr_expr (NULL_TREE, tmp);
I think one could simply mark it as AS_ASSUMED_SHAPE to get it properly
handled, even though usually only dummies are assumed-shape. Thus, one might
need to be a bit careful.
Alternatively, one could change the expr->ref from AR_FULL to AR_SECTION, but
that might be also tricky to get right.