This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fortran OpenMP UDR fixes, nested handling fixes etc.
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Mon, 23 Jun 2014 12:39:53 +0200
- Subject: Re: Fortran OpenMP UDR fixes, nested handling fixes etc.
- Authentication-results: sourceware.org; auth=none
- References: <20140620165016 dot GC31640 at tucnak dot redhat dot com> <53A54239 dot 2010605 at net-b dot de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Jun 21, 2014 at 10:28:41AM +0200, Tobias Burnus wrote:
> Jakub Jelinek wrote:
> >Bootstrap/regtest pending, does this look ok?
>
> Except for the module/resolved issues discussed elsewhere, it look good to
> me.
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.
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 ();
Jakub