From: Bill Schmidt Date: Thu, 31 Jan 2019 21:55:45 +0000 (+0000) Subject: backport: re PR middle-end/89008 (O2 and O1 results differ for simple test) X-Git-Tag: releases/gcc-7.5.0~623 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16d6c1df7281105f9fdff4bec7950807df93f97d;p=thirdparty%2Fgcc.git backport: re PR middle-end/89008 (O2 and O1 results differ for simple test) 2018-01-31 Bill Schmidt Backport from mainline 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: r268431 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b74d9750b18e..954632209aac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-01-31 Bill Schmidt + + Backport from mainline + 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 Backport from mainline diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index ed089200e5b9..08bba54fc019 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -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);