Fix SSE and YMM state support check logic for -march=native
authorAndrew W. Nosenko <andrew.w.nosenko@gmail.com>
Wed, 3 Oct 2012 17:46:47 +0000 (17:46 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 3 Oct 2012 17:46:47 +0000 (10:46 -0700)
*  config/i386/driver-i386.c (host_detect_local_cpu): Fix logic
in SSE and YMM state support check for -march=native.

From-SVN: r192044

gcc/ChangeLog
gcc/config/i386/driver-i386.c

index 23515ec..2bfafc5 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-03  Andrew W. Nosenko <andrew.w.nosenko@gmail.com>
+
+       *  config/i386/driver-i386.c (host_detect_local_cpu): Fix logic
+       in SSE and YMM state support check for -march=native.
+
 2012-10-03  Nick Clifton  <nickc@redhat.com>
 
        * config/rx/rx.c (struct decl_chain): New local structure.
index 4dffc51..36d80b1 100644 (file)
@@ -473,7 +473,8 @@ const char *host_detect_local_cpu (int argc, const char **argv)
         : "c" (XCR_XFEATURE_ENABLED_MASK));
 
   /* Check if SSE and YMM states are supported.  */
-  if ((eax & (XSTATE_SSE | XSTATE_YMM)) == (XSTATE_SSE | XSTATE_YMM))
+  if (!has_osxsave
+      || (eax & (XSTATE_SSE | XSTATE_YMM)) != (XSTATE_SSE | XSTATE_YMM))
     {
       has_avx = 0;
       has_avx2 = 0;