In the PR we perform expression replacement of an FP operation across a builtin call that sets the FP control register. This patch restricts replacement across calls further, from allowing all builtins to only allowing those without side-effects.
Allowing replacement over calls at all was to not pessimize FP code generation for example for sqrt which is most often expanded to a single instruction. Bootstrap and regtest running on x86_64-unknown-linux-gnu. Comments? Thanks, Richard. 2012-12-20 Richard Biener <rguent...@suse.de> PR middle-end/55752 * tree-ssa-ter.c (find_replaceable_in_bb): Only allow replacing across calls with no side-effects. Index: gcc/tree-ssa-ter.c =================================================================== *** gcc/tree-ssa-ter.c (revision 194632) --- gcc/tree-ssa-ter.c (working copy) *************** find_replaceable_in_bb (temp_expr_table_ *** 681,692 **** kill_expr (tab, partition); } ! /* 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++; /* Now see if we are creating a new expression or not. */ --- 681,693 ---- kill_expr (tab, partition); } ! /* 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++; /* Now see if we are creating a new expression or not. */