* config/i386/driver-i386.c (host_detect_local_cpu): Do cpuid 7 only
if max_level allows that.
testsuite/ChangeLog:
PR target/50740
* gcc.target/i386/avx2-check.h (main): Check CPUID level correctly.
* gcc.target/i386/bmi2-check.h: Ditto.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180304
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-10-21 H.J. Lu <hongjiu.lu@intel.com>
+ Kirill Yukhin <kirill.yukhin@intel.com>
+
+ * config/i386/driver-i386.c (host_detect_local_cpu): Do cpuid 7 only
+ if max_level allows that.
+
2011-10-21 Bernd Schmidt <bernds@codesourcery.com>
* reg-notes.def (DEP_CONTROL): New.
2011-10-21 Jan Hubicka <jh@suse.cz>
* cgraph.c (dump_cgraph_node): Dump alias flag.
- * cgraphunit.c (handle_alias_pairs): Handle weakrefs with no destination.
+ * cgraphunit.c (handle_alias_pairs): Handle weakrefs with
+ no destination.
(get_alias_symbol): New function.
(output_weakrefs): Output also weakrefs with no destinatoin.
(lto_output_node): Output weakref alias flag when at function boundary.
2011-10-21 Andrew Stubbs <ams@codesourcery.com>
PR target/50809
-
* config/arm/driver-arm.c (vendors): Make static.
2011-10-21 Uros Bizjak <ubizjak@gmail.com>
has_sse = edx & bit_SSE;
has_sse2 = edx & bit_SSE2;
+ if (max_level >= 7)
+ {
+ __cpuid_count (7, 0, eax, ebx, ecx, edx);
+
+ has_bmi = ebx & bit_BMI;
+ has_avx2 = ebx & bit_AVX2;
+ has_bmi2 = ebx & bit_BMI2;
+ }
+
/* Check cpuid level of extended features. */
__cpuid (0x80000000, ext_level, ebx, ecx, edx);
has_longmode = edx & bit_LM;
has_3dnowp = edx & bit_3DNOWP;
has_3dnow = edx & bit_3DNOW;
-
- __cpuid (0x7, eax, ebx, ecx, edx);
-
- has_bmi = ebx & bit_BMI;
- has_avx2 = ebx & bit_AVX2;
- has_bmi2 = ebx & bit_BMI2;
}
if (!arch)
+2011-10-21 H.J. Lu <hongjiu.lu@intel.com>
+ Kirill Yukhin <kirill.yukhin@intel.com>
+
+ PR target/50740
+ * gcc.target/i386/avx2-check.h (main): Check CPUID level correctly.
+ * gcc.target/i386/bmi2-check.h: Ditto.
+
2011-10-21 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/50811
/* Run AVX2 test only if host has AVX2 support. */
if ((ecx & bit_OSXSAVE) == (bit_OSXSAVE))
{
+ if (__get_cpuid_max (0, NULL) < 7)
+ return 0;
+
__cpuid_count (7, 0, eax, ebx, ecx, edx);
if ((avx_os_support ()) && ((ebx & bit_AVX2) == bit_AVX2))
{
unsigned int eax, ebx, ecx, edx;
+ if (__get_cpuid_max (0, NULL) < 7)
+ return 0;
+
__cpuid_count (7, 0, eax, ebx, ecx, edx);
/* Run BMI2 test only if host has BMI2 support. */