re PR tree-optimization/13761 ([tree-ssa] component refs to the same struct should...
authorRichard Guenther <rguenther@suse.de>
Fri, 14 Mar 2008 17:45:20 +0000 (17:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 14 Mar 2008 17:45:20 +0000 (17:45 +0000)
2008-03-14  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/13761
* gcc.dg/tree-ssa/ssa-lim-3.c: New testcase.

From-SVN: r133224

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c [new file with mode: 0644]

index f93230a95ae6006d688255ca90db282fe50173d3..93b5b842d8e51259e935440342d77ab56d702373 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-14  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/13761
+       * gcc.dg/tree-ssa/ssa-lim-3.c: New testcase.
+
 2008-03-14  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/34172
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-lim-3.c
new file mode 100644 (file)
index 0000000..bfd8692
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-lim-details -fdump-tree-optimized" } */
+
+struct { int x; int y; } global;
+void foo(int n)
+{
+  int i;
+  for ( i=0; i<n; i++)
+    global.y += global.x*global.x;
+}
+
+/* { dg-final { scan-tree-dump "Executing store motion of global.y" "lim" } } */
+/* { dg-final { scan-tree-dump "Moving statement.*global.x.*out of loop 1" "lim" } } */
+/* { dg-final { cleanup-tree-dump "lim" } } */