On 01/08/2016 02:23 PM, Jakub Jelinek wrote:
4) compgotos moves things around even further:
...
(jump_insn 118 99 91 5 (simple_return) -1
(nil)
-> simple_return)
;; succ: EXIT [100.0%]
;; lr out 0 [r0] 2 [r2] 4 [r4] 13 [sp] 14 [lr]
;; live out 0 [r0] 2 [r2] 4 [r4] 13 [sp] 14 [lr]
(note 91 118 92 NOTE_INSN_DELETED)
(note 92 91 102 NOTE_INSN_DELETED)
(barrier 102 92 24)
;; basic block 6, loop depth 0, count 0, freq 1146, maybe hot
I think we're still OK at this point. Code that assumes the barrier
immediately follows the jump has always been a bit iffy. Certainly it
was the case back in 2001 when Jan/Andreas J. added this code that they
were seeing cases where code made those assumptions, but they were not
true/valid assumptions.
It may be the case that the "old code" referred to by that comment is no
longer around, but in the absence of an official "there must be nothing
between the jump & any associated barrier", the safe thing to do is
assume there may be notes and multiple barriers and handle them correctly.
jeff