Commit 6b94a92d by Richard Biener Committed by Richard Biener

re PR tree-optimization/56407 (Optimizations (-O2 -O3) make comparison of arrays of ints to fail)

2013-04-03  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/56407
	* gcc.dg/torture/pr56407.c: New testcase.

From-SVN: r197399
parent ec9202a8
2013-04-03 Richard Biener <rguenther@suse.de>
PR tree-optimization/56407
* gcc.dg/torture/pr56407.c: New testcase.
2013-04-03 Marc Glisse <marc.glisse@inria.fr> 2013-04-03 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/56790 PR tree-optimization/56790
......
/* { dg-do run } */
extern void abort(void);
extern int rand(void);
static void copy(int *r,int *a,int na)
{
int i;
for( i = 0 ; i < na ; i++ )
r[i] = a[i];
}
static void foo(int *a,int na)
{
int i;
for( i = 0 ; i < na ; i++ )
a[i] = rand();
}
static int cmp(int *a,int *b,int n)
{
int i;
for( i = 0 ; i < n ; i++ )
if ( a[i] != b[i] )
return -1;
return 0;
}
void __attribute__((noinline,noclone))
test(int sz,int comm)
{
int j,n;
int v[64],w[64];
for( j = 1 ; j <= sz ; j++ )
{
n = (2 * j - 1) * (2 * j - 1);
foo(w,n);
copy(v,w,n);
if ( comm )
if ( cmp(v,w,n) ) abort ();
}
}
int main()
{
test(2,1);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment