From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4CE3C3858028; Wed, 14 Apr 2021 20:32:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CE3C3858028 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/100086] [11 Regression] spurious -Wnonnull with __builtin_expect Date: Wed, 14 Apr 2021 20:32:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.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 bug_file_loc blocked cf_known_to_fail keywords bug_status short_desc everconfirmed 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: Wed, 14 Apr 2021 20:32:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100086 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-04-14 URL| |https://bugzilla.redhat.com | |/show_bug.cgi?id=3D1948775 Blocks| |95507 Known to fail| |11.0 Keywords| |diagnostic Status|UNCONFIRMED |NEW Summary|spurious -Wnonnull with |[11 Regression] spurious |__builtin_expect |-Wnonnull with | |__builtin_expect Ever confirmed|0 |1 --- Comment #1 from Martin Sebor --- According to my bisection the warning first appeared in GCC 11, with g:fcae5121154d1c3382b056bcc2c563cedac28e74. Before then the post_ipa_warn = dump looked like so: ;; Function TestBody (_Z8TestBodyv, funcdef_no=3D8, decl_uid=3D2406, cgraph= _uid=3D9, symbol_order=3D8) TestBody () { struct RefPtr emptyTake; struct string D.2453; struct AssertHelper D.2481; bool _1; char * _2; char * _14; bool _15; char * _16; bool _17; long int _18; long int _19; long int _20; long int _21; char * _22; bool _23; long int _24; long int _25; [local count: 1073741824]: emptyTake =3D take (); [return slot optimization] _14 =3D emptyTake.p; _15 =3D _14 !=3D 0B; _1 =3D _14 =3D=3D 0B; if (_1 !=3D 0) goto ; [79.76%] else goto ; [20.24%] [local count: 217325344]: D.2453 =3D GetMessage (); [local count: 217325344]: _2 =3D D.2453.p; AssertHelper::AssertHelper (&D.2481, _2); [local count: 217325344]: AssertHelper::operator=3D (&D.2481, 1); [local count: 217325344]: D.2481 =3D{v} {CLOBBER}; _16 =3D emptyTake.p; _17 =3D _16 !=3D 0B; _18 =3D (long int) _17; _19 =3D _18; if (_19 !=3D 0) goto ; [90.00%] else goto ; [10.00%] [local count: 195592809]: __builtin_puts (_16); [local count: 217325344]: emptyTake =3D{v} {CLOBBER}; emptyTake =3D{v} {CLOBBER}; goto ; [100.00%] [local count: 856416481]: _20 =3D (long int) _15; _21 =3D _20; if (_21 !=3D 0) goto ; [90.00%] else goto ; [10.00%] [local count: 770774832]: __builtin_puts (_14); [local count: 856416481]: emptyTake =3D{v} {CLOBBER}; emptyTake =3D{v} {CLOBBER}; [local count: 1073741824]: return; [count: 0]: : D.2481 =3D{v} {CLOBBER}; _22 =3D emptyTake.p; _23 =3D _22 !=3D 0B; _24 =3D (long int) _23; _25 =3D _24; if (_25 !=3D 0) goto ; [0.00%] else goto ; [0.00%] [count: 0]: __builtin_puts (_22); [count: 0]: emptyTake =3D{v} {CLOBBER}; resx 2 } Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95507 [Bug 95507] [meta-bug] bogus/missing -Wnonnull=