public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vsevolod.livinskij at frtk dot ru" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/95401] New: GCC produces incorrect instruction with -O3 for skylake-avx512
Date: Fri, 29 May 2020 05:18:51 +0000	[thread overview]
Message-ID: <bug-95401-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 95401
           Summary: GCC produces incorrect instruction with -O3 for
                    skylake-avx512
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vsevolod.livinskij at frtk dot ru
  Target Milestone: ---

GCC produces incorrect instruction with -O3 for skylake-avx512 (also for
icelake-server and tigerlake).

Error:
>$ g++ -O3 func.cpp driver.cpp -march=skylake-avx512 && sde -skx -- ./a.out 
SDE ERROR:  TID: 0 executed instruction with an unaligned memory reference to
address 0x404064 INSTR: 0x000401201: IFORM: VMOVDQA_MEMdq_XMMdq :: vmovdqa
xmmword ptr [rcx*4+0x404060], xmm0
        IMAGE:   
/home/vlivinsk/workspace/yarpgen/bugs/may-28/gcc-miscompile/reduce/a.out
        FUNCTION: _Z4testv
        FUNCTION ADDR: 0x000401120

Reproducer:
driver.cpp
int var_9 = 1693986256, var_14;
int arr_16[11];
void test();
int main() { test(); }

func.cpp
extern int var_9;
extern unsigned var_14;
extern int arr_16[];
#include <algorithm>
void test() {
  for (short a = 0; a < (short)var_9; a += 12140)
    for (short b = 0; b < 8; b++)
      if (std::max(var_14, 1U))
        arr_16[a + b] = 0;
}

GCC version: 11.0.0 (5c715e6a2990cfb6c15acc1ee14219523534ec69)

             reply	other threads:[~2020-05-29  5:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  5:18 vsevolod.livinskij at frtk dot ru [this message]
2020-05-29  7:08 ` [Bug tree-optimization/95401] GCC produces incorrect instruction with -O3 for AVX2 rguenth at gcc dot gnu.org
2020-05-29  7:16 ` [Bug tree-optimization/95401] [10/11 Regression] GCC produces incorrect instruction with -O3 for AVX2 since r10-2257-g868363d4f52df19d marxin at gcc dot gnu.org
2020-05-29  7:31 ` rguenth at gcc dot gnu.org
2020-07-23  6:51 ` rguenth at gcc dot gnu.org
2020-12-30 13:36 ` rsandifo at gcc dot gnu.org
2021-01-05 10:59 ` [Bug tree-optimization/95401] [10 " rsandifo at gcc dot gnu.org
2021-01-12 10:06 ` rsandifo at gcc dot gnu.org
2021-03-05  5:10 ` aoliva at gcc dot gnu.org
2021-03-05  8:03 ` rguenth at gcc dot gnu.org
2021-03-11  7:00 ` aoliva 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-95401-4@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).