diff mbox

Do not allow make_compound_operation for vector mode, (PR70944)

Message ID e8443aed-a679-07f1-4354-9b64e12623eb@suse.cz
State New
Headers show

Commit Message

Martin Liška July 27, 2016, 1:46 p.m. UTC
Hello.

Following patch rejects compound operation manipulation for vector mode.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

Comments

Jeff Law July 27, 2016, 10:06 p.m. UTC | #1
On 07/27/2016 07:46 AM, Martin Liška wrote:
> Hello.
>
> Following patch rejects compound operation manipulation for vector mode.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?
> Martin
>
>
> 0001-Do-not-allow-make_compound_operation-for-vector-mode.patch
>
>
> 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
OK.

Jeff
diff mbox

Patch

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

diff --git a/gcc/combine.c b/gcc/combine.c
index 1becc3c..93c1710 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -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.  */
diff --git a/gcc/testsuite/g++.dg/vect/pr70944.cc b/gcc/testsuite/g++.dg/vect/pr70944.cc
new file mode 100644
index 0000000..f8973aa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/vect/pr70944.cc
@@ -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