From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 91B103858D37; Thu, 29 Jun 2023 19:02:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 91B103858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688065327; bh=sh0ir6JAzAa+hhpMem19GOua6iaiOw0HHJpRqGs3qcs=; h=From:To:Subject:Date:From; b=oIekU557fXmwVRcvMbM+VhocWDMv1/raPKAWvC+6dBAkFM5ZJS/AZOWQkEeuxbL61 CCg6dW8UjAOia/fBHe7K1f2islAsiJdnwClF7wtHhSskwh8d13MXzB23eMvpU3TG1n VfO/J3rsPZoGNN1uPXL5GRAoEzo+YH1fZKLDuen8= From: "kristerw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110487] New: invalid wide Boolean value Date: Thu, 29 Jun 2023 19:02:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: kristerw at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 Bug ID: 110487 Summary: invalid wide Boolean value Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: kristerw at gcc dot gnu.org Target Milestone: --- The vrp2 pass generates IR where a may get the value 1 = (in addition to the valid 0 and -1). This can be seen in gcc.c-torture/compile/pr53410-1.c int *a, b, c, d; void foo (void) { for (; d <=3D 0; d++) b &=3D ((a || d) ^ c) =3D=3D 1; } when compiled as "gcc -O3". The vectorizer has created (correct) code _Bool _16; _66; ... _16 =3D a.1_1 !=3D 0B; _66 =3D _16 ? -1 : 0; which then is transformed by vrp2 to _Bool _16; _38; _66; ... _16 =3D a.1_1 !=3D 0B; _38 =3D () _16; _66 =3D -_38; _16 can be both true/false depending on the values of some global variables= , so _38 has the value 0 or -1, and _66 has the value 0 or 1.=