From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13E743857702; Wed, 25 Oct 2023 08:14:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13E743857702 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698221684; bh=8G0OcqzR18vELG3O9vRXcH1mrNfuZhNakj7/6yKfbsY=; h=From:To:Subject:Date:From; b=Pzy5B8D4xbmc8WsdghpEIfUtaitHNEUthZhnN3XVMVk51hHooK1ESy2E27htugynA ddMGkTYlmZiOr3oFVPBqKQ6rbV6qyieNIGDOF58r53mb8/SM+ulmbiHpJpDggQa6EA 6qqBi/fWLGixFTc/sN3Vhj3wm/jD4lGEWrB/BZhY= From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/111972] New: [14 regression] missed vectorzation for bool a = j != 1; j = (long int)a; Date: Wed, 25 Oct 2023 08:14:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D111972 Bug ID: 111972 Summary: [14 regression] missed vectorzation for bool a =3D j != =3D 1; j =3D (long int)a; Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: crazylht at gmail dot com Target Milestone: --- cat test.c double foo() { long n3 =3D 3450000, xtra =3D 7270; long i,ix; long j; double Check; /* Section 3, Conditional jumps */ j =3D 0; { for (ix=3D0; ix2) j =3D 0; else j =3D 1; if(j<1) j =3D 1; else j =3D 0; } } } Check =3D Check + (double)j; return Check; } The different between gcc 13 dump and gcc14 dump is GCC13 we have [local count: 1063004411]: # i_16 =3D PHI # j_18 =3D PHI <_7(8), j_21(5)> # ivtmp_15 =3D PHI _7 =3D j_18 ^ 1; i_13 =3D i_16 + 1; ivtmp_6 =3D ivtmp_15 - 1; if (ivtmp_6 !=3D 0) goto ; [99.00%] else goto ; [1.00%] GCC14 we have [local count: 1063004410]: # i_17 =3D PHI # j_19 =3D PHI <_14(8), j_22(5)> # ivtmp_16 =3D PHI _9 =3D j_19 !=3D 1; _14 =3D (long int) _9; i_13 =3D i_17 + 1; ivtmp_15 =3D ivtmp_16 - 1; if (ivtmp_15 !=3D 0) goto ; [98.99%] else goto ; [1.01%] Vectorizer can handle=20 _7 =3D j_18 ^ 1;=20 but not _9 =3D j_19 !=3D 1; _14 =3D (long int) _9; ../test.C:11:18: note: vect_is_simple_use: operand j_19 !=3D 1, type of d= ef: internal ../test.C:11:18: note: mark relevant 2, live 0: _9 =3D j_19 !=3D 1; ../test.C:11:18: note: worklist: examine stmt: _9 =3D j_19 !=3D 1; ../test.C:11:18: note: vect_is_simple_use: operand j_19 =3D PHI <_14(8), j_22(5)>, type of def: unknown ../test.C:11:18: missed: Unsupported pattern. ../test.C:15:6: missed: not vectorized: unsupported use in stmt. ../test.C:11:18: missed: unexpected pattern. The difference comes from phiopt2.=