aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-02-07 13:42:52 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-02-07 13:42:52 +0000
commitcb6b911a63724d5efd5b48b9ae0dac09c3060e85 (patch)
tree0fbca980303c232d16d4c5e497733ca6ff9c94ae /gcc/testsuite/gcc.c-torture
parentf41e0f10464c060e928927c5272a360c31a48093 (diff)
downloadgcc-cb6b911a63724d5efd5b48b9ae0dac09c3060e85.zip
gcc-cb6b911a63724d5efd5b48b9ae0dac09c3060e85.tar.gz
gcc-cb6b911a63724d5efd5b48b9ae0dac09c3060e85.tar.bz2
re PR tree-optimization/42956 (internal compiler error: Segmentation fault with -O1)
2010-02-07 Richard Guenther <rguenther@suse.de> PR middle-end/42956 * gimplify.c (gimple_fold_indirect_ref): Avoid generating new ARRAY_REFs on variable size element or minimal index arrays. Complete. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Use gimple_fold_indirect_ref. * gcc.c-torture/compile/pr42956.c: New testcase. From-SVN: r156571
Diffstat (limited to 'gcc/testsuite/gcc.c-torture')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr42956.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr42956.c b/gcc/testsuite/gcc.c-torture/compile/pr42956.c
new file mode 100644
index 0000000..f592d4b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr42956.c
@@ -0,0 +1,33 @@
+typedef const int cint;
+typedef struct {
+} Bounds;
+int ndim_, ncomp_, selectedcomp_, nregions_;
+void *voidregion_;
+typedef struct {
+ double diff, err, spread;
+} Errors;
+typedef const Errors cErrors;
+void Split(int iregion, int depth, int xregion)
+{
+ typedef struct {
+ double avg, err, spread, chisq;
+ double xmin[ndim_], xmax[ndim_];
+ } Result;
+ typedef struct region {
+ Result result[ncomp_];
+ } Region;
+ Errors errors[ncomp_];
+ int comp, ireg, xreg;
+ for( ireg = iregion, xreg = xregion; ireg < nregions_; ireg = xreg++ )
+ {
+ Result *result = ((Region *)voidregion_)[ireg].result;
+ for( comp = 0; comp < ncomp_; ++comp )
+ {
+ Result *r = &result[comp];
+ cErrors *e = &errors[comp];
+ double c = e->diff;
+ if( r->err > 0 ) r->err = r->err*e->err + c;
+ }
+ }
+}
+