From: Jakub Jelinek Date: Thu, 10 Jun 2004 08:43:16 +0000 (+0200) Subject: re PR target/15569 (Gcc 3.4.1 failed to build ia64 2.6.6 kernel) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ba20a3eb0940651ab036d0694999176ce31f4db2;p=gcc.git re PR target/15569 (Gcc 3.4.1 failed to build ia64 2.6.6 kernel) PR target/15569 PR rtl-optimization/15681 * gcc.dg/20040609-1.c: New test. From-SVN: r82908 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ed2a56c9ec7..eddcfcf6269 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-06-10 Jakub Jelinek + + PR target/15569 + PR rtl-optimization/15681 + * gcc.dg/20040609-1.c: New test. + 2004-06-10 Jakub Jelinek PR c++/14791 diff --git a/gcc/testsuite/gcc.dg/20040609-1.c b/gcc/testsuite/gcc.dg/20040609-1.c new file mode 100644 index 00000000000..ef181476e37 --- /dev/null +++ b/gcc/testsuite/gcc.dg/20040609-1.c @@ -0,0 +1,73 @@ +/* PRs target/15569, rtl-optimization/15681 */ +/* { dg-do compile } */ +/* { dg-options "-Os -frename-registers" } */ +/* { dg-options "-mconstant-gp -Os -frename-registers" { target ia64-*-* } } */ + +struct S { struct S *a, *b; }; +struct T { struct S e; unsigned long a; int b, c; void *d; } f; + +unsigned long f1 (unsigned long); +void f2 (int, struct T *); +void *f3 (void *); +unsigned long volatile g; + +static void +f4 (struct T *p) +{ + f1 (f1 (((unsigned long) g - p->a) >> 20)); +} + +static struct T * +f5 (void) +{ + struct T *g, *p; + struct T *q = 0; + for (g = p = &f; (g = p = (struct T *) (g->e.a)) != &f;) + if (p->b) + { + f4 (p); + if (p->c & 0x80000) + return p; + } + return q; +} + +static void +f6 (struct T *p) +{ + f2 (9, p); +} + +static inline void * +f7 (struct T *t) +{ + void *d; + d = t->d; + if (d) + d = f3 (d); + return d; +} + +static void * +f8 (struct T *p) +{ + void *d = f7 (p); + if (!d) + return 0; + f6 (p); + return d; +} + +static void +f9 (void) +{ + struct T *p; + p = f5 (); + f8 (p); +} + +void +test (void) +{ + f9 (); +}