re PR tree-optimization/36245 (internal compiler error: in build2_stat, at tree.c...
authorRichard Guenther <rguenther@suse.de>
Thu, 15 May 2008 14:09:11 +0000 (14:09 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 15 May 2008 14:09:11 +0000 (14:09 +0000)
2008-05-15  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/36245
* tree-ssa-address.c (add_to_parts): Deal with non-pointer
bases.

* gcc.c-torture/compile/pr36245.c: New testcase.

From-SVN: r135361

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr36245.c [new file with mode: 0644]

index c2af14e25bd245e7fbd955fc8f066e5394df9f5b..fae0f99623ba4da0a6e40bb039bb2bbf6605aaca 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-15  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/36245
+       * gcc.c-torture/compile/pr36245.c: New testcase.
+
 2008-05-15  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/loadpre7.c: Adjust scan for not performed
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr36245.c b/gcc/testsuite/gcc.c-torture/compile/pr36245.c
new file mode 100644 (file)
index 0000000..3759875
--- /dev/null
@@ -0,0 +1,21 @@
+extern char buf1[10];
+extern char buf2[10];
+extern void b(int i, int j, int w);
+
+void a() {
+    int i,j;
+    char *p;
+    int w;
+
+    p = buf1;
+    for(j = 0;j < 10; j++) {
+        for(i = 0;i < 10; i++) {
+            w = *p;
+            if(w != 1) {
+                w = buf2[p - buf1];
+                b(i*2+1, j, w);
+            }
+            p++;
+        }
+    }
+}