[Bug fortran/99349] ICE in match_data_constant, at fortran/decl.c:426
anlauf at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 1 19:57:56 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99349
--- Comment #5 from anlauf at gcc dot gnu.org ---
(In reply to Steve Kargl from comment #4)
> The function is match_data_constant(), so we're looking for a
> constant. My patch simply removes the type checking as it is
> unimportant here, and a type mismatch between a data-object and
> data-value is checked elsewhere. I suspect my original code was
> being too cautious with type checks.
There's nothing wrong with being cautious. Currently, the only valid
parameter inquiries are %kind, %len, %re, %im. So checking for integer
or real makes sense.
Maybe, at some point in the future, gfc_match_rvalue() may be more strict
or differ in some way and handle the invalid decl in a different way.
That's why I think that keeping the type check may have some merit, even
if it is not clear which one.
> If your patch leads to a better error message(s), then by all
> means use your patch.
It's just a different error message (a syntax error instead of another one
that does not give better insight...).
More information about the Gcc-bugs
mailing list