[PATCH] Add support for the Win32 hook prologue (try 5)

Richard Henderson rth@redhat.com
Wed Sep 23 15:21:00 GMT 2009


On 09/23/2009 05:02 AM, Stefan Dösinger wrote:
> Am Tuesday 22 September 2009 23:20:12 schrieb Richard Henderson:
>> static_chain_on_stack will only ever be true for nested functions.
>> You should not need to apply this attribute to a nested function,
>> as such functions are never exported.
>>
>> You could change handle_abi_attribute to reject this attribute
>> for nested functions by checking decl_function_context (*node) == NULL.
> This doesn't seem to work. I added this:
>
> if (decl_function_context (*node) == NULL)
>    {
>      error ("ms_hook_prologue is not compatible with nested functions");
>    }
>
> in ix86_handle_abi_attribute, but when I try to compile a function with this
> attribute I get this error:
>
> test.c:2:1: internal compiler error: tree check: expected tree that
> contains 'decl minimal' structure, have 'function_type' in
> decl_function_context, at tree.c:7993
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See<http://gcc.gnu.org/bugs.html>  for instructions.

Ah, this is because for some reason you've configured the attribute to 
apply to the function's type, rather than the function itself.  This is 
a mistake, I think, since there's nothing about the attribute that 
changes its calling conventions.

Try switching the attribute table to

   { "ms_hook_thingy", 0, 0, true, false, false, new_function }


r~



More information about the Gcc-patches mailing list