From cedd8ca58336b0c5b061b3c03c0a646fe08b616c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 29 Nov 2017 11:31:36 +0100 Subject: [PATCH] re PR middle-end/80929 (Division with constant no more optimized to mult highpart) PR middle-end/80929 * rtlanal.c (seq_cost): For non-single_set insns try to use insn_cost. From-SVN: r255228 --- gcc/ChangeLog | 3 +++ gcc/rtlanal.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26c3d24ce96..483c02aa501 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2017-11-29 Jakub Jelinek + PR middle-end/80929 + * rtlanal.c (seq_cost): For non-single_set insns try to use insn_cost. + PR target/80819 * config/i386/sse.md (vec_concatv2di): Remove * from (=Yr,0,*rm) alternative. diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index beb24ba573c..c91f3f1d81e 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -5341,8 +5341,14 @@ seq_cost (const rtx_insn *seq, bool speed) set = single_set (seq); if (set) cost += set_rtx_cost (set, speed); - else - cost++; + else if (NONDEBUG_INSN_P (seq)) + { + int this_cost = insn_cost (CONST_CAST_RTX_INSN (seq), speed); + if (this_cost > 0) + cost += this_cost; + else + cost++; + } } return cost; -- 2.30.2