http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52436
--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> 2013-04-04 12:07:53 UTC --- For the rest of the discussion, see the thread starting here: http://gcc.gnu.org/ml/gcc-patches/2013-04/msg00169.html In particular, the folding should be done in gimple only (most likely maybe_fold_reference) and test !is_gimple_reg().