URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
test_store_ccp (int i)
|
test_store_ccp (int i)
|
{
|
{
|
int *p, a, b, c;
|
int *p, a, b, c;
|
|
|
if (i < 5)
|
if (i < 5)
|
p = &a;
|
p = &a;
|
else if (i > 8)
|
else if (i > 8)
|
p = &b;
|
p = &b;
|
else
|
else
|
p = &c;
|
p = &c;
|
|
|
*p = 10;
|
*p = 10;
|
b = 3;
|
b = 3;
|
|
|
/* STORE-CCP was wrongfully propagating 10 into *p. */
|
/* STORE-CCP was wrongfully propagating 10 into *p. */
|
return *p + 2;
|
return *p + 2;
|
}
|
}
|
|
|
|
|
test_store_copy_prop (int i)
|
test_store_copy_prop (int i)
|
{
|
{
|
int *p, a, b, c;
|
int *p, a, b, c;
|
|
|
if (i < 5)
|
if (i < 5)
|
p = &a;
|
p = &a;
|
else if (i > 8)
|
else if (i > 8)
|
p = &b;
|
p = &b;
|
else
|
else
|
p = &c;
|
p = &c;
|
|
|
*p = i;
|
*p = i;
|
b = i + 1;
|
b = i + 1;
|
|
|
/* STORE-COPY-PROP was wrongfully propagating i into *p. */
|
/* STORE-COPY-PROP was wrongfully propagating i into *p. */
|
return *p;
|
return *p;
|
}
|
}
|
|
|
|
|
main()
|
main()
|
{
|
{
|
int x;
|
int x;
|
|
|
x = test_store_ccp (10);
|
x = test_store_ccp (10);
|
if (x == 12)
|
if (x == 12)
|
abort ();
|
abort ();
|
|
|
x = test_store_copy_prop (9);
|
x = test_store_copy_prop (9);
|
if (x == 9)
|
if (x == 9)
|
abort ();
|
abort ();
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.