This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [Patch, fortran] Implementation of F2018 SELECT RANK


On Sat, Aug 31, 2019 at 09:56:52AM -0700, Steve Kargl wrote:
> 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.
> 

There's another gfc_error_now several lines down.  Does the
same early return apply there as well.

Also, found

Index: gcc/fortran/parse.c
===================================================================
*** gcc/fortran/parse.c (revision 275242)
--- gcc/fortran/parse.c (working copy)
+ 
+   /* At this point, we're got a nonempty select block.  */

s/we're/we've

-- 
Steve


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