]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix SSE and YMM state support check logic for -march=native
authorH.J. Lu <hongjiu.lu@intel.com>
Wed, 3 Oct 2012 17:51:22 +0000 (17:51 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Wed, 3 Oct 2012 17:51:22 +0000 (10:51 -0700)
Backported from mainline
*  config/i386/driver-i386.c (host_detect_local_cpu): Fix logic
in SSE and YMM state support check for -march=native.

From-SVN: r192046

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

index a4702008212866233f888b796491d0666939f02c..2e0338abf6c6e123086e1675526722b9a613d664 100644 (file)
@@ -1,3 +1,11 @@
+2012-10-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       Backported from mainline
+       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-02  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backported from mainline
index 3e25a72f63d5b2322952e41351fbc90d2e62efe0..69128c58c829ec7ccfe78375a67530a07dc594bb 100644 (file)
@@ -474,7 +474,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_fma = 0;