https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94269
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:d21dff5b4fee51ae432143065bededfc763dc344 commit r10-7391-gd21dff5b4fee51ae432143065bededfc763dc344 Author: Richard Biener <rguent...@suse.de> Date: Thu Mar 26 08:33:57 2020 +0100 widening_mul: restrict ops to be defined in the same basic-block when convert plusminus to widen In the testcase for PR94269, widening_mul moves two multiply instructions from outside the loop to inside the loop, merging with two add instructions separately. This increases the cost of the loop. Like FMA detection in the same pass, simply restrict ops to be defined in the same basic-block to avoid possibly moving multiply to a different block with a higher execution frequency. 2020-03-26 Felix Yang <felix.y...@huawei.com> PR tree-optimization/94269 * tree-ssa-math-opts.c (convert_plusminus_to_widen): Restrict this operation to single basic block. * gcc.dg/pr94269.c: New test.