http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50891
Bug #: 50891 Summary: move2add_note_store fails to properly track register content Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: hjl.to...@gmail.com There are (insn 18 323 318 2 (set (reg:DI 2 cx [orig:110 MEM[(c_char * {ref-all})&A.0]+8 ] [110]) (mem/s/u/c:DI (const:SI (plus:SI (symbol_ref:SI ("A.0.1724") [flags 0x2] <var_decl 0x7ffff1435460 A.0>) (const_int 8 [0x8]))) [0 MEM[(c_char * {ref-all})&A.0]+8 S8 A64])) x.f90:7 62 {*movdi_internal_rex64} (expr_list:REG_EQUIV (mem/s/u/c:DI (const:SI (plus:SI (symbol_ref:SI ("A.0.1724") [flags 0x2] <var_decl 0x7ffff1435460 A.0>) (const_int 8 [0x8]))) [0 MEM[(c_char * {ref-all})&A.0]+8 S8 A64]) (nil))) .... (insn 73 71 74 11 (set (reg:SI 2 cx [125]) (const_int 16 [0x10])) x.f90:12 64 {*movsi_internal} (expr_list:REG_EQUAL (const_int 16 [0x10]) (nil))) For some reason, move2add_use_add2_insn replaces it with (insn 73 71 74 11 (set (strict_low_part (reg:QI 2 cx)) (const_int 16 [0x10])) x.f90:12 81 {*movstrictqi_1} (expr_list:REG_EQUAL (const_int 16 [0x10]) (nil))) The problem is the upper 48bits of CX isn't zero.