Skip to content

Commit 0067bad

Browse files
author
Paul Iannetta
committed
kvx: fix -fchecking error with stack-limit-register=sr
Summary: The code_label was floating above the `stack error' basic block. gcc/ChangeLog: * config/kvx/kvx-prologue-stack-limit.cc (kvx_prologue_stack_limit): Proprely set BB_HEAD and BB_END; add a barrier at the end of the basic block. Test Plan: CI Reviewers: bpriour, bddinechin, O11 gcc Reviewed By: bpriour, bddinechin, O11 gcc Differential Revision: https://phab.kalray.eu/D37148
1 parent 1fed32e commit 0067bad

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

gcc/config/kvx/kvx-prologue-stack-limit.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,13 @@ kvx_prologue_stack_limit (function *fun)
132132
insn
133133
= emit_label_before (trap_label,
134134
get_last_bb_insn (stack_overflow_handler));
135+
BB_HEAD (stack_overflow_handler) = insn;
135136
insn = emit_call_insn_after (gen_call (handler, const0_rtx),
136137
get_last_bb_insn (stack_overflow_handler));
137138
add_reg_note (insn, REG_ARGS_SIZE, const0_rtx);
138139
add_reg_note (insn, REG_NORETURN, NULL_RTX);
140+
emit_barrier_after (insn);
141+
BB_END (stack_overflow_handler) = insn;
139142

140143
e1 = make_edge (pre_prologue, stack_overflow_handler, 0);
141144

0 commit comments

Comments
 (0)