re PR rtl-optimization/13521 ([3.3 only] Endless loop in calculate_global_regs_live)

PR optimization/13521
	* gcc.c-torture/compile/20031231-1.c: New test.

From-SVN: r75301
This commit is contained in:
Jakub Jelinek 2004-01-01 14:21:18 +01:00 committed by Jakub Jelinek
parent 837b841791
commit 74aa338ad5
2 changed files with 56 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2004-01-01 Jakub Jelinek <jakub@redhat.com>
PR optimization/13521
* gcc.c-torture/compile/20031231-1.c: New test.
2003-12-30 Kazu Hirata <kazu@cs.umass.edu>
* gcc.dg/sibcall-4.c: Replace mn10?00 with mn10300.

View file

@ -0,0 +1,51 @@
extern int f1 (int, void *);
extern int *f2 (void) __attribute__ ((__const__));
extern int f3 (int, void *);
int
test (int x, char *y, int z)
{
int b = 0;
if (x < 1024)
{
y[0] = '\0';
do
{
switch (f1 (x, y + b))
{
case -1:
if (b == 0)
return -1;
else
return b;
default:
b++;
}
}
while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z);
}
else
{
do
{
switch (f3 (x, y + b))
{
case -1:
if ((*f2 ()) == 4)
continue;
if (b == 0)
return -1;
else
return b;
default:
b++;
}
}
while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z);
}
return b;
}