This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/66089] [6 Regression] elemental dependency mishandling when derived types are involved
- From: "vehre at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 May 2015 03:53:00 +0000
- Subject: [Bug fortran/66089] [6 Regression] elemental dependency mishandling when derived types are involved
- Auto-submitted: auto-generated
- References: <bug-66089-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66089
--- Comment #9 from vehre at gcc dot gnu.org ---
That was a rhetorical question.
In the patch you submitted in comment #2 could you put a comment (in the
source) at:
Index: trans-array.c
===================================================================
--- trans-array.c (rÃvision 222968)
+++ trans-array.c (copie de travail)
@@ -2451,7 +2451,8 @@ gfc_scalar_elemental_arg_saved_as_reference (gfc_s
@@ -4465,6 +4466,10 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop
nDepend = gfc_check_dependency (dest_expr, ss_expr, false);
<here>
+ if (ss->info->type == GFC_SS_REFERENCE
+ && gfc_check_dependency (dest_expr, ss_expr, false) == 1)
+ ss->info->data.scalar.need_temporary = 1;
+
continue;
}
what the reason for this check and set of the flag is? Now it is clear to us,
but in the future we might be wondering.
Furthermore is the flag name "need_temporary" correct here? I think, that it
should have the polymorphic nature of its existence in its name. Like
"non_polymorphic_temp" or the like.
I am still wondering whether there isn't a counterexample where this is not
working, i.e., we have lhs-rhs-dependency that is polymorphic. But because
assignment to (allocatable) polymorphic entities is not allowed, I could not
come up with one.