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
+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
 
 /* 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
 
--- /dev/null
+/* { 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;
+}