http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54963
Kazumoto Kojima <kkojima at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olegendo at gcc dot gnu.org Component|middle-end |target Summary|Wrong code generated for |[4.8 Regression] Wrong code |libgfortran/generated/eoshi |generated for |ft3_8.c on SH |libgfortran/generated/eoshi | |ft3_8.c on SH --- Comment #1 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-10-20 06:33:06 UTC --- It looks that the problematic code run through a wrong flow and the above was misleading. It seems that the change r184829 | olegendo | 2012-03-03 06:21:13 +0900 (Sat, 03 Mar 2012) | 8 lines PR target/49486 * config/sh/sh.md (negdi2): Add TARGET_SH1 condition. (absdi2): New expander. (*absdi2, *negabsdi2, negdi_cond): New insns and splits. * gcc.target/sh/pr49468-si.c: Skip unsupported test for SH64. * gcc.target/sh/pr49468-di.c: New. causes this. After reload, there is an insn for abs(sh): (insn 432 431 1393 39 (set (reg:DI 2 r2) (abs:DI (reg:DI 1 r1))) eoshift.c:167 189 {*absdi2} (nil)) which is splitted into (insn 1607 431 1609 39 (set (reg:SI 147 t) (ge:SI (reg:SI 2 r2 [+4 ]) (const_int 0 [0]))) eoshift.c:167 13 {cmpgesi_t} (nil)) (insn 1609 1607 1610 39 (set (reg:SI 2 r2) (reg:SI 1 r1)) eoshift.c:167 234 {movsi_ie} (nil)) (insn 1610 1609 1611 39 (set (reg:SI 3 r3 [+4 ]) (reg:SI 2 r2 [+4 ])) eoshift.c:167 234 {movsi_ie} (nil)) (jump_insn 1611 1610 1626 39 (set (pc) (if_then_else (ne (reg:SI 147 t) (const_int 0 [0])) ... The insn 1609 changes r2 before its original value is used.