Message ID | 5511E784.2010501@sfr.fr |
---|---|
State | New |
Headers | show |
Le 24/03/2015 23:39, Mikael Morin a écrit : > The patch I propose here adds a flag to remember the function has been > called, and skip it the second time. > I considered reusing the existing 'resolved' field, but I had to > slightly change its semantics to prevent regressing somewhere, and I was > not completely sure how safe that change was. > I have finally preferred this safer patch keeping the existing field > completely untouched. > > Regression tested on x86_64-unknown-linux-gnu. OK for trunk? > I have committed the patch as obvious as revision 221657. If someone is willing to debate about it, the discussion remains open. Mikael
Index: gfortran.h =================================================================== --- gfortran.h (révision 221586) +++ gfortran.h (copie de travail) @@ -1691,6 +1691,9 @@ typedef struct gfc_namespace Holds -1 during resolution. */ signed resolved:2; + /* Set when resolve_types has been called for this namespace. */ + unsigned types_resolved:1; + /* Set to 1 if code has been generated for this namespace. */ unsigned translated:1; Index: resolve.c =================================================================== --- resolve.c (révision 221586) +++ resolve.c (copie de travail) @@ -14942,6 +14942,9 @@ resolve_types (gfc_namespace *ns) gfc_equiv *eq; gfc_namespace* old_ns = gfc_current_ns; + if (ns->types_resolved) + return; + /* Check that all IMPLICIT types are ok. */ if (!ns->seen_implicit_none) { @@ -15016,6 +15019,8 @@ resolve_types (gfc_namespace *ns) gfc_resolve_omp_udrs (ns->omp_udr_root); + ns->types_resolved = 1; + gfc_current_ns = old_ns; }