Commit b46ebc6c by Richard Biener Committed by Richard Biener

re PR tree-optimization/85475 (Compile time hog w/ -O1 -fpeel-loops)

2018-04-20  Richard Biener <rguenther@suse.de>

	PR middle-end/85475
	* match.pd ((X * CST) * Y -> (X * Y) * CST): Avoid exponential
	complexity by forcing a single use of the multiply operand.

	* gcc.dg/torture/pr85475.c: New testcase.

From-SVN: r259519
parent 2f1f3ac4
2018-04-20 Richard Biener <rguenther@suse.de>
PR middle-end/85475
* match.pd ((X * CST) * Y -> (X * Y) * CST): Avoid exponential
complexity by forcing a single use of the multiply operand.
2018-04-20 Martin Jambor <mjambor@suse.cz>
ipa/85449
......
......@@ -2578,8 +2578,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
/* Reassociate (X * CST) * Y to (X * Y) * CST. This does not introduce
signed overflow for CST != 0 && CST != -1. */
(simplify
(mult:c (mult:s @0 INTEGER_CST@1) @2)
(mult:c (mult:s@3 @0 INTEGER_CST@1) @2)
(if (TREE_CODE (@2) != INTEGER_CST
&& single_use (@3)
&& !integer_zerop (@1) && !integer_minus_onep (@1))
(mult (mult @0 @2) @1)))
......
2018-04-20 Richard Biener <rguenther@suse.de>
PR middle-end/85475
* gcc.dg/torture/pr85475.c: New testcase.
2018-04-20 Martin Jambor <mjambor@suse.cz>
ipa/85449
......
/* { dg-do compile } */
/* { dg-additional-options "-fpeel-loops" } */
int
nj (int le)
{
int zb;
for (zb = 0; zb < 16; ++zb)
le += le;
return le * le;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment