]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR middle-end/89008 (O2 and O1 results differ for simple test)
authorBill Schmidt <wschmidt@linux.ibm.com>
Thu, 31 Jan 2019 21:55:45 +0000 (21:55 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Thu, 31 Jan 2019 21:55:45 +0000 (21:55 +0000)
2018-01-31  Bill Schmidt  <wschmidt@linux.ibm.com>

Backport from mainline
2018-01-31  Bill Schmidt  <wschmidt@linux.ibm.com>

PR tree-optimization/89008
* gimple-ssa-strength-reduction.c (slsr_process_mul): Don't
process anything of the form X * 0.

From-SVN: r268431

gcc/ChangeLog
gcc/gimple-ssa-strength-reduction.c

index b74d9750b18e6a4c783f1cad82fdec931b4c28d8..954632209aac034e6933aedc872a8540e6fdbb84 100644 (file)
@@ -1,3 +1,12 @@
+2018-01-31  Bill Schmidt  <wschmidt@linux.ibm.com>
+
+       Backport from mainline
+       2018-01-31  Bill Schmidt  <wschmidt@linux.ibm.com>
+
+       PR tree-optimization/89008
+       * gimple-ssa-strength-reduction.c (slsr_process_mul): Don't
+       process anything of the form X * 0.
+
 2019-01-31  Richard Biener  <rguenther@suse.de>
 
        Backport from mainline
index ed089200e5b9e01f8b140bdd166037f12c952bff..08bba54fc019455cfc0bd9e47a7dc2668c72f9f4 100644 (file)
@@ -1220,7 +1220,7 @@ slsr_process_mul (gimple *gs, tree rhs1, tree rhs2, bool speed)
       c->next_interp = c2->cand_num;
       c2->first_interp = c->cand_num;
     }
-  else
+  else if (TREE_CODE (rhs2) == INTEGER_CST && !integer_zerop (rhs2))
     {
       /* Record an interpretation for the multiply-immediate.  */
       c = create_mul_imm_cand (gs, rhs1, rhs2, speed);