From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F2FB13858C52; Tue, 10 Jan 2023 17:45:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2FB13858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673372754; bh=f5RvFP55StNWj2rGSo34gZkMHVBbwYWkW9UElAH5tH4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tCz0zR5yfdSFmWkec+He2E9HgW9IPSiOywfhZzBrNg0w81wXMI2sWEhC0GAcDQnaF gnF2TNUPk9pLHeaX9G9rZPdNBNXw16Qg0GlwSN4ap9KOjtH8Q861VMSfMBucUKKWR6 +cD9XiPQpwgTDqgNX1cUxUeuczQ+rNalKo6+uwnc= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108360] [13 Regression] Dead Code Elimination Regression at -Os since r13-2048-g418b71c0d535bf Date: Tue, 10 Jan 2023 17:45:54 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 13.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108360 --- Comment #3 from Jakub Jelinek --- The first difference with r13-2048 is during fre3: @@ -210,7 +210,7 @@ marking outgoing edge 6 -> 1 executable RPO iteration over 5 blocks visited 5 blocks in total discovering 5 execut= able blocks iterating 1.0 times, a block was visited max. 1 times RPO tracked 25 values available at 18 locations and 25 lattice elements Replaced (int) _6 with _7 in all uses of _24 =3D (int) _6; -gimple_simplified to if (_6 =3D=3D 0) +gimple_simplified to if (_22 < 0) Replaced (short int) _6 with h_23 in all uses of _25 =3D (short int) _6; Removing dead stmt _25 =3D (short int) _6; Removing dead stmt _24 =3D (int) _6; @@ -259,7 +259,7 @@ int main () _7 =3D (int) _6; # RANGE [irange] short int [-INF, +INF] NONZERO 0x10 h_23 =3D (short int) _6; - if (_6 =3D=3D 0) + if (_22 < 0) goto ; [50.00%] else goto ; [50.00%] Given: _3 =3D _22 >=3D 0; _4 =3D (char) _3; f.5_5 =3D (unsigned char) _3; _6 =3D f.5_5 << 4; h_23 =3D (short int) _6; and range of f.5_5 being [0, 1] that change is certainly correct.=