From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22378 invoked by alias); 6 Jun 2014 12:27:45 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22159 invoked by uid 48); 6 Jun 2014 12:27:41 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/56574] False possibly uninitialized variable warning Date: Fri, 06 Jun 2014 12:27:00 -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.7.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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-SW-Source: 2014-06/txt/msg00471.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D56574 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #9 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Eric Botcazou from comment #8) > > ISO C99 6.5.13 says that 'value' is not evaluated when !flag is false. = But > > clearly we are not considering the "side-effect" of using an uninitiali= zed > > variable when deciding to output straight-line code sequences. >=20 > But evaluating an uninitialized variable is not a side-effect, unless > accessing the variable itself has a side-effect, so there is no wrong code > here. Perhaps the uninit pass can be taught that for a & b when a may be uninitialized is actually guarded by if(b!=3D0). I think this will fix the = bug here, no? >>From gcc-bugs-return-453390-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jun 06 14:12:01 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 30374 invoked by alias); 6 Jun 2014 14:12:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 30354 invoked by uid 48); 6 Jun 2014 14:11:57 -0000 From: "aladjev.andrew at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/61428] New: "maybe-uninitialized" is broken in all current versions (4.7-4.10) Date: Fri, 06 Jun 2014 14:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aladjev.andrew at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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-SW-Source: 2014-06/txt/msg00472.txt.bz2 Content-length: 2034 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61428 Bug ID: 61428 Summary: "maybe-uninitialized" is broken in all current versions (4.7-4.10) Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: aladjev.andrew at gmail dot com Created attachment 32900 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D32900&action=3Dedit test.c Please checkout attached test.c. There are no variables in this file, that = may be uninitialized. gcc-4.7.3 -Werror -pedantic -Wall -Wextra -std=3Dgnu99 -pthread -pipe -O2 t= est.c -o test >> test.c: In function =E2=80=98func=E2=80=99: test.c:54:14: error: =E2=80=98lock_1=E2=80=99 may be used uninitialized in = this function [-Werror=3Dmaybe-uninitialized] cc1: all warnings being treated as errors gcc-4.8.2 -Werror -pedantic -Wall -Wextra -std=3Dgnu99 -pthread -pipe -O2 t= est.c -o test >> test.c: In function =E2=80=98func=E2=80=99: test.c:54:14: error: =E2=80=98lock_1=E2=80=99 may be used uninitialized in = this function [-Werror=3Dmaybe-uninitialized] free ( lock_1 ); ^ cc1: all warnings being treated as errors gcc-4.9.0-pre9999 -Werror -pedantic -Wall -Wextra -std=3Dgnu99 -pthread -pi= pe -O2 test.c -o test >> test.c: In function =E2=80=98func=E2=80=99: test.c:44:17: error: =E2=80=98lock_1=E2=80=99 may be used uninitialized in = this function [-Werror=3Dmaybe-uninitialized] free ( lock_1 ); ^ cc1: all warnings being treated as errors gcc-4.10.0-pre9999 -Werror -pedantic -Wall -Wextra -std=3Dgnu99 -pthread -p= ipe -O2 test.c -o test >> test.c: In function =E2=80=98func=E2=80=99: test.c:44:17: error: =E2=80=98lock_1=E2=80=99 may be used uninitialized in = this function [-Werror=3Dmaybe-uninitialized] free ( lock_1 ); ^ cc1: all warnings being treated as errors >>From gcc-bugs-return-453391-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jun 06 14:13:21 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 31701 invoked by alias); 6 Jun 2014 14:13:20 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 31664 invoked by uid 48); 6 Jun 2014 14:13:17 -0000 From: "luto at mit dot edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/56574] False possibly uninitialized variable warning Date: Fri, 06 Jun 2014 14:13:00 -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.7.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: luto at mit dot edu X-Bugzilla-Status: NEW 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-06/txt/msg00473.txt.bz2 Content-length: 223 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56574 --- Comment #10 from Andy Lutomirski --- See PR59500 for another example without &&. I think I can reduce another test case with only if and else.