OSDN Git Service

Properly check OPTION_MASK_ISA_64BIT.
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 23 May 2010 21:57:13 +0000 (21:57 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 23 May 2010 21:57:13 +0000 (21:57 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159768 138bc75d-0d04-0410-961f-82ee72b054a4

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 da66a28..eb18789 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 adcc256..bb9bb64 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 1e748af..4f8e6a2 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);
+}