Bernd Schmidt <ber...@codesourcery.com> writes:

> On 10/06/11 17:57, Ian Lance Taylor wrote:
>> There is absolutely no reason to try to shrink wrap that code.  It will
>> never help.  That code always has to be first.  It especially has to be
>> first because the gold linker recognizes the prologue specially when a
>> split-stack function calls a non-split-stack function, in order to
>> request a larger stack.
>
> Urgh, ok.
>
>> Therefore, it seems to me that we should apply shrink wrapping to the
>> function as it exists *before* the split-stack prologue is created.  The
>> flag_split_stack bit should be moved after the flag_shrink_wrap bit.
>
> Sounds like we just need to always emit the split prologue on the
> original entry edge then. Can you test the following with Go?

Unfortunately, that patch fails compiling libgo/runtime/go-map-len.c.
go-map-len.c is a C file, and actually quite a simple one.

../../../trunk/libgo/runtime/go-map-len.c: In function ‘__go_map_len’:
../../../trunk/libgo/runtime/go-map-len.c:23:1: error: in basic block 2:
../../../trunk/libgo/runtime/go-map-len.c:23:1: error: flow control insn inside 
a basic block
(jump_insn 38 37 39 2 (set (pc)
        (if_then_else (geu (reg:CC 17 flags)
                (const_int 0 [0]))
            (label_ref 43)
            (pc))) ../../../trunk/libgo/runtime/go-map-len.c:18 -1
     (expr_list:REG_DEAD (reg:CC 17 flags)
        (expr_list:REG_BR_PROB (const_int 9900 [0x26ac])
            (nil)))
 -> 43)
../../../trunk/libgo/runtime/go-map-len.c:23:1: internal compiler error: in rtl_
verify_flow_info_1, at cfgrtl.c:2001
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Note that you can test Go yourself by adding --enable-languages=go to
your configure line.  Nothing special is required to build Go.  It works
better if you use the gold linker but that is not required.

Ian

Reply via email to