From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DE33B3858D33; Mon, 12 Jun 2023 07:56:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE33B3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686556571; bh=SuLZZE51aMGO/TGFw4m/zWYyx6xzZRDgdkt3KTiT/D4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=i2HIsWULnDMYo38XeDC8IaY8Wm3wuFg9WfPj6SCK1B/HTq64VcuzBfPgvLuaxzcF7 +Zwh1k3aSVAafMkIopN+MyKQWNF3iwg2cKF6Qk9cbHnO4gBCShmyRpAoIGdCpNrud4 Z5amW4kFccVI0JG+CWs+DEhpd+l9WwtxVnuAjZ0U= 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 07:56:09 +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 #23 from Mikael Morin --- (In reply to Mikael Morin from comment #22) >=20 > diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc > index 1c7ea900ea1..cc1dddbeb33 100644 > --- a/gcc/fortran/trans-array.cc > +++ b/gcc/fortran/trans-array.cc > @@ -1117,7 +1117,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, > stmtblock_t * post, >=20=20 > desc =3D info->descriptor; > info->offset =3D gfc_index_zero_node; > - if (size =3D=3D NULL_TREE || integer_zerop (size)) > + if (size =3D=3D NULL_TREE) > { > /* A callee allocated array. */ > gfc_conv_descriptor_data_set (pre, desc, null_pointer_node); This regresses on pr108065.f90 (that's a few extra analyzer warnings), and on pr69955.f90 (that's one extra __builtin_malloc).=