|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] gcc auto-omit-frame-pointer vs msvc longjmp |
Date: | Wed, 19 Oct 2011 15:19:33 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 |
On 10/19/2011 02:05 PM, Bob Breuer wrote: > Is it possible to force a > stackframe by just adding a suitable attribute to either the setjmp > function prototype, or the function which calls setjmp? The only thing I can think of that'll be portable to a large number of versions of GCC is { int n; char *p; asm("" : "=r"(n) : "0"(1)); p = __builtin_alloca(n); asm("" : : "r"(p)); } The first asm prevents constant propagation of the 1 to the alloca; the second asm prevents the alloca from being considered dead code. r~
[Prev in Thread] | Current Thread | [Next in Thread] |