From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A77CC3858C53; Sat, 15 Jul 2023 03:56:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A77CC3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689393394; bh=lUbqRJBgIwX9xy1oYrsIn3UA/f6cxON8gpfHpBaOs1E=; h=From:To:Subject:Date:In-Reply-To:References:From; b=sEN4yhLe+XVxedJx8rib5+vHnUN/cYUq1FfH0ys9nQLpibULWaB3iaPNUtl7nQ49O AcS3T+PV/hsqY0Bb9Bw5ZSXTkvPCA+ddN+wUJO6D2mACooO+Ae3V6jM1BILJ7TauD8 qMBIXzKiPG+v47y2tovoA8beESr7ed5Z7DtpeVwo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110204] [14 Regression] Suspicous warning when compiling ranges-v3 using GCC trunk (iteration 9223372036854775807 invokes undefined behavior) Date: Sat, 15 Jul 2023 03:56:34 +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: 14.0 X-Bugzilla-Keywords: diagnostic, needs-bisection, needs-reduction 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: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110204 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #4 from Andrew Pinski --- Replaced _40 - _41 with pretmp_163 in all uses of _42 =3D _40 - _41; Replaced _42 /[ex] 4 with pretmp_162 in all uses of _43 =3D _42 /[ex] 4; Replaced (long unsigned int) _43 with pretmp_161 in all uses of _44 =3D (lo= ng unsigned int) _43; Removing unexecutable edge from if (_42 !=3D 0) Removing dead stmt _44 =3D (long unsigned int) _43; Removing dead stmt _43 =3D _42 /[ex] 4; Removing dead stmt _42 =3D _40 - _41; Removing dead stmt _41 =3D MEM[(const struct vector *)_3(D)].D.214899._M_impl.D.214244._M_start; Removing dead stmt _40 =3D MEM[(const struct vector *)_3(D)].D.214899._M_impl.D.214244._M_finish; What is interesting is before PRE we had: ``` [local count: 19488414]: if (_42 !=3D 0) goto ; [59.00%] else goto ; [41.00%] [local count: 11498164]: __n_154 =3D _43 + -1; if (_42 !=3D 0) goto ; [89.00%] else goto ; [11.00%] ``` After we got: ``` [local count: 19488414]: if (pretmp_163 !=3D 0) goto ; [59.00%] else goto ; [41.00%] [local count: 7990250]: goto ; [100.00%] [local count: 11498164]: __n_154 =3D pretmp_162 + -1; ``` That is only the second condition based on _42 was removed and not the first ...=