When a port is using hardware loops (like ARC) makes use of reorg_loops to find and analyze loops that end in loop_end instructions. The very same function can be set to reorder the cfg such that the loop end occurs after the loop start. This task is performed by reorder_loops function which at its turn calls cfg_layout_finalize -> fixup_reoreder_chain -> force_nonfallthru_and_redirect (cfgrtl.c:1476). However, the latter is splitting a call and its corresponding CALL_ARG_LOCATION note, leading to an assert in dwarf2out_var_location() at dwarf2out.c:26391.
Original post: https://gcc.gnu.org/ml/gcc/2017-11/msg00110.html Ok to apply? Claudiu gcc/ 2017-11-20 Claudiu Zissulescu <claz...@synopsys.com> * cfgrtl.c (force_nonfallthru_and_redirect): Don't split a call and its corresponding call arg location note. --- gcc/cfgrtl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index ae469088eec..d6e5ac05475 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -1626,6 +1626,11 @@ force_nonfallthru_and_redirect (edge e, basic_block target, rtx jump_label) else new_head = BB_END (e->src); new_head = NEXT_INSN (new_head); + /* Make sure we don't split a call and its corresponding + CALL_ARG_LOCATION note. */ + if (new_head && NOTE_P (new_head) + && NOTE_KIND (new_head) == NOTE_INSN_CALL_ARG_LOCATION) + new_head = NEXT_INSN (new_head); jump_block = create_basic_block (new_head, NULL, e->src); jump_block->count = count; -- 2.14.3