diff options
author | Richard Henderson <rth@redhat.com> | 2009-11-05 15:27:52 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2009-11-05 15:27:52 -0800 |
commit | 7a14a9dad853afc9403862d7b1b3414f291e3790 (patch) | |
tree | 63ff306e58a3a168462f13fef2f74e63f1cd6f95 /gcc | |
parent | ad6d42e16abcf2af74d74040b3cb88fa16bb34ae (diff) | |
download | gcc-7a14a9dad853afc9403862d7b1b3414f291e3790.zip gcc-7a14a9dad853afc9403862d7b1b3414f291e3790.tar.gz gcc-7a14a9dad853afc9403862d7b1b3414f291e3790.tar.bz2 |
* config/i386/ia32intrin.h: Protect CRC32 builtins with __SSE4_2__.
From-SVN: r153953
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/i386/ia32intrin.h | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/i386-7.C | 8 |
3 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d745512..a39ecba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2009-11-05 Richard Henderson <rth@redhat.com> + + * config/i386/ia32intrin.h: Protect CRC32 builtins with __SSE4_2__. + 2009-11-05 Paul Brook <paul@codesourcery.com> * config/arm/arm.c (arm_fp_model, arm_fpu_arch, arm_fpu_tune): Remove. diff --git a/gcc/config/i386/ia32intrin.h b/gcc/config/i386/ia32intrin.h index e701b19..540bc3f 100644 --- a/gcc/config/i386/ia32intrin.h +++ b/gcc/config/i386/ia32intrin.h @@ -49,6 +49,7 @@ __bswapd (int __X) return __builtin_bswap32 (__X); } +#ifdef __SSE4_2__ /* 32bit accumulate CRC32 (polynomial 0x11EDC6F41) value. */ extern __inline unsigned int __attribute__((__gnu_inline__, __always_inline__, __artificial__)) @@ -70,6 +71,7 @@ __crc32d (unsigned int __C, unsigned int __V) { return __builtin_ia32_crc32si (__C, __V); } +#endif /* SSE4.2 */ /* 32bit popcnt */ extern __inline int diff --git a/gcc/testsuite/g++.dg/other/i386-7.C b/gcc/testsuite/g++.dg/other/i386-7.C new file mode 100644 index 0000000..e2ad51e --- /dev/null +++ b/gcc/testsuite/g++.dg/other/i386-7.C @@ -0,0 +1,8 @@ +/* Test that x86intrin.h is usable with -O -pedantic-errors. */ +/* We were using SSE4.2 builtins without the extension available. */ +/* { dg-do compile { target i?86-*-* x86_64-*-* } } */ +/* { dg-options "-O -pedantic-errors" } */ + +#include <x86intrin.h> + +int dummy; |