From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 07CC93858D32; Mon, 23 May 2022 19:11:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07CC93858D32 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/105705] [12/13 Regression] std::equal triggers incorrect -Wnonnull warning Date: Mon, 23 May 2022 19:11:47 +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: 12.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc target_milestone 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: Mon, 23 May 2022 19:11:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105705 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|std::equal triggers |[12/13 Regression] |incorrect -Wnonnull warning |std::equal triggers | |incorrect -Wnonnull warning Target Milestone|--- |12.2 --- Comment #1 from Andrew Pinski --- if (_14 !=3D _15) goto ; [50.00%] else goto ; [50.00%] ... [local count: 507317172]: _50 =3D _15 - _14; if (_50 !=3D 0) goto ; [50.00%] else goto ; [50.00%] [local count: 253658586]: _51 =3D (long unsigned int) _50; _52 =3D __builtin_memcmp (_14, 0B, _51); _53 =3D _52 =3D=3D 0; [local count: 507317172]: # _54 =3D PHI <1(16), _53(17)> The function call is in an unreachable basic block. Since _15 =3D=3D _14 holds true in bb16, _50 =3D=3D 0 will hold true. so bb= 17 is never entered. Looks like a pass ordering issue ...=