Hi All, Here is updated patch which was redesigned accordingly to Richard review. It performs swapping operands of commutative operations to expand the expensive one first. Bootstrap and regression testing did not show any new failures. Is it OK for trunk? gcc/ChangeLog 2015-01-14 Yuri Rumyantsev PR tree-optimization/64434 * cfgexpand.c (reorder_operands): New function. (expand_gimple_basic_block): Insert call of reorder_operands. gcc/testsuite/ChangeLog * gcc.dg/torture/pr64434.c: New test.