From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9CF183870844; Fri, 29 May 2020 05:18:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CF183870844 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1590729531; bh=IVdZtioZwfytiPTpYXdWN8xzdfxwvgtU5HD1U+w5V0U=; h=From:To:Subject:Date:From; b=vLv8j6gZ99AgqQxb9tIW4RsV3RoAfiBSuZXtM2u3alnCq8/jGbov5brN1nODLZrjD K433yx+EYDjT9bLIcA3g4OA87VrMQ5kq2z50NNAz2+Z4nHfciZPjzSSHG16dfgu7zj faQLdvMarP+JGuoz1wR2FG7D609hfDGH8MwMQg28= From: "vsevolod.livinskij at frtk dot ru" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vsevolod.livinskij at frtk dot ru 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 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: Fri, 29 May 2020 05:18:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95401 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=3Dskylake-avx512 && sde -skx -- ./a.o= ut=20 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:=20=20=20 /home/vlivinsk/workspace/yarpgen/bugs/may-28/gcc-miscompile/reduce/a.out FUNCTION: _Z4testv FUNCTION ADDR: 0x000401120 Reproducer: driver.cpp int var_9 =3D 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 void test() { for (short a =3D 0; a < (short)var_9; a +=3D 12140) for (short b =3D 0; b < 8; b++) if (std::max(var_14, 1U)) arr_16[a + b] =3D 0; } GCC version: 11.0.0 (5c715e6a2990cfb6c15acc1ee14219523534ec69)=