From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 23EE53858D38; Mon, 12 Jun 2023 10:38:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23EE53858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686566297; bh=sE8hC9iwis0x6qxswjP8h0GbP1ZJh2ll5XFzU6Mwl2s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=C7rSrEHK8pSS+aNg/koA1laWBbJJIjGEq/txuEahXLEBTJEGmFwgLyVYVCHYs5A74 XJyApN48gw5C8bv7OqRopr1HKqNtgSU7sGut0QVvu8IsJ0rg9kdAaxgVFXBd9RN+5e qd4v1SGv60v0TUCSQy2iCEpRVLHhDkfJ2cfQEsSs= From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/86277] Presence of optional arguments not recognized for zero length arrays Date: Mon, 12 Jun 2023 10:38:15 +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: 8.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: anlauf 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=3D86277 --- Comment #25 from Mikael Morin --- (In reply to Mikael Morin from comment #24) > (In reply to Mikael Morin from comment #23) > >=20 > > This regresses on pr108065.f90 (that's a few extra analyzer warnings), > > and on pr69955.f90 (that's one extra __builtin_malloc). >=20 > This removes the regressions. Not fully retested again. >=20 Comment #23 is probably the more correct one. Comment #24 works because of the double temporary. Even if the first tempo= rary has NULL data component, the second one uses malloc unconditionally to set data, and the argument is seen as present.=