http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50078
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Status|ASSIGNED |NEW Component|tree-optimization |rtl-optimization Known to work| |4.5.3 AssignedTo|rguenth at gcc dot gnu.org |unassigned at gcc dot | |gnu.org Target Milestone|--- |4.6.2 Summary|[4.6.1+ SVN 2011-08-13] ARM |[4.6/4.7 Regression] |wrong code: volatile |combine wrong code: |accesses optimized out |volatile accesses optimized | |out --- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-15 09:11:50 UTC --- Actually I was wrong guessing - the tree level is fine, it is combine that removes the "noop" move completely: Trying 6 -> 11: Failed to match this instruction: (set (mem/s:SI (plus:DI (ashiftrt:DI (mult:DI (subreg:DI (reg/v:SI 60 [ arg ]) 0) (const_int 4294967296 [0x100000000])) (const_int 30 [0x1e])) (symbol_ref:DI ("var") <var_decl 0x7ffff7ee3140 var>)) [2 var S4 A32]) (mem/s/v:SI (plus:DI (ashiftrt:DI (mult:DI (subreg:DI (reg/v:SI 60 [ arg ]) 0) (const_int 4294967296 [0x100000000])) (const_int 30 [0x1e])) (symbol_ref:DI ("var") <var_decl 0x7ffff7ee3140 var>)) [2 var S4 A32])) rejecting combination of insns 6 and 11 original costs 4 + 9 = 13 replacement cost 31 deleting noop move 11 Confirmed on x86_64 as well.