From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 79A0F1382C5 for ; Sun, 14 Jun 2020 11:07:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A9CECE0A85; Sun, 14 Jun 2020 11:07:36 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 862D9E0A85 for ; Sun, 14 Jun 2020 11:07:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2CD3234EF86 for ; Sun, 14 Jun 2020 11:07:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B5EA624C for ; Sun, 14 Jun 2020 11:07:33 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1592132752.7b2124fa47d6c44c0605926689310edbcaba2be1.slyfox@gentoo> Subject: [gentoo-commits] proj/gcc-patches:master commit in: 10.1.0/gentoo/ X-VCS-Repository: proj/gcc-patches X-VCS-Files: 10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch 10.1.0/gentoo/README.history X-VCS-Directories: 10.1.0/gentoo/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 7b2124fa47d6c44c0605926689310edbcaba2be1 X-VCS-Branch: master Date: Sun, 14 Jun 2020 11:07:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 71823699-faef-48be-a987-07fbf44d2750 X-Archives-Hash: 0aec6e4b9641cb14204a9d3c0b7823cd commit: 7b2124fa47d6c44c0605926689310edbcaba2be1 Author: Sergei Trofimovich gentoo org> AuthorDate: Sun Jun 14 11:05:52 2020 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Sun Jun 14 11:05:52 2020 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=7b2124fa 10.1.0: backport avx512 fix for PR95528 Should make firefox-77 compile again on avx512 targets. Reported-by: Thomas Deutschmann Bug: https://bugs.gentoo.org/727028 Bug: https://gcc.gnu.org/PR95528 Signed-off-by: Sergei Trofimovich gentoo.org> 10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch | 92 ++++++++++++++++++++++++ 10.1.0/gentoo/README.history | 3 + 2 files changed, 95 insertions(+) diff --git a/10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch b/10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch new file mode 100644 index 0000000..4a1a83c --- /dev/null +++ b/10.1.0/gentoo/33_all_avx512-scalar-PR95528.patch @@ -0,0 +1,92 @@ +https://gcc.gnu.org/PR95528 +https://bugs.gentoo.org/727028 + +From c75a2abc3a976096b89475f062d4795247aa02b8 Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek +Date: Mon, 8 Jun 2020 11:05:10 +0200 +Subject: [PATCH] forwprop: Ignore scalar mode vectors in + simplify_vector_constructor [PR95528] + +As mentioned in the PR, the problem is that at least the x86 backend asumes +that the vec_unpack* and vec_pack* optabs with integral modes are for the +AVX512-ish vector masks rather than for very small vectors done in GPRs. +The only other target that seems to have a scalar mode vec_{,un}pack* optab +is aarch64 as discussed in the PR, so there is also a condition for that. +All other targets have just vector mode optabs. + +2020-06-08 Jakub Jelinek + + PR target/95528 + * tree-ssa-forwprop.c (simplify_vector_constructor): Don't use + VEC_UNPACK*_EXPR or VEC_PACK_TRUNC_EXPR with scalar modes unless the + type is vector boolean. + + * g++.dg/opt/pr95528.C: New test. + +(cherry picked from commit 8be374e02761c9d63d2753d71e4bd4874a1577b1) +--- + gcc/testsuite/g++.dg/opt/pr95528.C | 27 +++++++++++++++++++++++++++ + gcc/tree-ssa-forwprop.c | 11 +++++++++++ + 2 files changed, 38 insertions(+) + create mode 100644 gcc/testsuite/g++.dg/opt/pr95528.C + +--- /dev/null ++++ b/gcc/testsuite/g++.dg/opt/pr95528.C +@@ -0,0 +1,27 @@ ++// PR target/95528 ++// { dg-do compile { target c++11 } } ++// { dg-options "-O3" } ++// { dg-additional-options "-march=skylake-avx512" { target i?86-*-*- x86_64-*-* } } ++ ++template struct b { ++ typedef a c __attribute__((vector_size(sizeof(a) * 4))); ++ union { ++ c d; ++ struct { ++ a e, f, g, h; ++ }; ++ }; ++ b(); ++ b(const b &i) : d(i.d) {} ++ static b j(c); ++ template operator b() { ++ b::j(typename b::c{k(e), k(f), k(g), k(h)}); ++ return b(); ++ } ++}; ++template using l = b; ++using m = l; ++using n = l; ++m o(n i) { return i; } ++b q; ++void p() { o(q); } +--- a/gcc/tree-ssa-forwprop.c ++++ b/gcc/tree-ssa-forwprop.c +@@ -2401,6 +2401,10 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) + && (dblvectype + = build_vector_type (TREE_TYPE (TREE_TYPE (orig[0])), + nelts * 2)) ++ /* Only use it for vector modes or for vector booleans represented ++ as scalar bitmasks. See PR95528. */ ++ && (VECTOR_MODE_P (TYPE_MODE (dblvectype)) ++ || VECTOR_BOOLEAN_TYPE_P (dblvectype)) + && (optab = optab_for_tree_code (FLOAT_TYPE_P (TREE_TYPE (type)) + ? VEC_UNPACK_FLOAT_LO_EXPR + : VEC_UNPACK_LO_EXPR, +@@ -2442,6 +2446,13 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi) + && (halfvectype + = build_vector_type (TREE_TYPE (TREE_TYPE (orig[0])), + nelts / 2)) ++ /* Only use it for vector modes or for vector booleans ++ represented as scalar bitmasks, or allow halfvectype ++ be the element mode. See PR95528. */ ++ && (VECTOR_MODE_P (TYPE_MODE (halfvectype)) ++ || VECTOR_BOOLEAN_TYPE_P (halfvectype) ++ || (TYPE_MODE (halfvectype) ++ == TYPE_MODE (TREE_TYPE (halfvectype)))) + && (optab = optab_for_tree_code (VEC_PACK_TRUNC_EXPR, + halfvectype, + optab_default)) +-- +2.27.0 + diff --git a/10.1.0/gentoo/README.history b/10.1.0/gentoo/README.history index 362382e..a69b102 100644 --- a/10.1.0/gentoo/README.history +++ b/10.1.0/gentoo/README.history @@ -1,3 +1,6 @@ +3 TODO + 33_all_avx512-scalar-PR95528.patch + 2 11 June 2020 + 29_all_fix-float-hang-PR95118.patch + 30_all_lto-intl-workaround-PR95194.patch