This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/41246] should "sorry" when regparm=3 and nested functions are encountered
- From: "rth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Sep 2009 21:23:35 -0000
- Subject: [Bug target/41246] should "sorry" when regparm=3 and nested functions are encountered
- References: <bug-41246-12496@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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