]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2018-01-31 Bill Schmidt <wschmidt@linux.ibm.com>
authorwschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Jan 2019 13:53:06 +0000 (13:53 +0000)
committerwschmidt <wschmidt@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Jan 2019 13:53:06 +0000 (13:53 +0000)
PR tree-optimization/89008
* gimple-ssa-strength-reduction.c (slsr_process_mul): Don't
process anything of the form X * 0.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268422 138bc75d-0d04-0410-961f-82ee72b054a4

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

index d0ce1170b1729bef995f7edc5ec9f2ac944b7112..56e13e882c7189ac68711ebaba8f3e3543153e7b 100644 (file)
@@ -1,3 +1,9 @@
+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>
 
        PR tree-optimization/89135
index 82721a98126281ef497e48186f20bdd5525c2e3b..937a87761c89e084665d1c8326e3698bf2f9a21f 100644 (file)
@@ -1268,7 +1268,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 if (TREE_CODE (rhs2) == INTEGER_CST)
+  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);