From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5EC453854806; Fri, 13 Jan 2023 16:27:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5EC453854806 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673627244; bh=MGsk9/3Ega5MhuZ8pkpTbyIoOBuob7a0J64VfP2Ym38=; h=From:To:Subject:Date:In-Reply-To:References:From; b=YYa32JR/h0DdSvjf62RMB0RGahQN9GPHQ6H1zpeTI3bt/rrW5AkN6KX+a00+PA8cr wi1DjUJhKCdlmODIFVq/ACnUw42ehEgJDnyY30OzEUb6t0zwdXh563yPHZzvp+nLuX G1axrJFx80RIqBXOLFWk41Plhfv23FVU2WXTckW4= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107131] [11/12/13 Regression] wrong code with -Os -fno-ipa-vrp -fno-tree-bit-ccp Date: Fri, 13 Jan 2023 16:27:23 +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: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D107131 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hjl.tools at gmail dot com, | |uros at gcc dot gnu.org --- Comment #8 from Jakub Jelinek --- I think the problem happens during combine. Parts of the vector code relat= ed to: V b =3D (V) { } >=3D o; V c =3D b <=3D (V)(b >=3D (V) { 0, 0, 0, 0, 0, 0x90DF0BE3990AC871ULL }); - in particular the scalar c[5] computation, i.e. unsigned long long b =3D 0 >=3D o ? -1ULL : 0ULL; unsigned long long c =3D b <=3D (b >=3D 0x90DF0BE3990AC871ULL ? -1ULL : 0UL= L) ? -1ULL : 0ULL; evaluates to 0 rather than -1 that it should when o is 0. This boils down to: __attribute__((noipa)) unsigned long long foo (unsigned char o) { unsigned long long t1 =3D -(long long) (o =3D=3D 0); unsigned long long t2 =3D -(long long) (t1 > 10439075533421201520ULL); unsigned long long t3 =3D -(long long) (t1 <=3D t2); return t3; } int main () { if (foo (0) !=3D -1ULL) __builtin_abort (); return 0; } at -O2 or -Os, which was miscompiled starting with r12-303-g86403f4e6e5f7216 and got fixed with r13-3530-g0e36a9c6915c713d30. No idea why this is marked as 11 regression though... So, do we need to backport PR107172 change to 12 branch?=