diff options
author | Richard Biener <rguenther@suse.de> | 2013-04-03 10:36:49 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-04-03 10:36:49 +0000 |
commit | a5cde067925a0f47195b39cb595be5ef50a977c9 (patch) | |
tree | 4e838f244eed4c8f204424a270e9ce3ad9629bf7 | |
parent | 47309fc03c663c43dd722c2bcfdf421aa2403659 (diff) | |
download | gcc-a5cde067925a0f47195b39cb595be5ef50a977c9.zip gcc-a5cde067925a0f47195b39cb595be5ef50a977c9.tar.gz gcc-a5cde067925a0f47195b39cb595be5ef50a977c9.tar.bz2 |
re PR tree-optimization/55964 (Segmentation fault with -O -ftree-loop-distribution -funswitch-loops)
2013-04-03 Richard Biener <rguenther@suse.de>
PR tree-optimization/55964
* gcc.dg/torture/pr55964-2.c: New testcase.
From-SVN: r197403
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr55964-2.c | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 71ae751..b21cba4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2013-04-03 Richard Biener <rguenther@suse.de> + PR tree-optimization/55964 + * gcc.dg/torture/pr55964-2.c: New testcase. + +2013-04-03 Richard Biener <rguenther@suse.de> + PR tree-optimization/56501 * gcc.dg/torture/pr56501.c: New testcase. diff --git a/gcc/testsuite/gcc.dg/torture/pr55964-2.c b/gcc/testsuite/gcc.dg/torture/pr55964-2.c new file mode 100644 index 0000000..a3bd09d --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr55964-2.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-options "-ftree-loop-distribution -funswitch-loops" } */ + +struct test_struct { + int a, b[10], c[10], d[10]; +}; + +extern struct test_struct* new_struct; + +void testfunc(struct test_struct* old_struct) +{ + int i; + for (i = 0; i < 10; ++i) + { + new_struct->b[i] = old_struct ? old_struct->b[i] : -1; + new_struct->c[i] = old_struct ? old_struct->c[i] : 0; + new_struct->d[i] = old_struct ? old_struct->d[i] : 0; + } + if (old_struct) + old_struct->a++; +} |