URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* PR24716, scalar evolution returning the wrong result
|
/* PR24716, scalar evolution returning the wrong result
|
for pdest. */
|
for pdest. */
|
|
|
int Link[] = { -1 };
|
int Link[] = { -1 };
|
int W[] = { 2 };
|
int W[] = { 2 };
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
int f (int k, int p)
|
int f (int k, int p)
|
{
|
{
|
int pdest, j, D1361;
|
int pdest, j, D1361;
|
j = 0;
|
j = 0;
|
pdest = 0;
|
pdest = 0;
|
for (;;) {
|
for (;;) {
|
if (pdest > 2)
|
if (pdest > 2)
|
do
|
do
|
j--, pdest++;
|
j--, pdest++;
|
while (j > 2);
|
while (j > 2);
|
|
|
if (j == 1)
|
if (j == 1)
|
break;
|
break;
|
|
|
while (pdest > p)
|
while (pdest > p)
|
if (j == p)
|
if (j == p)
|
pdest++;
|
pdest++;
|
|
|
do
|
do
|
{
|
{
|
D1361 = W[k];
|
D1361 = W[k];
|
do
|
do
|
if (D1361 != 0)
|
if (D1361 != 0)
|
pdest = 1, W[k] = D1361 = 0;
|
pdest = 1, W[k] = D1361 = 0;
|
while (p < 1);
|
while (p < 1);
|
} while (k > 0);
|
} while (k > 0);
|
|
|
do
|
do
|
{
|
{
|
p = 0;
|
p = 0;
|
k = Link[k];
|
k = Link[k];
|
while (p < j)
|
while (p < j)
|
if (k != -1)
|
if (k != -1)
|
pdest++, p++;
|
pdest++, p++;
|
}
|
}
|
while (k != -1);
|
while (k != -1);
|
j = 1;
|
j = 1;
|
}
|
}
|
|
|
/* The correct return value should be pdest (1 in the call from main).
|
/* The correct return value should be pdest (1 in the call from main).
|
DOM3 is mistaken and propagates a 0 here. */
|
DOM3 is mistaken and propagates a 0 here. */
|
return pdest;
|
return pdest;
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
if (!f (0, 2))
|
if (!f (0, 2))
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.