From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B18C6384AB54; Thu, 18 Apr 2024 20:39:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B18C6384AB54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713472741; bh=t1ycW4lwscsFumPgMfFGpc1iyjoqCmbDegN9RXdS6BY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DG8cIMsNNt5JVzLOffAvBmbrLyyzKUhQ5kmoPHlWdDfvnjlR5zYD4InoLaLoXKm5G W0KFWokLo1KPI8Lu0VwIUCl3pOsxLfRGko4rQEOYeT9mf6YmpewLQsF7AFuzI/2hvz qwetHe6iOqHVph51TSNBuYwqSYuC6jv+U5k9m8BE= From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/103471] [11/12/13/14 Regression] ICE in gfc_typenode_for_spec, at fortran/trans-types.c:1114 Date: Thu, 18 Apr 2024 20:38:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103471 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gcc dot gnu.org --- Comment #7 from anlauf at gcc dot gnu.org --- (In reply to Paul Thomas from comment #6) > The current mainline and 13-branches now power through to the fatal error= at > trans-decl.cc:1800. True, but the location does not look nice: pr103471.f90:1:9: 1 | program p | 1 Fatal Error: k at (1) has no default type compilation terminated. With the following tentative - but otherwise untested - change: diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc index e160c5c98c1..602f35f0cab 100644 --- a/gcc/fortran/trans-decl.cc +++ b/gcc/fortran/trans-decl.cc @@ -1797,7 +1797,9 @@ gfc_get_symbol_decl (gfc_symbol * sym) } if (sym->ts.type =3D=3D BT_UNKNOWN) - gfc_fatal_error ("%s at %C has no default type", sym->name); +// gfc_fatal_error ("%s at %C has no default type", sym->name); + gfc_fatal_error ("%s at %L has no default type", sym->name, + &sym->declared_at); if (sym->attr.intrinsic) gfc_internal_error ("intrinsic variable which isn't a procedure"); we are back at: pr103471.f90:3:21: 3 | print *, [real(x(k))] | 1 Fatal Error: k at (1) has no default type compilation terminated. This looks more user friendly.=