From 1edd878e0e21579969b0d1bf0e5b2f13bcce3cde Mon Sep 17 00:00:00 2001
From: Sergey Shalnov <Sergey.Shalnov@intel.com>
Date: Wed, 22 Nov 2017 17:49:07 +0300
Subject: [PATCH 1/1] Fix behavior for -mprefer-vector-width= option

---
 gcc/config/i386/i386.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 6eadc03..293445c 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2681,7 +2681,8 @@ extern void debug_dispatch_window (int);
 /* Use 128-bit AVX instructions in the auto-vectorizer.  */
 #define TARGET_PREFER_AVX128	(prefer_vector_width_type == PVW_AVX128)
 /* Use 256-bit AVX instructions in the auto-vectorizer.  */
-#define TARGET_PREFER_AVX256	(prefer_vector_width_type == PVW_AVX256)
+#define TARGET_PREFER_AVX256	(TARGET_PREFER_AVX128 || \
+				 (prefer_vector_width_type == PVW_AVX256))
 
 #define IX86_HLE_ACQUIRE (1 << 16)
 #define IX86_HLE_RELEASE (1 << 17)
-- 
1.8.3.1

