libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] [patch] tests/: ia64-test-setjmp GCC compatibility


From: Jan Kratochvil
Subject: [Libunwind-devel] [patch] tests/: ia64-test-setjmp GCC compatibility
Date: Thu, 10 May 2007 22:50:13 +0200
User-agent: Mutt/1.4.2.2i

Hi,

the testcase fails when compiled on gcc-4.1 with optimizations (specific GCC
flags upon request).



2007-04-05  Jan Kratochvil  <address@hidden>

        * tests/ia64-test-setjmp.c (doit): New forward declaration.
        (doit_pointer): New function pointer variable initialized to DOIT.
        (doit): Self-call made by an unoptimizable volatile indirect call.

--- libunwind-git-clean/tests/ia64-test-setjmp.c        2007-03-08 
21:26:26.000000000 +0100
+++ libunwind-clean/tests/ia64-test-setjmp.c    2007-04-05 17:48:57.000000000 
+0200
@@ -70,6 +70,11 @@ sighandler (int signal, void *siginfo, v
   siglongjmp (env, 1);
 }
 
+/* Direct call of doit () at the end of doit () would get optimized by GCC to
+   a branch.  */
+static void doit (int n);
+static volatile void (*doit_pointer) (int n) = doit;
+
 static void
 doit (int n)
 {
@@ -96,7 +101,7 @@ doit (int n)
       return_bsp = bsp;
     }
   else
-    doit (n + 1);
+    (*doit_pointer) (n + 1);
 }
 
 int




reply via email to

[Prev in Thread] Current Thread [Next in Thread]