[patch, fortran] PR43851 match_stopcode cleanup

Tobias Burnus burnus@net-b.de
Sat May 22 23:41:00 GMT 2010


Jerry DeLisle worte:
> Attached patch is self explanatory and adds some checks and does some
> clean up. I have not found an easy way to check for parameters.
Me neither - already "gfc_match_expr" does "too much" simplification.

> One thing we could do is put all the new stuff behind f2008 and
> restore the older matching of digits with F95.  I am not sure it gains
> much to do so though.
I think this is not needed.

> Regression tested on x86-64.
> OK for trunk?

OK and thanks for the patch. However, I think the check

+      if (!gfc_is_constant_expr(e))

is unreachable as

+      m = gfc_match_init_expr (&e);

should already take case of this. Can you construct an example, where
"!gfc_is_constant_expr(e)" is true and thus your error is printed?

Tobias

> 2010-05-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
>
>     PR fortran/43851
>     * match.c (gfc_match_stopcode): Use gfc_match_init_expr. Go to
> cleanup
>     before returning MATCH_ERROR. Add check for scalar. Add check for
>     default integer kind. Use gfc_is_constant_expr.



More information about the Gcc-patches mailing list