https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61831

--- Comment #33 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Dear Paul,

> I cannot see yet, where it comes in nor when it was introduced.

Unfortunately I has been introduced by me, see comment 5. The code is

+  if (expr->ts.type == BT_DERIVED && expr->rank
+      && !gfc_is_finalizable (expr->ts.u.derived, NULL)
+      && expr->ts.u.derived->attr.alloc_comp
+      && expr->expr_type != EXPR_VARIABLE)
+    {
+      tree tmp;
+
+      tmp = build_fold_indirect_ref_loc (input_location, se->expr);
+      tmp = gfc_deallocate_alloc_comp (expr->ts.u.derived, tmp, expr->rank);
+      
+      /* The components shall be deallocated before
+         their containing entity.  */
+      gfc_prepend_expr_to_block (&se->post, tmp);
+    }

Question: what condition should be added to the 'if' to get a false for
'expr->expr_type == EXPR_ARRAY' and an elemental function?

Reply via email to