From f942ef18b84ff6fd5774a606357e4ebcec120da3 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Thu, 31 Jan 2019 13:53:06 +0000 Subject: [PATCH] re PR middle-end/89008 (O2 and O1 results differ for simple test) 2018-01-31 Bill Schmidt PR tree-optimization/89008 * gimple-ssa-strength-reduction.c (slsr_process_mul): Don't process anything of the form X * 0. From-SVN: r268422 --- gcc/ChangeLog | 6 ++++++ gcc/gimple-ssa-strength-reduction.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d0ce1170b17..56e13e882c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-31 Bill Schmidt + + 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 PR tree-optimization/89135 diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index 82721a98126..937a87761c8 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -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); -- 2.30.2