From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8CBFC39DC4E0; Fri, 9 Apr 2021 18:10:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CBFC39DC4E0 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/47307] Uninitialized in this function: warning for initialized, no warning for uninitialized Date: Fri, 09 Apr 2021 18:10:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.6.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org 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: cf_reconfirmed_on cc 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: Fri, 09 Apr 2021 18:10:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D47307 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2017-12-30 00:00:00 |2021-4-9 CC| |msebor at gcc dot gnu.org --- Comment #6 from Martin Sebor --- The warning has disappeared at -O1 and above. The expected one for the uninitialized read from the lopt array is issued now but only at -O0. With optimization the read is eliminated. Given the large number of open bugs f= or -Wuninitialized (pr24639) I'm not sure it's worth keeping this open as well. $ gcc -O0 -S -Wall pr47307.f90=20 ../pr47307.f90:13:13: 13 | if ( lopt(j,i) < 0 ) then | ^ Warning: =E2=80=98lopt=E2=80=99 may be used uninitialized [-Wmaybe-uninitia= lized] ../pr47307.f90:8:34: 8 | integer, dimension(3,5) :: lopt | ^ note: =E2=80=98lopt=E2=80=99 declared here=