From 20c861589a94acba341dae22cc6a06f716c32c61 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Wed, 13 Jul 2005 14:24:59 +0000 Subject: [PATCH] New testcase From-SVN: r101968 --- gcc/testsuite/gcc.c-torture/compile/pr22422.c | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 gcc/testsuite/gcc.c-torture/compile/pr22422.c diff --git a/gcc/testsuite/gcc.c-torture/compile/pr22422.c b/gcc/testsuite/gcc.c-torture/compile/pr22422.c new file mode 100644 index 0000000..bc176f9 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr22422.c @@ -0,0 +1,30 @@ +/* We should not crash trying to figure out the points-to sets for the below. We used to because we + ended up adding pointers to the points-to set of the ANYTHING variable. */ +struct D +{ + int n; + int c [8]; +}; + +struct A +{ + int i; + char *p; +}; + +struct B +{ + struct A *a; + struct D *d; +}; + +int dtInsert1 (struct B *b) +{ + struct A a = { 0, 0 }; + struct D *d; + b->a = &a; + d = b->d; + &d->c [d->n]; + return 0; +} + -- 2.7.4