aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2004-01-01 14:21:18 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2004-01-01 14:21:18 +0100
commit74aa338ad540b76f8d8566c996642b02810f5c14 (patch)
treec95db00ef5090b573ee79500af1e4d5c2efd063a
parent837b841791d5a6c96183d57e9fa746a43591e87e (diff)
downloadgcc-74aa338ad540b76f8d8566c996642b02810f5c14.zip
gcc-74aa338ad540b76f8d8566c996642b02810f5c14.tar.gz
gcc-74aa338ad540b76f8d8566c996642b02810f5c14.tar.bz2
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
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031231-1.c51
2 files changed, 56 insertions, 0 deletions
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 <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.
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;
+}