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.