From 565ffdb75c36b7ba190610b5033f4986fd87e3b9 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 16 May 2007 13:30:12 -0600 Subject: [PATCH] 2007-04-05 Jan Kratochvil * 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. --- tests/ia64-test-setjmp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/ia64-test-setjmp.c b/tests/ia64-test-setjmp.c index 74bb4b42..9bcc50c2 100644 --- a/tests/ia64-test-setjmp.c +++ b/tests/ia64-test-setjmp.c @@ -70,6 +70,11 @@ sighandler (int signal, void *siginfo, void *sigcontext) 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