Summary: | ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1120 | ||
---|---|---|---|
Product: | gcc | Reporter: | G. Steinmetz <gscfq> |
Component: | fortran | Assignee: | anlauf |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | anlauf |
Priority: | P3 | Keywords: | accepts-invalid, ice-on-invalid-code |
Version: | 9.0 | ||
Target Milestone: | 14.0 | ||
See Also: | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103258 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2023-05-31 00:00:00 |
Description
G. Steinmetz
2018-12-19 16:11:10 UTC
Detected : $ cat z2.f90 program p integer(len((c)) :: n end $ cat z5.f90 implicit none integer(len((c)) :: n end $ gfortran-9-20181216 -c z2.f90 -fimplicit-none z2.f90:2:14: 2 | integer(len((c)) :: n | 1 Error: Symbol 'c' at (1) has no IMPLICIT type Confirmed from at least 4.8 up to trunk (9.0). I'm testing the following patch: diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc index 1de2b231242..2162b62608a 100644 --- a/gcc/fortran/decl.cc +++ b/gcc/fortran/decl.cc @@ -3366,6 +3372,7 @@ close_brackets: else gfc_error ("Missing right parenthesis at %C"); m = MATCH_ERROR; + goto no_match; } else /* All tests passed. */ @@ -4716,6 +4723,9 @@ get_kind: return MATCH_ERROR; } + if (m == MATCH_ERROR) + return MATCH_ERROR; + /* Defer association of the KIND expression of function results until after USE and IMPORT statements. */ if ((gfc_current_state () == COMP_NONE && gfc_error_flag_test ()) The master branch has been updated by Harald Anlauf <anlauf@gcc.gnu.org>: https://gcc.gnu.org/g:ff8f45d20f9ea6acc99442ad29212d177f58e8fe commit r14-1477-gff8f45d20f9ea6acc99442ad29212d177f58e8fe Author: Harald Anlauf <anlauf@gmx.de> Date: Thu Jun 1 23:04:30 2023 +0200 Fortran: force error on bad KIND specifier [PR88552] gcc/fortran/ChangeLog: PR fortran/88552 * decl.cc (gfc_match_kind_spec): Use error path on missing right parenthesis. (gfc_match_decl_type_spec): Use error return when an error occurred during matching a KIND specifier. gcc/testsuite/ChangeLog: PR fortran/88552 * gfortran.dg/pr88552.f90: New test. Fixed for gcc-14. Closing. Thanks for the report! |