From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6C96D3858C52; Sat, 26 Nov 2022 18:11:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C96D3858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669486272; bh=Y39uZll87kSwiakBjmCrzuutrZ3SToklkccKw0CiLBI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XWIm1EefwshSp/aOhQ8DwAoqYUOTVgp2XgnI4GkloQSJ+1sf9G3x9s+lPAzMI6GWw YAQIsj7pLIb1+O8q3DD9vIPJcStLDT0k7Op0OvAasslBj8+zot2NKHnAtMyQpt5xtj MKmCMbgoW5FVUY0gey7yXZcxmNbeg6GU9ytDxVjQ= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107880] bool tautology missed optimisation Date: Sat, 26 Nov 2022 18:11:12 +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: enhancement X-Bugzilla-Who: pinskia 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: see_also 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=3D107880 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D101807 --- Comment #2 from Andrew Pinski --- One way of fixing this is first transform: _9 =3D ~a_4(D); _10 =3D b_3(D) | _9; Into: _10 =3D a_4(D) <=3D b_3(D); And then we have: _8 =3D b_3(D) >=3D a_4(D); _7 =3D b_3(D) <=3D a_4(D); _1 =3D _7 =3D=3D _8; _2 =3D b_3(D) =3D=3D a_4(D); _6 =3D _1 =3D=3D _2; But _1 is true iff a_4(D) =3D=3D b_3(D) . Let me file that second one as we don't optimize it also for int.=