http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55752
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2012-12-20 AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-20 13:32:02 UTC --- TER already avoids moving things across calls but: /* Increment counter if this is a non BUILT_IN call. We allow replacement over BUILT_IN calls since many will expand to inline insns instead of a true call. */ if (is_gimple_call (stmt) && !((fndecl = gimple_call_fndecl (stmt)) && DECL_BUILT_IN (fndecl))) cur_call_cnt++; so it special-cases all builtins (I can see __builtin_sqrt as a good example where this is a good idea). OTOH __builtin_ia32_stmxcsr/ __builtin_ia32_ldmxcsr are neither const nor pure, so maybe restricting this further, like /* Increment counter if this is not a BUILT_IN call without side-effects. We allow replacement over BUILT_IN calls since many will expand to inline insns instead of a true call. */ if (is_gimple_call (stmt) && (!((fndecl = gimple_call_fndecl (stmt)) && DECL_BUILT_IN (fndecl)) || gimple_has_side_effects (stmt))) cur_call_cnt++;