[Bug rtl-optimization/70222] Test miscompiled with -O1
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 14 11:03:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70222
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Yeah, it is combine.
First of all, the -1ULL >> (... * 15) is properly optimized into
(insn 12 11 13 2 (set (reg:DI 102)
(const_int 8589934591 [0x1ffffffff])) pr70222.c:9 85 {*movdi_internal}
(nil))
but the
(insn 13 12 14 2 (parallel [
(set (reg:SI 104 [ e ])
(lshiftrt:SI (subreg:SI (reg:DI 102) 0)
(const_int 31 [0x1f])))
(clobber (reg:CC 17 flags))
]) pr70222.c:9 562 {*lshrsi3_1}
(expr_list:REG_DEAD (reg:DI 102)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))))
which is supposed to yield 1 or 0 (in this case 1) is mis-simplified into:
(insn 13 12 14 2 (parallel [
(set (subreg:DI (reg:SI 104 [ e ]) 0)
(lshiftrt:DI (reg:DI 102)
(subreg:QI (reg:SI 101) 0)))
(clobber (reg:CC 17 flags))
]) pr70222.c:9 564 {*lshrdi3_1}
(expr_list:REG_DEAD (reg:SI 101)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_DEAD (reg:DI 102)
(nil)))))
More information about the Gcc-bugs
mailing list