http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47255
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-11 12:38:09 UTC --- There is a duplicate somewhere for this bug. Inlining happens before any CSE is done which is what you see. If you remove the side-effect the multiplications will be CSEd instead after inlining.