From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 59A183858D28; Wed, 9 Nov 2022 22:28:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59A183858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668032915; bh=bkEl94DkfHD7N5TD0M+up1tBHgIgmYhVQ34at5WxQdM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CcqoeSVgvYttHIkcojLE3QyLb7XOoNNEs0/va4OCi7KZr8juqeXco32FtJOjz8yyj z/yr7iLZAO+hAHdR9c1hhZoh0ptXV4s0R0gmAM5ud2z8dbndgOofh6jBN7U71MkT/Q 5jH9RgB2NRIE+VM+CRR1rAF1LzKdAJuOa/2xNeXY= From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107595] [13 Regression] ICE in ix86_push_argument, at config/i386/i386.cc:4335 Date: Wed, 09 Nov 2022 22:28:35 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc keywords 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=3D107595 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org Keywords|ice-on-valid-code | --- Comment #2 from kargl at gcc dot gnu.org --- I've remove the ice-on-valid-code designation. Restore it if you believe otherwise. Allowing old style (aka nonstandard) initialization of variable declared with a user-defined derived type should be deprecated. There is no reason to avoid standard conforming code: type(t) x /t(4, null())/ type(t) :: x =3D t(4, null()) diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc index 0f9b2ced4c2..5627ea24245 100644 --- a/gcc/fortran/decl.cc +++ b/gcc/fortran/decl.cc @@ -2969,6 +2977,14 @@ variable_decl (int elem) goto cleanup; } + if (current_ts.type =3D=3D BT_DERIVED) + { + gfc_error ("Old style initialization incompatiable with a variabl= e " + "declared with a user-defined derived type at %C"); + m =3D MATCH_ERROR; + goto cleanup; + } + /* For structure components, read the initializer as a special expression and let the rest of this function apply the initializer as usual. */=