From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5997B3858418; Mon, 17 Oct 2022 21:03:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5997B3858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666040616; bh=boY/RXvp+4NrQRwcUgGNLz0HZ2LylblHc6gDLArvXUU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tteQ0kN4dpyVxRqZyv4xNjBhJs0aySHyABaLeL6eZCo/oAAHtzfSrxzfWs0I9Hyhf yZ4LSmeYl6KvZjY7dsPshxHgLgDk52X5wio1hDw/fjcC/SC8usmXp7U+IpcfsLgExs UAgYESTlSjS4HaiLyoB/f66RBgrF+HtfX22PDJU4= From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107273] wrong code at -O3 on x86_64-linux-gnu by r13-3281 Date: Mon, 17 Oct 2022 21:03:35 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: amacleod at redhat dot com X-Bugzilla-Status: NEW 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: 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=3D107273 --- Comment #9 from Andrew Macleod --- Working on it. Looks like an 8 bit value somehow got considered as a 32 bit partial equivalence. _8 =3D -_7; _9 =3D (int) _8; h_30 =3D (char) _9; <..> h_30 is an 8 bit slice of _9, yet : This is ok: Checking Partial equiv ( pe32 ) _8 CACHE: BB 11 DOM query for _8, found [irange] unsigned int [1, +INF] NONZERO 0xfffffffa at BB10 CACHE: Range for DOM returns : [irange] unsigned int [1, +INF] NONZERO 0xfffffffa but this is not: Checking Partial equiv ( pe32 ) h_30 CACHE: BB 11 DOM query for h_30, found [irange] char VARYING at BB10 CACHE: Range for DOM returns : [irange] char VARYING Partial equiv update! : h_30 has range : [irange] int [-128, 127] refini= ng range to :[irange] int [-128, -1][1, 127] NONZERO 0xfffffffa That changed the value of _9 in an incorrect way. h_30 is a char, that shou= ld be pe8, and as that is smaller than the 32 bits in _9, that value should ha= ve been rejected.=20 THis is occurring during the path_ranger used by threading, still working on figuring where the root issue lies.=