http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52060
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-06 17:44:36 UTC --- Created attachment 26586 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26586 gcc47-pr52060.patch I think the important question is if it is ok that combine_simplify_rtx may modify the given rtl in place, as opposed to keeping it unmodified and just allocating new rtx and returning it. A brief look at combine.c suggests that SUBST () is used in so many places that it is meant to be ok to modify it in place. Then we for added_sets_{1,2} should just make copies of i1src resp. i0src upfront, which means perhaps slightly bigger amount of GC, but at least it won't miscompile things. If the modification in place is undesirable, then e.g. force_to_mode is something that modifies rtx in place very deep into it. This untested fix cures the testcase on a cross to arm.