[Bug middle-end/34627] Incorrect branching with -Ox on hppa
steven at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Sun Feb 3 12:27:00 GMT 2008
------- Comment #8 from steven at gcc dot gnu dot org 2008-02-03 12:26 -------
We call try_combine() with the following insns:
i1:
(insn 8 7 9 2 t.c:4 (set (reg/v:SI 94 [ i ])
(reg:SI 28 %r28)) 37 {*pa.md:2542} (expr_list:REG_DEAD (reg:SI 28 %r28)
(nil)))
i2:
(insn 31 10 32 2 t.c:5 (set (reg:SI 101)
(neg:SI (reg/v:SI 94 [ i ]))) 136 {negsi2} (nil))
i3:
(insn 32 31 16 2 t.c:5 (set (reg/v:SI 94 [ i ])
(if_then_else:SI (ge (reg/v:SI 94 [ i ])
(reg:SI 98))
(reg:SI 101)
(reg/v:SI 94 [ i ]))) 24 {*pa.md:1388} (expr_list:REG_DEAD (reg:SI
101)
(expr_list:REG_DEAD (reg:SI 98)
(nil))))
At this point, r98 holds the value -10000. In i1 the returned result of ret1()
is loaded into "i".
Somehow combine decides that the above sequence is equal to "i = abs(i)",
losing the comparison to -10000 as if it is a comparison against zero.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34627
More information about the Gcc-bugs
mailing list