This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386]: Expand sibling-tail-calls via accumulator register


In testcase a NULL escaped ...

ChangeLog testsuite

2014-05-31  Kai Tietz  <ktietz@redhat.com>

    * gcc.target/i386/sibcall-6.c: New test.

Index: gcc.target/i386/sibcall-6.c
===================================================================
--- gcc.target/i386/sibcall-6.c    (Revision 0)
+++ gcc.target/i386/sibcall-6.c    (Arbeitskopie)
@@ -0,0 +1,37 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ia32 } */
+/* { dg-options "-O2" } */
+
+typedef void *ira_loop_tree_node_t;
+
+extern int end (int);
+extern int doo (int);
+
+void
+ira_traverse_loop_tree (int bb_p, ira_loop_tree_node_t loop_node,
+                        void (*preorder_func) (ira_loop_tree_node_t),
+                        void (*postorder_func) (ira_loop_tree_node_t))
+{
+  int l, r = 0x1, h = 0, j = 0;
+
+  if (preorder_func)
+    (*preorder_func) (loop_node);
+
+  if (bb_p)
+    {
+      for (l = 0; l < end (l); l++)
+        {
+          r += doo (l);
+          h += (l + 1) * 3;
+          h %= (l + 1);
+          r -= doo (h);
+          j += (l + 1) * 7;
+          j %= (l + 1);
+          r += doo (j);
+        }
+    }
+
+  if (postorder_func)
+    (*postorder_func) (loop_node);
+}
+/* { dg-final { scan-assembler "jmp[ \t]*.%eax" } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]