From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 565293856251; Fri, 30 Jun 2023 07:01:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 565293856251 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688108510; bh=fRYn5rdRyTi2fShRVLN7KQ6/Hl10VkererN79tataa0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=le93PdJwqJ5W2cdDkNn8Y3St7ErUGQTniAI4TdUlkAc2HpGKyPX8PJ5EkQ+oyWQAf VSgIlQ3i35KRdvgBY+zFRn2P+Eg4sgeeOgabw07lGK52GOxLrDwTkdharBTS1Sr6YQ jX4x7VKp/1umDBtg9Bg1awYBPIPACKlJ3hQ2btTA= From: "rguenth 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: Fri, 30 Jun 2023 07:01:49 +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: rguenth 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 #4 from Richard Biener --- BOOLEAN_TYPE means it has two values (else undefined), when the values are 0 and 1 the precision can always be 1 and just TYPE_SIZE can be larger when required (fortran bools). With values -1 and 0 and vector ISAs who tend to look at the MSB we need sign-extension to the size of the type which means we need TYPE_PRECISION !=3D 1. We have multiple places that check for two-valuedness with TYPE_PRECISION = =3D=3D 1 || BOOLEAN_TYPE and that's OK. Some also check for TYPE_UNSIGNED if they require [0, 1]. The spirit of transforming this COND_EXPR to a negation is "OK", but I think you need to go via an integer type here: _16 =3D a.1_1 !=3D 0B; _38 =3D (int32_t) _16; _39 =3D -_38; _66 =3D (