aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-03-13 09:03:28 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-13 09:03:28 +0100
commit639e8522c050cd9b814bc1a085f38b0418a8759a (patch)
tree8860eca4d4a300d9932ddd494a2ec53b2dde432b /gcc
parent1f4e9d223c77811423b292d7c5862b14153c366f (diff)
downloadgcc-639e8522c050cd9b814bc1a085f38b0418a8759a.zip
gcc-639e8522c050cd9b814bc1a085f38b0418a8759a.tar.gz
gcc-639e8522c050cd9b814bc1a085f38b0418a8759a.tar.bz2
re PR target/84786 ([miscompilation] vunpcklpd accessing xmm16-22 targeting KNL)
PR target/84786 * config/i386/sse.md (sse2_loadhpd): Use Yv constraint rather than v on the last operand. * gcc.target/i386/avx512f-pr84786-1.c: New test. * gcc.target/i386/avx512f-pr84786-2.c: New test. From-SVN: r258475
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/i386/sse.md6
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-pr84786-1.c25
-rw-r--r--gcc/testsuite/gcc.target/i386/avx512f-pr84786-2.c16
5 files changed, 52 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e6fb95b..1bbeaff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2018-03-13 Jakub Jelinek <jakub@redhat.com>
+ PR target/84786
+ * config/i386/sse.md (sse2_loadhpd): Use Yv constraint rather than v
+ on the last operand.
+
PR c++/84704
* tree.c (stabilize_reference_1): Return save_expr (e) for
STATEMENT_LIST even if it doesn't have side-effects.
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 12a594f..bd28732 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -9022,14 +9022,14 @@
;; see comment above inline_secondary_memory_needed function in i386.c
(define_insn "sse2_loadhpd"
[(set (match_operand:V2DF 0 "nonimmediate_operand"
- "=x,v,x,v,o,o ,o")
+ "=x,v,x,v ,o,o ,o")
(vec_concat:V2DF
(vec_select:DF
(match_operand:V2DF 1 "nonimmediate_operand"
- " 0,v,0,v,0,0 ,0")
+ " 0,v,0,v ,0,0 ,0")
(parallel [(const_int 0)]))
(match_operand:DF 2 "nonimmediate_operand"
- " m,m,x,v,x,*f,r")))]
+ " m,m,x,Yv,x,*f,r")))]
"TARGET_SSE2 && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
"@
movhpd\t{%2, %0|%0, %2}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 367a269d..faa6e33 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2018-03-13 Jakub Jelinek <jakub@redhat.com>
+ PR target/84786
+ * gcc.target/i386/avx512f-pr84786-1.c: New test.
+ * gcc.target/i386/avx512f-pr84786-2.c: New test.
+
PR c++/84808
* g++.dg/cpp1y/constexpr-84808.C: New test.
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr84786-1.c b/gcc/testsuite/gcc.target/i386/avx512f-pr84786-1.c
new file mode 100644
index 0000000..d20a672
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-pr84786-1.c
@@ -0,0 +1,25 @@
+/* PR target/84786 */
+/* { dg-do run { target { ! ia32 } } } */
+/* { dg-options "-mavx512f -mno-avx512vl -O2" } */
+/* { dg-require-effective-target avx512f } */
+
+#include "avx512f-check.h"
+
+typedef double V __attribute__((vector_size (16)));
+
+__attribute__((noipa)) V
+foo (V x, double y)
+{
+ register double z __asm ("xmm18");
+ asm volatile ("" : "=v" (z) : "0" (y));
+ x[1] = z;
+ return x;
+}
+
+static void
+avx512f_test (void)
+{
+ V a = foo ((V) { 1.0, 2.0 }, 3.0);
+ if (a[0] != 1.0 || a[1] != 3.0)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/avx512f-pr84786-2.c b/gcc/testsuite/gcc.target/i386/avx512f-pr84786-2.c
new file mode 100644
index 0000000..1e6e5b1
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/avx512f-pr84786-2.c
@@ -0,0 +1,16 @@
+/* PR target/84786 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-mavx512f -mno-avx512vl -O2" } */
+
+typedef double V __attribute__((vector_size (16)));
+
+__attribute__((noipa)) V
+foo (V x, double y)
+{
+ register double z __asm ("xmm18");
+ asm volatile ("" : "=v" (z) : "0" (y));
+ x[1] = z;
+ return x;
+}
+
+/* { dg-final { scan-assembler-not "vunpcklpd\[\^\n\r]*xmm(1\[6-9]|\[23]\[0-9])" } } */