This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Do not allow make_compound_operation for vector mode, (PR70944)
- From: Martin Liška <mliska at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Biener <richard dot guenther at gmail dot com>
- Date: Wed, 27 Jul 2016 15:46:27 +0200
- Subject: [PATCH] Do not allow make_compound_operation for vector mode, (PR70944)
- Authentication-results: sourceware.org; auth=none
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
>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