From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 692743858C27; Thu, 27 Apr 2023 12:03:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 692743858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682597012; bh=rSmM36XVC1jDZ1CfM+8uKLba2qXjtigMeHyKEkfz98Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JRg5AbvdOJ1+h/1vkWgrxffqFHD3GNMULptag6WxOgYT51hvbylB/6sCSsvQvRgSN /p7cAXdgLtjD8gEmalW4wPUQzaaJvzISVIbkyVvgfNANXhj+oZUwl9ZRU72D9Ts0Cf 5kfD7uklvSBnElGMdCvn+CAiy/DsvL979MnZelzg= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/107131] [11/12 Regression] wrong code with -Os -fno-ipa-vrp -fno-tree-bit-ccp Date: Thu, 27 Apr 2023 12:03:32 +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: rguenth 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: 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 --- Comment #12 from Richard Biener --- (In reply to Richard Biener from comment #11) > (In reply to Jakub Jelinek from comment #8) > > I think the problem happens during combine. Parts of the vector code > > related 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 := 0ULL) ? > > -1ULL : 0ULL; > > evaluates to 0 rather than -1 that it should when o is 0. > >=20 > > 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; > > } > >=20 > > int > > main () > > { > > if (foo (0) !=3D -1ULL) > > __builtin_abort (); > > return 0; > > } > > at -O2 or -Os, which was miscompiled starting with r12-303-g86403f4e6e5= f7216 > > and got fixed with r13-3530-g0e36a9c6915c713d30. > > No idea why this is marked as 11 regression though... > >=20 > > So, do we need to backport PR107172 change to 12 branch? >=20 > Yes. Testing that now. Not. Not picking cleanly.=