From: Uros Bizjak Date: Thu, 11 May 2017 15:41:50 +0000 (+0200) Subject: pr22152.c: Fix undefined testcase. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc09ff603becdabd716421a65a88ad91b075bce8;p=gcc.git pr22152.c: Fix undefined testcase. * gcc.target/i386/pr22152.c: Fix undefined testcase. Remove unnecessary loop. Run on 32-bit targets only. (dg-options): Remove -fno-tree-sink. From-SVN: r247914 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 411996f2794..9ab52c2faae 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-05-11 Uros Bizjak + + * gcc.target/i386/pr22152.c: Fix undefined testcase. Remove + unnecessary loop. Run on 32-bit targets only. + (dg-options): Remove -fno-tree-sink. + 2017-05-11 Kelvin Nilsen * gcc.target/powerpc/cmpb-1.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr22152.c b/gcc/testsuite/gcc.target/i386/pr22152.c index 8603b09fe4a..08f98c30cc5 100644 --- a/gcc/testsuite/gcc.target/i386/pr22152.c +++ b/gcc/testsuite/gcc.target/i386/pr22152.c @@ -1,18 +1,19 @@ -/* { dg-do compile } */ -/* { dg-options "-O2 -fno-tree-sink -msse2 -mtune=core2" } */ +/* { dg-do compile { target ia32 } } */ +/* { dg-options "-O2 -msse2 -mtune=core2" } */ /* { dg-additional-options "-mno-vect8-ret-in-mem" { target *-*-vxworks* } } */ /* { dg-additional-options "-mabi=sysv" { target x86_64-*-mingw* } } */ #include +typedef __SIZE_TYPE__ size_t; + __m64 -unsigned_add3 (const __m64 * a, const __m64 * b, unsigned int count) +unsigned_add3 (const __m64 * a, const __m64 * b, size_t count) { - __m64 sum; - unsigned int i; + __m64 sum = { 0, 0 }; - for (i = 1; i < count; i++) - sum = _mm_add_si64 (a[i], b[i]); + if (count > 0) + sum = _mm_add_si64 (a[count-1], b[count-1]); return sum; }