This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fortran OpenMP UDR fixes, nested handling fixes etc.


Jakub Jelinek wrote:
So, either we need something like the following patch (incremental), or
another possibility for the problem is not do the value.function.name
related change in module.c in the UDR patch, and instead fix up the UDR
combiner/initializer expressions when they are loaded from module
(change "" name to NULL only in the UDR combiner/initializer expressions,
where they shouldn't be resolved yet).  Or make sure value.function.name
is set to non-NULL when resolving all intrinsic function calls, rather than
just for a subset of them.

With this patch it seems to pass bootstrap/regtest.

I think your patch looks sufficiently sleek that I would go for it.

Tobias


2014-06-21  Jakub Jelinek  <jakub@redhat.com>

	* resolve.c (resolve_function): If value.function.isym is non-NULL,
	consider it already resolved.
	* module.c (fix_mio_expr): Likewise.
	* trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Don't
	initialize value.function.isym.

--- gcc/fortran/resolve.c.jj	2014-06-20 23:31:49.000000000 +0200
+++ gcc/fortran/resolve.c	2014-06-21 20:07:39.708099045 +0200
@@ -2887,7 +2887,8 @@ resolve_function (gfc_expr *expr)
/* See if function is already resolved. */ - if (expr->value.function.name != NULL)
+  if (expr->value.function.name != NULL
+      || expr->value.function.isym != NULL)
      {
        if (expr->ts.type == BT_UNKNOWN)
  	expr->ts = sym->ts;
--- gcc/fortran/module.c.jj	2014-06-20 23:31:49.000000000 +0200
+++ gcc/fortran/module.c	2014-06-23 08:53:50.488662314 +0200
@@ -3173,7 +3173,8 @@ fix_mio_expr (gfc_expr *e)
  	  && !e->symtree->n.sym->attr.dummy)
  	e->symtree = ns_st;
      }
-  else if (e->expr_type == EXPR_FUNCTION && e->value.function.name)
+  else if (e->expr_type == EXPR_FUNCTION
+	   && (e->value.function.name || e->value.function.isym))
      {
        gfc_symbol *sym;
--- gcc/fortran/trans-openmp.c.jj 2014-06-20 23:31:49.000000000 +0200
+++ gcc/fortran/trans-openmp.c	2014-06-23 11:53:02.932495166 +0200
@@ -1417,7 +1417,6 @@ gfc_trans_omp_array_reduction_or_udr (tr
        e4->expr_type = EXPR_FUNCTION;
        e4->where = where;
        e4->symtree = symtree4;
-      e4->value.function.isym = gfc_find_function (iname);
        e4->value.function.actual = gfc_get_actual_arglist ();
        e4->value.function.actual->expr = e3;
        e4->value.function.actual->next = gfc_get_actual_arglist ();


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]