This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/41246] should "sorry" when regparm=3 and nested functions are encountered



------- Comment #14 from rth at gcc dot gnu dot org  2009-09-09 21:23 -------
Not working on it yet, but I think it should be possible to have the
static chain pushed to the stack by the trampoline.  Direct calls to
the nested function would have to pass the static chain in a call
saved register.  The nested function would have to be emitted like:

nested_func:
  push %esi
.Lnested_func_tramp_entry:
  push %ebp
  movl %esp, %ebp
  ...

trampoline:
  pushl $static_chain
  jmpl .Lnested_func_tramp_entry

Thankfully, "pushl $const" and "movl $const, reg" are the same size.

This involves adjusting a number of elimination offsets, rearranging the
middle-end such that it allows different static chain locations based on
the target function, rearranging the INITIALIZE_TRAMPOLINE macro so that
it passes in the target function.  Hopefully with all the macros turned
into proper target hooks at the same time.

The one potential problem with this approach is that -fno-omit-frame-pointer
backtraces break.  However, dwarf2 unwinding would still work.


-- 

rth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41246


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]