https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125375
--- Comment #4 from Drea Pinski <pinskia at gcc dot gnu.org> ---
The only difference is.
Not working:
```
(code_label 83 137 84 16 2 (nil) [4 uses])
(note 84 83 85 16 [bb 16] NOTE_INSN_BASIC_BLOCK)
(insn 85 84 86 16 (clobber (reg/i:SI 0 ax)) "/app/example.cpp":22:1 -1
(nil))
(insn 86 85 138 16 (clobber (reg:SI 0 ax [orig:133 <retval> ] [133]))
"/app/example.cpp":22:1 -1
(nil))
(jump_insn 138 86 139 16 (set (pc)
(label_ref 97)) "/app/example.cpp":22:1 1483 {jump}
(nil)
-> 97)
```
vs working:
```
(code_label 83 137 84 16 2 (nil) [4 uses])
(note 84 83 86 16 [bb 16] NOTE_INSN_BASIC_BLOCK)
(insn 86 84 138 16 (clobber (reg:SI 0 ax [orig:133 <retval> ] [133]))
"/app/example.cpp":22:1 -1
(nil))
(jump_insn 138 86 139 16 (set (pc)
(label_ref 97)) "/app/example.cpp":22:1 1483 {jump}
(nil)
-> 97)
```
So it is not even cmpelim doing anything about compares but rather just
removing the extra clobber here which allows the code to work.
There seems to be an extra jump threading happening on the working case even.