re PR tree-optimization/60196 (Incorrect compilation with -fwrapv and -ftree-vectorize)
PR tree-optimization/60196 PR tree-optimization/63189 * gcc.dg/vect/pr63189.c: New test. * gcc.dg/vect/pr60196-1.c: New test. * gcc.dg/vect/pr60196-2.c: New test. From-SVN: r215025
This commit is contained in:
parent
59784c46ff
commit
19b472cc70
|
@ -1,3 +1,11 @@
|
|||
2014-09-08 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR tree-optimization/60196
|
||||
PR tree-optimization/63189
|
||||
* gcc.dg/vect/pr63189.c: New test.
|
||||
* gcc.dg/vect/pr60196-1.c: New test.
|
||||
* gcc.dg/vect/pr60196-2.c: New test.
|
||||
|
||||
2014-09-08 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
|
||||
|
||||
* gcc.target/powerpc/swaps-p8-16.c: New test.
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/* PR tree-optimization/63189 */
|
||||
/* { dg-additional-options "-fwrapv" } */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include "tree-vect.h"
|
||||
|
||||
__attribute__((noinline, noclone)) static int
|
||||
bar (const short *a, int len)
|
||||
{
|
||||
int x;
|
||||
int x1 = 0;
|
||||
|
||||
for (x = 0; x < len; x++)
|
||||
x1 += x * a[x];
|
||||
return x1;
|
||||
}
|
||||
|
||||
__attribute__((noinline, noclone)) void
|
||||
foo (void)
|
||||
{
|
||||
short stuff[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
if (bar (stuff, 9) != 36)
|
||||
abort ();
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
check_vect ();
|
||||
foo ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
|
@ -0,0 +1,33 @@
|
|||
/* PR tree-optimization/63189 */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include "tree-vect.h"
|
||||
|
||||
static const short a[8] = {1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
static const unsigned char b[8] = {0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
__attribute__((noinline, noclone)) static int
|
||||
bar (void)
|
||||
{
|
||||
int sum = 0, i;
|
||||
for (i = 0; i < 8; ++i)
|
||||
sum += a[i] * b[i];
|
||||
return sum;
|
||||
}
|
||||
|
||||
__attribute__((noinline, noclone)) void
|
||||
foo (void)
|
||||
{
|
||||
if (bar () != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
check_vect ();
|
||||
foo ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
|
@ -0,0 +1,26 @@
|
|||
/* PR tree-optimization/63189 */
|
||||
/* { dg-do run } */
|
||||
|
||||
#include "tree-vect.h"
|
||||
|
||||
short int d[16] = { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
__attribute__((noinline, noclone)) void
|
||||
foo (void)
|
||||
{
|
||||
int j, s = 0;
|
||||
for (j = 0; j < 8; j++)
|
||||
s += d[j] * j;
|
||||
if (s != 7)
|
||||
abort ();
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
check_vect ();
|
||||
foo ();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* { dg-final { cleanup-tree-dump "vect" } } */
|
Loading…
Reference in New Issue