https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121424
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So I was looking at this all the way wrong before.
Before we duplicate the return we have:
```
;; basic block 9, loop depth 0, count 114863531 (estimated locally, freq
1.0000), maybe hot
;; prev block 8, next block 1, flags: (REACHABLE, RTL, MODIFIED)
;; pred: 5 [always] count:55807731 (estimated locally, freq 0.4859)
;; 8 [11.0% (guessed)] count:6317494 (estimated locally, freq
0.0550) (FALLTHRU)
;; 7 [always] count:51114272 (estimated locally, freq 0.4450)
(LOOP_EXIT)
;; bb 9 artificial_defs: { }
;; bb 9 artificial_uses: { u-1(7){ }}
;; lr in 0 [ax] 7 [sp]
;; lr use 0 [ax] 7 [sp]
;; lr def
(code_label 66 62 69 9 1 (nil) [2 uses])
(note 69 66 68 9 [bb 9] NOTE_INSN_BASIC_BLOCK)
(insn 68 69 82 9 (use (reg/i:DI 0 ax)) "/app/example.cpp":20:1 -1
(nil))
;; succ: EXIT [always] count:114863531 (estimated locally, freq 1.0000)
(FALLTHRU)
;; lr out 0 [ax] 7 [sp]
```
Which is correct. Notice the correct line on the use.
But when we duplicate it for bb 5 and 8, we lose the line #:
BB5:
```
(note 35 32 6 5 [bb 5] NOTE_INSN_BASIC_BLOCK)
(insn 6 35 87 5 (set (reg/v/f:DI 0 ax [orig:103 <retval> ] [103])
(reg/v/f:DI 5 di [orig:104 path ] [104])) "/app/example.cpp":10:19 99
{*movdi_internal}
(nil))
(insn 87 6 77 5 (use (reg/i:DI 0 ax)) -1
(nil))
(jump_insn 77 87 78 5 (simple_return) 1493 {simple_return_internal}
(nil)
-> simple_return)
;; succ: EXIT [always] count:55807731 (estimated locally, freq 0.4859)
;; lr out 0 [ax] 7 [sp]
```
BB8 (becomes 7):
```
(note 79 44 88 7 [bb 7] NOTE_INSN_BASIC_BLOCK)
(insn 88 79 80 7 (use (reg/i:DI 0 ax)) -1
(nil))
(jump_insn 80 88 81 7 (simple_return) 1493 {simple_return_internal}
(nil)
-> simple_return)
;; succ: EXIT [always] count:51114272 (estimated locally, freq 0.4450)
(LOOP_EXIT)
;; lr out 0 [ax] 7 [sp]
```