From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1255F3858D37; Sat, 25 Jul 2020 09:18:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1255F3858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1595668687; bh=HEki1mr2IyuT7FMTtMXMuWc4ALkaHYdrya3ItjcZ8VM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KBLLl4Uu3/bvdNntkZD4iWlsPhkVp1dfnvi5BkErnRL1QQgJntczYPkqvGbfVb4ji A4FhToC+eLOk2IouZcd+Et+qHfB6y2lFKw7yQLxfgfeIQLFxvRYIuSPS0N3GidW5h5 140W57OXF485zwIcQaXjKut6jrEuPRM2ntbdUlKU= From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/96312] [10/11 Regression] Reallocation on assignment uses undefined variables Date: Sat, 25 Jul 2020 09:18:06 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tkoenig at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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: Sat, 25 Jul 2020 09:18:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96312 --- Comment #5 from Thomas Koenig --- (In reply to Thomas Koenig from comment #4) > so it is likely that this patch just started issuing a warning > for a pre-existing bug in the front end. That is indeed the case. Grepping for tmp in the modc.f90 dump yields struct array01_real(kind=3D4) tmp; tmp.data =3D 0B; tmp.dtype =3D {.elem_len=3D4, .rank=3D1, .type=3D3}; D.2309 =3D tmp; D.2310 =3D (real(kind=3D4)[0:] * restrict) tmp.data =3D=3D 0B; __builtin_free ((void *) tmp.data); tmp.data =3D D.2309.data; D.2311 =3D ((tmp.dim[0].lbound - D.2309.dim[0].lbound) - tmp.dim[0].ubound) + D.2309.dim[0].ubound !=3D 0; D.2313 =3D D.2312 ? 1 : tmp.dim[0].lbound; tmp.dim[0].lbound =3D D.2313; tmp.dim[0].ubound =3D D.2309.dim[0].ubound + D.2313; tmp.dim[0].stride =3D 1; tmp.offset =3D D.2314; D.2343 =3D (real(kind=3D4)[0:] * restrict) tmp.data; D.2344 =3D tmp.offset; D.2345 =3D tmp.dim[0].lbound; D.2346 =3D tmp.dim[0].ubound; if ((real(kind=3D4)[0:] * restrict) tmp.data !=3D 0B) __builtin_free ((void *) tmp.data); (real(kind=3D4)[0:] * restrict) tmp.data =3D 0B; so there is no way that tmp.dim[0].lbound would have gotten a value - previous version just didn't see it.=