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

--- Comment #2 from José Rui Faustino de Sousa <jrfsousa at gmail dot com> ---
Hi Thomas!

The fix to this problem seems to be simple:

diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index fdca9cc..9ad885b 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -6237,6 +6241,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
                      || gfc_expr_attr (e).allocatable)
                    set_dtype_for_unallocated (&parmse, e);
                  else if (e->expr_type == EXPR_VARIABLE
+                          && e->ref
+                          && e->ref->u.ar.type == AR_FULL
                           && e->symtree->n.sym->attr.dummy
                           && e->symtree->n.sym->as
                           && e->symtree->n.sym->as->type == AS_ASSUMED_SIZE)

If you look at the output of -fdump-tree-original of the example using pointers
and bind(c) it becomes clear that setting the last dimension upper bound to -1
to mark the array as assumed-size is the problem.

(That way to signal assumed-size arrays is also problematic)

But that change breaks the OpenMP tests and I did not look into it any further
at the time.

Best regards,
José Rui

Reply via email to