From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 85CD43858420; Mon, 27 Nov 2023 23:26:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 85CD43858420 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701127569; bh=/Nd+c9vnic4dhbGP+s6mDmyFxxsnjwJVd/ThkoRqtoE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AKRcuXrl52VnS7md8Kre7nN3jlT86zXspH7CZwlmQoTAF6VluSu3/vJzEbXIIK+qB Rf53Q0KXDFdpcKaLZMWcEZLq2bd8aKqq0bpPchkXK2XRS5DB6trIEAdXopW36OP7mQ BKxpIaqBqcMt8WTCAjb/3Nu0osLov7LXME1PtKMA= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112738] [14 Regression] forwprop4 introduces invalid wide signed Boolean values Date: Mon, 27 Nov 2023 23:26:09 +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: pinskia 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: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status short_desc assigned_to target_milestone cf_reconfirmed_on keywords everconfirmed 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=3D112738 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Summary|forwprop4 introduces |[14 Regression] forwprop4 |invalid wide signed Boolean |introduces invalid wide |values |signed Boolean values Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot = gnu.org Target Milestone|--- |14.0 Last reconfirmed| |2023-11-27 Keywords| |wrong-code Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski --- Mine. ``` /* (nop_outer_cast)-(inner_cast)var -> -(outer_cast)(var) if var is smaller in precision. This is always safe for both doing the negative in signed or unsigned as the value for undefined will not show up. */ (simplify (convert (negate:s@1 (convert:s @0))) (if (INTEGRAL_TYPE_P (type) && tree_nop_conversion_p (type, TREE_TYPE (@1)) && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (@0))) (negate (convert @0)))) ``` This needs a check for !BOOLEAN_TYPE here I think. boolean is the special c= ase ...=