From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 46D883857830; Mon, 16 Aug 2021 00:30:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46D883857830 From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/101871] Array of strings of different length passed as an argument produces invalid result. Date: Mon, 16 Aug 2021 00:30:39 +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: 10.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Aug 2021 00:30:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101871 --- Comment #6 from Steve Kargl -= -- On Sun, Aug 15, 2021 at 07:21:42PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101871 >=20 > --- Comment #5 from anlauf at gcc dot gnu.org --- > In array.c:gfc_match_array_constructor there's the following code: >=20 > 1335 /* Walk the constructor, and if possible, do type conversio= n for > 1336 numeric types. */ > 1337 if (gfc_numeric_ts (&ts)) > 1338 { > 1339 m =3D walk_array_constructor (&ts, head); > 1340 if (m =3D=3D MATCH_ERROR) > 1341 return m; > 1342 } >=20 > Steve, you were the last one to work on this block. > It appears that non-numeric ts are not handled (here). > Can you give some insight? >=20 Unfortunately, I can't remember why it's confined to numeric types. I did the simply thing of commenting out the if-stmt and got an ICE. I also tried explicitly setting the typespec of each array element to the typespec of array constructor and that also ICE'd. I haven't had time to polk further. I think at some point the actual arg list is reduced to a formal argument list. This might loose the array constructor typespec when reducing/resolving the arg list.=