From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7ABE13858C56; Fri, 12 Apr 2024 17:57:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7ABE13858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712944650; bh=pNC1tFIZnbn8DA6LBfGa/31bzb8Zvata//JTdJBPQqY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BkcuQMk2Zsw0cQreRtPCiZ8X3eKULzl2h9iVXmO8v75U1pQbi6Ybqb2AIDkvnKF3q kO/0vQs3cEo6odv5s7XkxVwTroOThfJmrthnepQtIEFCUQIennxRFr8izuXbLpVWwh w8F366TzA5CMr1raZmbJf2hrX93xoe3RN9YANLfg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114666] [14 Regression] Signed single bit comparison miscompile at -O2 Date: Fri, 12 Apr 2024 17:57:27 +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: P1 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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=3D114666 --- Comment #9 from GCC Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:245595d72818526e2ca857848831e8afa87ae2de commit r14-9941-g245595d72818526e2ca857848831e8afa87ae2de Author: Andrew Pinski Date: Wed Apr 10 13:39:01 2024 -0700 match: Fix `!a?b:c` and `a?~t:t` patterns for signed 1 bit types [PR114= 666] The problem is `!a?b:c` pattern will create a COND_EXPR with an 1bit si= gned integer which breaks patterns like `a?~t:t`. This rejects when we have a signed operand for both patterns. Note for GCC 15, I am going to look at the canonicalization of `a?~t:t` where t was a constant since I think keeping it a COND_EXPR might be more canon= ical and is what VPR produces from the same IR; if anything expand should handle which one is better. Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/114666 gcc/ChangeLog: * match.pd (`!a?b:c`): Reject signed types for the condition. (`a?~t:t`): Likewise. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/bitfld-signed1-1.c: New test. Signed-off-by: Andrew Pinski =