From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C7C123858C2C; Sat, 24 Sep 2022 16:30:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7C123858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664037021; bh=/+duCQEEceONACTFHUQi0YO88nsqJTTivocdzX70Fv8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=U1mN6Ychyjm2dOnx1nYI/Gq1/UO5HWqIpPIxF1ba8Ch+l7xG/bgHHD9465xY4trg0 Kwk7eacDnCVWCsNXdaaMSPLokMpfWRldnR8xcCDciHNZs36S11BadH/jHnn/GaA7fF UMcDqlYJTx5nmhJ5XXg0EHes7EJ4Gb2+jhpFHX9k= From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107000] ICE in gfc_real2complex, at fortran/arith.cc:2243 Date: Sat, 24 Sep 2022 16:30:19 +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: ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW 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 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=3D107000 kargl at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kargl at gcc dot gnu.org --- Comment #4 from kargl at gcc dot gnu.org --- (In reply to anlauf from comment #3) > Created attachment 53601 [details] > Hackish patch >=20 > This patch fixes all ICE in comment#0 and comment#1. > However, it papers over the issue that we forget about > earlier errors: while >=20 > print *, [real :: -'1'] >=20 > is diagnosed for the invalid unary "-", >=20 > print *, 2 * [real :: -'1'] >=20 > will throw a different error. > So I'm not really happy with the hack. I think we need to expand the checking in array.cc /* Convert components of an array constructor to the type in ts. */ static match walk_array_constructor (gfc_typespec *ts, gfc_constructor_base head) I haven't had time to look deeper, but this function should be comparing the typespecs of REAL and -'1' or +'1'. That should fail. I suspect that the EXPR_OP of type_expr is allowing the array constructor walk to succeed.=