From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 41898385701E; Tue, 4 Jul 2023 17:20:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 41898385701E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688491213; bh=j846X+KFwE9oon9oF0Tg70/qkvBG1fZpHUqCOKbeaHc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FD2HwbRMHZInGYHoaImHBXHRWTb240Biofh0kcqN6zAC5pFWnkXeRrQUF6ektNOxu 3H8zzGAKZ1g/S2c9DEZ9BNGzvguBQg0yLoVHNs9h3wh1IwQmGcAZd0gO8hBKnY/zna ov5Mlc0RTc8ySSJeI1BQ8+Jk4L0SWo1GqYDDj2dk= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110487] [12/13/14 Regression] invalid wide Boolean value Date: Tue, 04 Jul 2023 17:20: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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.4 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=3D110487 --- Comment #13 from CVS Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:71b68cc559b5d30d07e6b507df7cc6d008f56aad commit r14-2299-g71b68cc559b5d30d07e6b507df7cc6d008f56aad Author: Andrew Pinski Date: Fri Jun 30 19:22:48 2023 -0700 PR 110487: `(a !=3D/=3D=3D CST1 ? CST2 : CST3)` pattern for type safety The problem here is we might produce some values out of the type's min/max (and/or valid values, e.g. signed booleans). The fix is to use an integer type which has the same precision and signedness as the original type. Note two_value_replacement in phiopt had the same issue in previous versions; though I don't know if a problem will show up there. OK? Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: PR tree-optimization/110487 * match.pd (a !=3D/=3D=3D CST1 ? CST2 : CST3): Always build a nonstandard integer and use that.=