[Bug rtl-optimization/68194] [6 Regression] wrong code at -O2 and -O3 on x86_64-linux-gnu
ktkachov at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Nov 16 11:08:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68194
--- Comment #5 from ktkachov at gcc dot gnu.org ---
The different if-conversion behaviour enabled a new cse opportunity
which then produced the RTL that triggered the bad ree behaviour.
The relevant RTL insns before the ree pass look like:
Basic Block A:
(set (reg:HI 0 ax)
(mem:HI (symbol_ref:DI ("f"))))
...
(set (reg:SI 3 bx)
(if_then_else:SI (eq (reg:CCZ 17 flags)
(const_int 0))
(reg:SI 0 ax)
(reg:SI 3 bx)))
(set (reg:SI 4 si)
(sign_extend:SI (reg:HI 3 bx)))
...
Basic block B (dominated by basic block A):
(set (reg:SI 4 si)
(sign_extend:SI (reg:QI 0 ax))) /* ax contains symbol "f". */
ree changes that into the broken:
Basic block A:
(set (reg:SI 4 si)
(sign_extend:SI (mem:HI (symbol_ref:DI ("f")))))
(set (reg:SI 3 bx)
(reg:SI 4 si))
...
(set (reg:SI 3 bx)
(if_then_else:SI (eq (reg:CCZ 17 flags)
(const_int 0 [0]))
(reg:SI 0 ax)
(reg:SI 3 bx)))
...
Basic block B:
(set (reg:SI 4 si)
(sign_extend:SI (reg:QI 0 ax))) /* Insn unchanged by ree, but ax now
undefined. */
More information about the Gcc-bugs
mailing list