diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gcc.dg/20040609-1.c | |
download | cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.bz2 cbb-gcc-4.6.4-15d2061ac0796199866debe9ac87130894b0cdd3.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig;
imported gcc-4.6.4 source tree from verified upstream tarball.
downloading a git-generated archive based on the 'upstream' tag
should provide you with a source tree that is binary identical
to the one extracted from the above tarball.
if you have obtained the source via the command 'git clone',
however, do note that line-endings of files in your working
directory might differ from line-endings of the respective
files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gcc.dg/20040609-1.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/20040609-1.c | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/20040609-1.c b/gcc/testsuite/gcc.dg/20040609-1.c new file mode 100644 index 000000000..ef181476e --- /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 (); +} |