diff options
author | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-28 16:47:55 +0000 |
---|---|---|
committer | jamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-28 16:47:55 +0000 |
commit | 77318e00be94a02ab59a5fee430bd5b1b0de5880 (patch) | |
tree | 7f5474e587011fe850696418c42a153f09e865dd /gcc/testsuite/gcc.dg/ipa | |
parent | 16ac1565a5e2535909827ed5a0ce26a9fd6944cd (diff) | |
download | gcc-77318e00be94a02ab59a5fee430bd5b1b0de5880.tar.gz |
2010-06-26 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (convert_callers): New parameter, change fndecls of
recursive calls.
(modify_function): Pass the old decl to convert_callers.
* testsuite/gcc.dg/ipa/ipa-sra-6.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161503 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/ipa')
-rw-r--r-- | gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c new file mode 100644 index 00000000000..c9a766d9e8f --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-6.c @@ -0,0 +1,32 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fipa-sra -fdump-tree-eipa_sra-slim" } */ + +struct bovid +{ + float a; + int b; + struct bovid *next; +}; + +static int +__attribute__((noinline)) +foo (struct bovid *cow, int i) +{ + i++; + if (cow->next) + foo (cow->next, i); + return i; +} + +int main (int argc, char *argv[]) +{ + struct bovid cow; + + cow.a = 7.4; + cow.b = 6; + cow.next = (struct bovid *) 0; + + return foo (&cow, 0); +} + +/* { dg-final { scan-tree-dump-times "foo " 1 "eipa_sra" } } */ |