From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6846E3857C7A; Wed, 6 Jan 2021 14:53:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6846E3857C7A From: "nathanael.schaeffer at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98563] New: regression: vectorization fails while it worked on gcc 9 and earlier Date: Wed, 06 Jan 2021 14:53:21 +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: 10.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nathanael.schaeffer 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 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: Wed, 06 Jan 2021 14:53:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98563 Bug ID: 98563 Summary: regression: vectorization fails while it worked on gcc 9 and earlier Product: gcc Version: 10.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: nathanael.schaeffer at gmail dot com Target Milestone: --- I have found what seems to be a regression. The following code is not compiled to 256-bit AVX when compiled with -fopenmp-simd, while it is fully vectorized without! Here are the resulting code with different options, with gcc 10.1: -O3 -fopenmp-simd =3D> xmm -O3 =3D> ymm -O3 -fopenmp-simd -fno-signed-zeros =3D> ymm gcc 9 and earlier always vectorize to full-width (ymm) #include typedef std::complex cplx; void test(cplx* __restrict__ a, const cplx* b, double c, int N) { #pragma omp simd for (int i=3D0; i<8*N; i++) { a[i] =3D c*(a[i]-b[i]); } } See the result on godbolt: https://godbolt.org/z/9ThqKE Also, I discover that no avx512 code is generated for this loop. Is this intended? Is there an option to enable avx512 vectorization?=