[Patch, fortran] Implementation of F2018 SELECT RANK

Steve Kargl sgk@troutmask.apl.washington.edu
Sat Aug 31 17:23:00 GMT 2019


On Sat, Aug 31, 2019 at 04:59:03PM +0100, Paul Richard Thomas wrote:
> + 
> + /* Match a SELECT RANK statement.  */
> + 
> + match
> + gfc_match_select_rank (void)
> + {
> +   gfc_expr *expr1, *expr2 = NULL;
> +   match m;
> +   char name[GFC_MAX_SYMBOL_LEN];
> +   gfc_symbol *sym, *sym2;
> +   gfc_namespace *ns = gfc_current_ns;
> +   gfc_array_spec *as;

(snip)

> +       if (expr2->expr_type != EXPR_VARIABLE
> + 	  || !(as && as->type == AS_ASSUMED_RANK))
> + 	gfc_error_now ("The SELECT RANK selector at %C must be an assumed "
> + 		       "rank variable");

If an error occurs, should this set m = MATCH_ERROR and goto cleanup?
OR, set m = MATCH_ERROR, free expr1 and expr2 and return m?
IOW, if an error occurs, why should gfortran continue to match select rank?

Still looking at the remaining part of patch.

-- 
steve



More information about the Gcc-patches mailing list