From 5f7ae66453a1f7a1a2c44414b22c742d69670177 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 27 Jul 2016 13:44:51 +0200
Subject: [PATCH] Do not allow make_compound_operation for vector mode
(PR70944)
gcc/testsuite/ChangeLog:
2016-07-27 Martin Liska <mliska@suse.cz>
* g++.dg/vect/pr70944.cc: New test.
gcc/ChangeLog:
2016-07-27 Martin Liska <mliska@suse.cz>
PR rtl-optimization/70944
* combine.c (make_compound_operation):
Do not allow make_compound_operation for vector mode
---
gcc/combine.c | 4 ++++
gcc/testsuite/g++.dg/vect/pr70944.cc | 13 +++++++++++++
2 files changed, 17 insertions(+)
create mode 100644 gcc/testsuite/g++.dg/vect/pr70944.cc
@@ -7770,6 +7770,10 @@ make_compound_operation (rtx x, enum rtx_code in_code)
rtx tem;
const char *fmt;
+ /* PR rtl-optimization/70944. */
+ if (VECTOR_MODE_P (mode))
+ return x;
+
/* Select the code to be used in recursive calls. Once we are inside an
address, we stay there. If we have a comparison, set to COMPARE,
but once inside, go back to our default of SET. */
new file mode 100644
@@ -0,0 +1,13 @@
+/* { dg-do compile { target x86_64-*-* } } */
+/* { dg-additional-options "-O3 -march=core-avx2" } */
+
+unsigned *a;
+void
+fn1 ()
+{
+ for (int i; i; ++i)
+ {
+ unsigned g (a[i] << 8 >> 24);
+ a[i] = g;
+ }
+}
--
2.9.2