From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14709 invoked by alias); 4 Jun 2014 15:57:37 -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 14665 invoked by uid 48); 4 Jun 2014 15:57:32 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/61409] [4.9/4.10 regression] -Wmaybe-uninitialized false-positive with -O2 Date: Wed, 04 Jun 2014 15:57: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement 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: 4.9.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed bug_severity 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/msg00302.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61409 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-06-04 CC| |davidxl at gcc dot gnu.org Ever confirmed|0 |1 Severity|normal |enhancement --- Comment #4 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Paul Eggert from comment #3) > (In reply to Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez from comment #1) >=20=20 > > My guess is that what is uninitialized is "rw" and some optimization pa= ss > > messed up the variable names when creating temporaries. >=20 > I'm afraid it's more serious than that, because 'rw =3D XWINDOW (make_win= dow > ());' always initializes 'rw'. Yes you're right. Simplifying further we get: extern long int make_window (void); struct vectorlike_header { long int size; }; static _Bool PSEUDOVECTORP (long int a) { if (! (((int) a & ~0) =3D=3D 5)) return 0; else { struct vectorlike_header *h =3D (void *) a - 5; return (h->size =3D=3D 4611686018595160064); } } struct window { int line_height; int pixel_width; int pixel_height; int column_width; int text_cols; int internal_border_width; int left_fringe_width, right_fringe_width; }; struct window * make_frame (_Bool mini_p) { struct window *rw, *mw; rw =3D (struct window *) make_window (); if (mini_p) { long int a =3D make_window (); if (!PSEUDOVECTORP (a)) return rw; mw =3D (void*) a - 5; } rw->pixel_width =3D ((rw->text_cols * (rw->column_width)) + (rw->left_fringe_width + (rw->right_fringe_width)) += 2 * (rw->internal_border_width)); rw->pixel_height =3D ((rw->text_cols * (rw->line_height))); if (mini_p) { mw->pixel_height =3D rw->pixel_height; } return rw; } For this, the uninit pass reports: [WORKLIST]: add to initial list: mw_1 =3D PHI [CHECK]: examining phi: mw_1 =3D PHI [CHECK] Found def edge 1 in mw_1 =3D PHI [BEFORE SIMPLICATION -- [USE]: mw_1->pixel_height =3D _28; is guarded by : mini_p_8(D) !=3D 0 [BEFORE NORMALIZATION --[USE]: mw_1->pixel_height =3D _28; is guarded by : mini_p_8(D) !=3D 0 [AFTER NORMALIZATION -- [USE]: mw_1->pixel_height =3D _28; is guarded by : mini_p_8(D) !=3D 0 [BEFORE SIMPLICATION -- [DEF]: mw_1 =3D PHI is guarded by : mini_p_8(D) !=3D 0 (.AND.) (.NOT.) _31 !=3D 5 (.AND.) _35 =3D=3D 461168601= 8595160064 [BEFORE NORMALIZATION --[DEF]: mw_1 =3D PHI is guarded by : mini_p_8(D) !=3D 0 (.AND.) (.NOT.) _31 !=3D 5 (.AND.) _35 =3D=3D 461168601= 8595160064 [AFTER NORMALIZATION -- [DEF]: mw_1 =3D PHI is guarded by : _35 =3D=3D 4611686018595160064 (.AND.) (.NOT.) _31 !=3D 5 (.AND.) mini_p_8= (D) !=3D 0 [CHECK]: Found unguarded use: mw_1->pixel_height =3D _28; It seems the computation of the logical guards cannot figure out that if (_= 35 =3D=3D 4611686018595160064 (.AND.) (.NOT.) _31 !=3D 5) is false then the f= unction terminates and there cannot be uninitialized uses. From the GIMPLE output, = it does not look as if it trivial to know this. >>From gcc-bugs-return-453221-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 04 16:03:33 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 23398 invoked by alias); 4 Jun 2014 16:03:32 -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 23368 invoked by uid 48); 4 Jun 2014 16:03:29 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/61409] [4.9/4.10 regression] -Wmaybe-uninitialized false-positive with -O2 Date: Wed, 04 Jun 2014 16:03: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement 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: 4.9.1 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-SW-Source: 2014-06/txt/msg00303.txt.bz2 Content-length: 349 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61409 --- Comment #5 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Paul Eggert from comment #0) > Also, mw was used in the > previous line, with no warning. I think uinit uses are computed walking the CFG backwards, and only one use= is reported per variable. >>From gcc-bugs-return-453222-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 04 16:15:16 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 30116 invoked by alias); 4 Jun 2014 16:15:15 -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 30051 invoked by uid 48); 4 Jun 2014 16:15:08 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file Date: Wed, 04 Jun 2014 16:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org 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: 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/msg00304.txt.bz2 Content-length: 1228 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61412 Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |manu at gcc dot gnu.org --- Comment #7 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Matt Godbolt from comment #5) >=20 > That 250K+ file also exhibits the problem: that is, the warning is > suppressed even within the main body of the file. I then whittled down the > preprocessed file to just those two lines. In the original file the "# ..= ." > line came from the middle of a macro expansion defined by a header includ= ed > via an -isystem path. The filename in the "# " line refers to the C++ file > though in both cases. Sorry, this is a bit confusing. The line in question comes before preprocessing from which file? Is this fi= le marked as a system-header? If yes, then why do you expect to get a warning without -Wsystem-headers? If not, did you edit the processed file? Could we= get the processed file without editing (or at least without removing any line-markers)? >>From gcc-bugs-return-453223-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 04 16:19:57 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 32113 invoked by alias); 4 Jun 2014 16:19:57 -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 32075 invoked by uid 48); 4 Jun 2014 16:19:53 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file Date: Wed, 04 Jun 2014 16:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org 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: 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/msg00305.txt.bz2 Content-length: 405 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61412 --- Comment #8 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- (In reply to Andreas Schwab from comment #6) > May be a dup of bug 57201. I think not: that one is about warnings appearing after preprocessing (and = we know why this happens). This one is about warnings disappearing (and we do = not know yet why this happens). >>From gcc-bugs-return-453224-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 04 16:23:30 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 7238 invoked by alias); 4 Jun 2014 16:23:30 -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 7214 invoked by uid 48); 4 Jun 2014 16:23:27 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file Date: Wed, 04 Jun 2014 16:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org 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: 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/msg00306.txt.bz2 Content-length: 175 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61412 --- Comment #9 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez --- but maybe it is a dup of PR60723. >>From gcc-bugs-return-453225-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jun 04 16:27:36 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 10314 invoked by alias); 4 Jun 2014 16:27:35 -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 10256 invoked by uid 48); 4 Jun 2014 16:27:32 -0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61412] Warnings incorrectly suppressed when compiling previously preprocessed file Date: Wed, 04 Jun 2014 16:27:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org 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: 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/msg00307.txt.bz2 Content-length: 796 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61412 --- Comment #10 from Jonathan Wakely --- (In reply to Matt Godbolt from comment #5) > In the original file the "# ..." > line came from the middle of a macro expansion defined by a header included > via an -isystem path. That's the real problem: we don't emit warnings for macros defined in system headers, even though the expansion of the macro is not in a system header. I think there's an existing report about that too. > The filename in the "# " line refers to the C++ file > though in both cases. But in a context that makes the compiler think it's a system header file. I think your reduction of the preprocessed output misled you to think the problem was related to all preprocessed output, but it's not.