aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-loop-ivopts.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dc2495e..624016c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-18 Tom de Vries <tom@codesourcery.com>
+
+ PR target/45098
+ * tree-ssa-loop-ivopts.c (computation_cost): Prevent cost of 0.
+
2011-05-18 Uros Bizjak <ubizjak@gmail.com>
* 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 13c2b40..501dbbf 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;
}