Properly check OPTION_MASK_ISA_64BIT.
authorH.J. Lu <hongjiu.lu@intel.com>
Sun, 23 May 2010 21:57:13 +0000 (21:57 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Sun, 23 May 2010 21:57:13 +0000 (14:57 -0700)
gcc/

2010-05-23  H.J. Lu  <hongjiu.lu@intel.com>

PR target/44245
* config/i386/i386.c (def_builtin): Properly check
OPTION_MASK_ISA_64BIT.

gcc/testsuite/

2010-05-23  H.J. Lu  <hongjiu.lu@intel.com>

PR target/44245
* gcc.target/i386/crc32-3.c: New.
* gcc.target/i386/crc32-4.c: Likewise.

From-SVN: r159768

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/crc32-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/crc32-4.c [new file with mode: 0644]

index da66a2873a415b200a60ad25dc710594e0534362..eb18789dacd6d07d4f160b1d4c7ddfe06b5a591d 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/44245
+       * config/i386/i386.c (def_builtin): Properly check
+       OPTION_MASK_ISA_64BIT.
+
 2010-05-23  Joseph Myers  <joseph@codesourcery.com>
 
        * c-decl.c (diagnose_mismatched_decls): Give error for duplicate
index adcc256d54cdf13b41b7f2e2f6e6d58afb364209..bb9bb6415fde3e1c6a3a58a695324819f2bc96ce 100644 (file)
@@ -21582,6 +21582,7 @@ def_builtin (int mask, const char *name, enum ix86_builtin_func_type tcode,
     {
       ix86_builtins_isa[(int) code].isa = mask;
 
+      mask &= ~OPTION_MASK_ISA_64BIT;
       if (mask == 0
          || (mask & ix86_isa_flags) != 0
          || (lang_hooks.builtin_function
index 1e748af68650015ab1314a6f98f13ecb86f2973d..4f8e6a2d493d1424d04154af11c3cb0988c6d083 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/44245
+       * gcc.target/i386/crc32-3.c: New.
+       * gcc.target/i386/crc32-4.c: Likewise.
+
 2010-05-23  Joseph Myers  <joseph@codesourcery.com>
 
        * gcc.dg/c1x-typedef-1.c, gcc.dg/c1x-typedef-2.c,
diff --git a/gcc/testsuite/gcc.target/i386/crc32-3.c b/gcc/testsuite/gcc.target/i386/crc32-3.c
new file mode 100644 (file)
index 0000000..e77d7d9
--- /dev/null
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -mcrc32" } */
+/* { dg-final { scan-assembler "__builtin_ia32_crc32di" } } */
+
+unsigned long long
+crc32d (unsigned long long x, unsigned long long y)
+{
+  return __builtin_ia32_crc32di (x, y);
+}
diff --git a/gcc/testsuite/gcc.target/i386/crc32-4.c b/gcc/testsuite/gcc.target/i386/crc32-4.c
new file mode 100644 (file)
index 0000000..65ef4aa
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mno-sse4.2 -mno-crc32" } */
+/* { dg-final { scan-assembler "__builtin_ia32_crc32di" } } */
+
+unsigned long long
+crc32d (unsigned long long x, unsigned long long y)
+{
+  return __builtin_ia32_crc32di (x, y);
+}