diff options
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.target/i386/pr47564.c')
-rw-r--r-- | gcc-4.8/gcc/testsuite/gcc.target/i386/pr47564.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.target/i386/pr47564.c b/gcc-4.8/gcc/testsuite/gcc.target/i386/pr47564.c new file mode 100644 index 000000000..5d3f25d10 --- /dev/null +++ b/gcc-4.8/gcc/testsuite/gcc.target/i386/pr47564.c @@ -0,0 +1,42 @@ +/* PR target/47564 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -msse2" } */ + +static inline unsigned long long +foo (const unsigned char *p) +{ + return 1; +} + +__attribute__ ((__target__ ("sse4"))) void +bar (unsigned long long *x, const void *b, long long m) +{ + const unsigned char *p = (const unsigned char *) b; + const unsigned char *e = p + m; + unsigned int l = *x; + unsigned long long n = l; + + if ((e - p) >= 8192) + { + while ((e - p) >= 128) + { + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + } + } + + while ((e - p) >= 16) + { + n = __builtin_ia32_crc32di (n, foo (p)); + n = __builtin_ia32_crc32di (n, foo (p)); + } + l = n; + *x = l; +} |