From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 43328385414F; Tue, 11 Oct 2022 22:30:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43328385414F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665527457; bh=6wWT4DvS5bEGrwnh9FfAHCUjn3E+CU/lFT+KihVTTeY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xeNL0/0hlH/g10ZfkA1byABfdTskXDzjme6tFC9X9fBHnEIt9ocW6W6ccqRnembXr jZnZGSNilpKTb0+oW2K22HXYWW2sBQpJfnLBwu9gIszuktXIaHY7LsG8IH/QH/ru+b AekF1SqOGGFK8+osexgl47KDcJEoRepNHrOpI/P8= From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107172] [13 Regression] wrong code with "-O1 -ftree-vrp" on x86_64-linux-gnu since r13-1268-g8c99e307b20c502e Date: Tue, 11 Oct 2022 22:30:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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=3D107172 --- Comment #17 from H.J. Lu --- (In reply to Segher Boessenkool from comment #14) > (In reply to H.J. Lu from comment #13) > > (In reply to Segher Boessenkool from comment #12) > > >=20 > > > To determine the semantics of this piece of RTL you need to see the s= etter(s) > > > of reg 17 feeding this use. In this case, the setter was > > > (set (reg:CCC 17) > > > (ne:CCC (reg:SI 82) > > > (const_int 0 [0]))) > > > which has no meaning for a use that uses "ltu". > >=20 > > What should a valid setter look like? It should set reg 17 in CCC mode= if > > reg 82 in SI mode isn't 0. >=20 > CCCmode can only represent the result of a comparison, like any other MOD= E_CC > thing. The i386 CCCmode means only the carry bit can be used for this, so > you > beed to do an unsigned comparison against (const_int 1). This will end up > with > the opposite polarity of what you said I guess, you need "geu" instead? Since it checks if the input register is 0, compare against (const_int 1) won't work here.=