[Qemu-devel] gcc auto-omit-frame-pointer vs msvc longjmp

Kai Tietz ktietz70@googlemail.com
Tue Oct 25 05:40:00 GMT 2011


2011/10/24 Richard Henderson <rth@twiddle.net>:
> On 10/24/2011 09:18 AM, Kai Tietz wrote:
>> A possible patch for 4.6 gcc versions I attached to this mail.
>
> ...
>
>> +/* For 32-bit Windows we need valid frame-pointer for function using
>> +   setjmp.  */
>> +#define SUBTARGET_SETJMP_NEED_FRAME_POINTER \
>> +  (!TARGET_64BIT && cfun->calls_setjmp)
>> +
>> Index: i386.c
>> ===================================================================
>> --- i386.c      (revision 180393)
>> +++ i386.c      (working copy)
>> @@ -8741,6 +8741,12 @@
>>    if (SUBTARGET_FRAME_POINTER_REQUIRED)
>>      return true;
>>
>> +#ifdef SUBTARGET_SETJMP_NEED_FRAME_POINTER
>> +  /* For older 32-bit runtimes setjmp requires valid frame-pointer.  */
>> +  if (SUBTARGET_SETJMP_NEED_FRAME_POINTER)
>> +    return true;
>> +#endif
>
> Why not just use SUBTARGET_FRAME_POINTER_REQUIRED here?
>
>
> r~

Sure, this is even more easy.  SUBTARGET_FRAME_POINTER_REQUIRED is
just defined on i386-architectures for linux OSes, so for
Windows-targets we still can use it.

Kai



More information about the Gcc-patches mailing list