re PR middle-end/45098 (Missed induction variable optimization)
authorTom de Vries <tom@codesourcery.com>
Wed, 18 May 2011 18:27:11 +0000 (18:27 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Wed, 18 May 2011 18:27:11 +0000 (18:27 +0000)
2011-05-18  Tom de Vries  <tom@codesourcery.com>

PR target/45098
* tree-ssa-loop-ivopts.c (computation_cost): Prevent cost of 0.

From-SVN: r173872

gcc/ChangeLog
gcc/tree-ssa-loop-ivopts.c

index dc2495e9907d54ea6ab8ece1600b3a7e5f74b6d8..624016c4bc02482758d2bcbd438ba429c1f23e89 100644 (file)
@@ -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.
index 13c2b407cc2ff8a1434e6ee092cae8d0c9068e37..501dbbf45265b0d74b14db56472ed344c8bc7775 100644 (file)
@@ -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;
 }