This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, gfortran] PR22304, 17917, 16511, 18870 and 23270 - modules,equivalences and commons - final(?) version
- From: Tobias SchlÃter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: Steven Bosscher <stevenb at suse dot de>, fortran at gcc dot gnu dot org,patch <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 08 Sep 2005 20:47:29 +0200
- Subject: Re: [Patch, gfortran] PR22304, 17917, 16511, 18870 and 23270 - modules,equivalences and commons - final(?) version
- References: <1124396183.4304ec973d049@www.cip.physik.uni-muenchen.de> <4306169A.3080609@physik.uni-muenchen.de> <43096E26.8060807@wanadoo.fr> <200508220828.13494.stevenb@suse.de> <431DD2D5.4070700@wanadoo.fr>
Paul Thomas wrote:
> *************** gfc_match_common (void)
> *** 2354,2361 ****
> --- 2355,2400 ----
...
> + gfc_error ("Symbol '%s', in COMMON block '%s' at "
> + "%C is being indirectly equivalenced to "
> + "another COMMON block '%s'"
> + , sym->name
> + , sym->common_head->name
> + , other->common_head->name);
Here and in gfc_match_equivalence, you show this peculiar way of arranging the
commas. Please put them on the preceding line.
> --- 2618,2633 ----
> goto syntax;
>
> set = eq;
> + common_flag = FALSE;
>
> for (;;)
> {
> ! m = gfc_match_equiv_variable (&set->expr, 1);
> if (m == MATCH_ERROR)
> goto cleanup;
> if (m == MATCH_NO)
> goto syntax;
> + m = gfc_match_variable (&set->expr, 1);
>
> for (ref = set->expr->ref; ref; ref = ref->next)
> if (ref->type == REF_ARRAY && ref->u.ar.type == AR_SECTION)
I believe the call to gfc_match_variable is an error. It looks like you're
allowing something like
EQUIVALENCE(A(5)B(3),C)
silently ignoring the syntax error, only adding b and c to the equivalence.
> *************** gfc_match_variable (gfc_expr ** result,
> *** 2258,2260 ****
> --- 2263,2278 ----
> *result = expr;
> return MATCH_YES;
> }
> +
> + match
> + gfc_match_variable (gfc_expr ** result, int equiv_flag)
> + {
> + return match_variable (result, equiv_flag, 1);
> + }
> +
> + match
> + gfc_match_equiv_variable (gfc_expr ** result, int equiv_flag)
> + {
> + return match_variable (result, equiv_flag, 0);
> + }
> +
I don't think having gfc_match_equiv_variable with a parameter "equiv_flag"
makes much sense. Either name the function gfc_match_local_variable (or
something which expresses "not host-associated" more clearly), if you think
there might be other uses for this function, or do away with equiv_flag, as it
will always be set.
Otherwise I think this patch is ok.
- Tobi