public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "crazylht at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-98694-4-XIZAD2u5as@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98694-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98694

--- Comment #7 from Hongtao.liu <crazylht at gmail dot com> ---
Another testcase reproduce the same issue.

#include<immintrin.h>
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 = _mm512_cmpeq_epu8_mask (src1, src2);
  short s = (short) m;
  int i = (int)m;
  b = __extension__ (v4hi) {s, s, s, s};
  return __extension__ (v2si) {i, i};
}

int main ()
{
  __m512i src1 = _mm512_setzero_si512 ();
  __m512i src2 = _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 = _mm512_cmpeq_epu8_mask (src1, src2);
  v2si a = foo (src1, src2);
  if (a[0] != (int)m)
    __builtin_abort ();
  return 0;
}

  parent reply	other threads:[~2021-01-18  9:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15  1:42 [Bug tree-optimization/98694] New: " vsevolod.livinskij at frtk dot ru
2021-01-15  8:11 ` [Bug tree-optimization/98694] " crazylht at gmail dot com
2021-01-15  9:43 ` [Bug target/98694] " marxin at gcc dot gnu.org
2021-01-15 10:03 ` [Bug target/98694] [11 Regression] " rguenth at gcc dot gnu.org
2021-01-15 16:52 ` crazylht at gmail dot com
2021-01-15 16:56 ` crazylht at gmail dot com
2021-01-15 17:22 ` crazylht at gmail dot com
2021-01-15 17:33 ` crazylht at gmail dot com
2021-01-18  9:41 ` crazylht at gmail dot com [this message]
2021-01-21  5:30 ` cvs-commit at gcc dot gnu.org
2021-01-21  5:33 ` crazylht at gmail dot com
2021-01-21  9:41 ` [Bug target/98694] " rguenth at gcc dot gnu.org
2021-01-21 11:12 ` crazylht at gmail dot com
2021-05-05 17:48 ` jakub at gcc dot gnu.org
2022-05-10  8:17 ` cvs-commit at gcc dot gnu.org
2022-10-28 23:30 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98694-4-XIZAD2u5as@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).