From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0306C3858D1E; Mon, 20 Feb 2023 23:46:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0306C3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676936815; bh=KUnQ6UTboeDXCdlxV6hckX9SLq7S2aoWlS0kzac7Afw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fq6lK7CzLCyQbMgQvyoeov+FSHDFetu0to5xNzC+VcqPwyWT/9DY941mtLbeq15yH tqPEaKevDFbu8RTNI6dL2APrqHO+hQsLlm4MAeEmGMJLO6QTEVDAUSf9QIZ5kJUY4h +bk1s7iT9KPH6XGYvqQVeAbBJ58JzFdIkHKbybDI= From: "jvdelisle at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107721] Lost typespec with constant expressions using array constructors and parentheses Date: Mon, 20 Feb 2023 23:46:53 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jvdelisle at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D107721 --- Comment #8 from Jerry DeLisle --- FWIW : I think the typespec is being lost because the initial call into gfc_match_array_constructor which finds and matches the typespec sets a loc= al variable seen_ts which is used later in that function to do the type conver= sion steps. However, before that happens a call from gfc_match_array_constructor into match_array_cons_element then results in a subsequent call to gfc_match_array_constructor where there is no typespec left to match. The l= ocal seen_ts is set to false so the conversion code does not get called. Killing parens does not fix any of this. I think what is needed is the see= n_ts needs to be passed down the call chain to preserve it during the match_array_cons_element process. My intuition tells me it would be better = if portions of this code are refactored little to avoid some of these recursive calls.=