From 74aa338ad540b76f8d8566c996642b02810f5c14 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 1 Jan 2004 14:21:18 +0100 Subject: 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 --- gcc/testsuite/ChangeLog | 5 +++ gcc/testsuite/gcc.c-torture/compile/20031231-1.c | 51 ++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/20031231-1.c (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index af9fabf..17e5580 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-01-01 Jakub Jelinek + + PR optimization/13521 + * gcc.c-torture/compile/20031231-1.c: New test. + 2003-12-30 Kazu Hirata * gcc.dg/sibcall-4.c: Replace mn10?00 with mn10300. diff --git a/gcc/testsuite/gcc.c-torture/compile/20031231-1.c b/gcc/testsuite/gcc.c-torture/compile/20031231-1.c new file mode 100644 index 0000000..bbd8e7c --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20031231-1.c @@ -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; +} -- cgit v1.1