From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E34A43858404; Thu, 13 Oct 2022 22:23:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E34A43858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665699824; bh=IuBJsSd8qdXmK/dfBJyZhCJ1X2MH92jjw4JPWi5HiiA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XkwPgmABYRDN3gcNM5z5T+aO7rZMPeCgQDK+CxTkZaZ67HzeJaqZCLIkMZSsLEpnx 6ui6yJExkPsEl16Se+EadYjCQYU50EAWo3VgfYU/BZe3kW1ccR9KTEvr/Vw3tn/vjG 20SevqT/Y1su/z7MPQnYA9n5ViRRI9LfcWs0HyJM= 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: Thu, 13 Oct 2022 22:23:44 +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 #31 from H.J. Lu --- (In reply to Segher Boessenkool from comment #29) > (In reply to Hongtao.liu from comment #23) > > looking at i386.c put_condition_code used by *setcc_qi, it looks like (= EQ > > (reg:CCCmode FLAG_REG) (const_int 0)) means get carry flag. > > Not (LTU: (REG:CCCmode FLAGS_REG) (const_int 0)). > > Now I got more confused. >=20 > (eq (reg:CCC 17) (const_int 0)) means that the comparison that did set r= eg > 17 > returned "equal". >=20 Isn't the meaning of MODE_CC comparison only known to the backend? On x86, = EQ in (set (pc) (if_then_else (eq (reg:CCO FLAGS_REG) (const_int 0)) (label_ref (match_operand 3)) (pc)))] doesn't evaluate to true when (reg:CCO FLAGS_REG) is 0. It is true when (reg:CCO FLAGS_REG) is set.=