From b5ee67520324dd4185e13374613b55970cfe5169 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Wed, 18 May 2011 18:27:11 +0000 Subject: [PATCH] re PR middle-end/45098 (Missed induction variable optimization) 2011-05-18 Tom de Vries PR target/45098 * tree-ssa-loop-ivopts.c (computation_cost): Prevent cost of 0. From-SVN: r173872 --- gcc/ChangeLog | 5 +++++ gcc/tree-ssa-loop-ivopts.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc2495e9907..624016c4bc0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-05-18 Tom de Vries + + PR target/45098 + * tree-ssa-loop-ivopts.c (computation_cost): Prevent cost of 0. + 2011-05-18 Uros Bizjak * config/i386/i386.md (*tls_global_dynamic_32_gnu): Split asm template. diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 13c2b407cc2..501dbbf4526 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -2866,6 +2866,8 @@ computation_cost (tree expr, bool speed) if (MEM_P (rslt)) cost += address_cost (XEXP (rslt, 0), TYPE_MODE (type), TYPE_ADDR_SPACE (type), speed); + else if (!REG_P (rslt)) + cost += rtx_cost (rslt, SET, speed); return cost; } -- 2.30.2