https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86979
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abel at gcc dot gnu.org, | |amonakov at gcc dot gnu.org --- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Aha, I had to use -fpic additionally in my cross. Seems like sel-sched bug to me. In *.split4 we still have correct: (insn/f 71 9 72 2 (parallel [ (set (reg/f:SI 7 sp) (plus:SI (reg/f:SI 7 sp) (const_int -12 [0xfffffffffffffff4]))) (clobber (reg:CC 17 flags)) (clobber (mem:BLK (scratch) [0 A8])) ]) "pr69102.c":8:1 954 {pro_epilogue_adjust_stack_si_add} (expr_list:REG_UNUSED (reg:CC 17 flags) (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI 7 sp) (plus:SI (reg/f:SI 7 sp) (const_int -12 [0xfffffffffffffff4]))) (nil)))) in prologue at the start of function, then body including a tablejump and finally (insn 48 47 49 5 (parallel [ (set (reg/f:SI 7 sp) (plus:SI (reg/f:SI 7 sp) (const_int -12 [0xfffffffffffffff4]))) (clobber (reg:CC 17 flags)) ]) "pr69102.c":22:3 190 {*addsi_1} (expr_list:REG_UNUSED (reg:CC 17 flags) (expr_list:REG_ARGS_SIZE (const_int 12 [0xc]) (nil)))) (insn 49 48 50 5 (set (mem:SI (pre_dec:SI (reg/f:SI 7 sp)) [1 S4 A32]) (reg/v:SI 0 ax [orig:84 ch ] [84])) "pr69102.c":22:3 43 {*pushsi2} (expr_list:REG_DEAD (reg/v:SI 0 ax [orig:84 ch ] [84]) (expr_list:REG_ARGS_SIZE (const_int 16 [0x10]) (nil)))) (call_insn 50 49 73 5 (call (mem:QI (symbol_ref:SI ("bar") [flags 0x41] <function_decl 0x7f9013919900 bar>) [0 bar S1 A8]) (const_int 16 [0x10])) "pr69102.c":22:3 663 {*call} (nil) (nil)) (note 73 50 74 5 NOTE_INSN_EPILOGUE_BEG) (insn/f 74 73 75 5 (parallel [ (set (reg/f:SI 7 sp) (plus:SI (reg/f:SI 7 sp) (const_int 28 [0x1c]))) (clobber (reg:CC 17 flags)) (clobber (mem:BLK (scratch) [0 A8])) ]) "pr69102.c":23:1 954 {pro_epilogue_adjust_stack_si_add} (expr_list:REG_ARGS_SIZE (const_int 0 [0]) (expr_list:REG_UNUSED (reg:CC 17 flags) (expr_list:REG_CFA_ADJUST_CFA (set (reg/f:SI 7 sp) (plus:SI (reg/f:SI 7 sp) (const_int 12 [0xc]))) (nil))))) (jump_insn 75 74 78 5 (simple_return) "pr69102.c":23:1 686 {simple_return_internal} (nil) as the only stack-changing instructions. But sel-sched for some reason copies the sp adjustment (insn 48) above to a different basic block before the tablejump and due to that copy there is a basic block reachable from code with different stack depths (i.e. different CFA offset), the initial one from right after the prologue and the adjusted one due to this sel-sched bug.