From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 869973858D33; Mon, 18 Jan 2021 09:41:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 869973858D33 From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/98694] [11 Regression] GCC produces incorrect code for loops with -O3 for skylake-avx512 and icelake-server Date: Mon, 18 Jan 2021 09:41:38 +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: 11.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht 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: 11.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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2021 09:41:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98694 --- Comment #7 from Hongtao.liu --- Another testcase reproduce the same issue. #include typedef short v4hi __attribute__ ((vector_size (8))); typedef int v2si __attribute__ ((vector_size (8))); v4hi b; __attribute__ ((noipa)) v2si foo (__m512i src1, __m512i src2) { __mmask64 m =3D _mm512_cmpeq_epu8_mask (src1, src2); short s =3D (short) m; int i =3D (int)m; b =3D __extension__ (v4hi) {s, s, s, s}; return __extension__ (v2si) {i, i}; } int main () { __m512i src1 =3D _mm512_setzero_si512 (); __m512i src2 =3D _mm512_set_epi8 (0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1); __mmask64 m =3D _mm512_cmpeq_epu8_mask (src1, src2); v2si a =3D foo (src1, src2); if (a[0] !=3D (int)m) __builtin_abort (); return 0; }=