From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 914CC3858D32; Fri, 3 Nov 2023 15:56:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 914CC3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699027002; bh=Lp1KJRwJU+LaVKJbBjSe3xSg2dhsuu69VIE75a5csNs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KNCDvOj6Rw/Ki8IClDLODHrSuDhTSsOgcdD0KhZNbC7FCrKpmZh3TzH0Mnfiab6N6 /Hh+nvVdpRYS6wtrsk/uZLPvj8jN8eNylQajt0Au5VpoEZ/15uKj6kmIbwaCZThUU/ 5FiZGfX4ZfVZxe3cU5IspIOHiu/4b6vFE+Arwfpw= From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/112371] Wrong upper bound for the result of reduction intrinsics if the array is empty Date: Fri, 03 Nov 2023 15:56:42 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112371 --- Comment #3 from Mikael Morin --- Possible culprit: ifunction.m4 has this code: retarray->base_addr =3D xmallocarray (alloc_size, sizeof (rtype_name)= ); if (alloc_size =3D=3D 0) { /* Make sure we have a zero-sized array. */ GFC_DIMENSION_SET(retarray->dim[0], 0, -1, 1); return; }=