URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
/* PR target/11087
|
/* PR target/11087
|
This testcase was miscompiled on ppc64, because basic_induction_var called
|
This testcase was miscompiled on ppc64, because basic_induction_var called
|
convert_modes, yet did not expect it to emit any new instructions.
|
convert_modes, yet did not expect it to emit any new instructions.
|
Those were emitted at the end of the function and destroyed during life
|
Those were emitted at the end of the function and destroyed during life
|
analysis, while the program used uninitialized pseudos created by
|
analysis, while the program used uninitialized pseudos created by
|
convert_modes. */
|
convert_modes. */
|
|
|
struct A
|
struct A
|
{
|
{
|
unsigned short a1;
|
unsigned short a1;
|
unsigned long a2;
|
unsigned long a2;
|
};
|
};
|
|
|
struct B
|
struct B
|
{
|
{
|
int b1, b2, b3, b4, b5;
|
int b1, b2, b3, b4, b5;
|
};
|
};
|
|
|
struct C
|
struct C
|
{
|
{
|
struct B c1[1];
|
struct B c1[1];
|
int c2, c3;
|
int c2, c3;
|
};
|
};
|
|
|
static
|
static
|
int foo (int x)
|
int foo (int x)
|
{
|
{
|
return x < 0 ? -x : x;
|
return x < 0 ? -x : x;
|
}
|
}
|
|
|
int bar (struct C *x, struct A *y)
|
int bar (struct C *x, struct A *y)
|
{
|
{
|
int a = x->c3;
|
int a = x->c3;
|
const int b = y->a1 >> 9;
|
const int b = y->a1 >> 9;
|
const unsigned long c = y->a2;
|
const unsigned long c = y->a2;
|
int d = a;
|
int d = a;
|
unsigned long e, f;
|
unsigned long e, f;
|
|
|
f = foo (c - x->c1[d].b4);
|
f = foo (c - x->c1[d].b4);
|
do
|
do
|
{
|
{
|
if (d <= 0)
|
if (d <= 0)
|
d = x->c2;
|
d = x->c2;
|
d--;
|
d--;
|
|
|
e = foo (c-x->c1[d].b4);
|
e = foo (c-x->c1[d].b4);
|
if (e < f)
|
if (e < f)
|
a = d;
|
a = d;
|
}
|
}
|
while (d != x->c3);
|
while (d != x->c3);
|
x->c1[a].b4 = c + b;
|
x->c1[a].b4 = c + b;
|
return a;
|
return a;
|
}
|
}
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
struct A a;
|
struct A a;
|
struct C b;
|
struct C b;
|
int c;
|
int c;
|
|
|
a.a1 = 512;
|
a.a1 = 512;
|
a.a2 = 4242;
|
a.a2 = 4242;
|
__builtin_memset (&b, 0, sizeof (b));
|
__builtin_memset (&b, 0, sizeof (b));
|
b.c1[0].b3 = 424242;
|
b.c1[0].b3 = 424242;
|
b.c2 = 1;
|
b.c2 = 1;
|
c = bar (&b, &a);
|
c = bar (&b, &a);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.