* tree-ssa-loop-ivopts.c (iv_value): Avoid invalid sharing on niter.
authorJan Hubicka <jh@suse.cz>
Tue, 7 Sep 2004 14:56:50 +0000 (16:56 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 7 Sep 2004 14:56:50 +0000 (14:56 +0000)
From-SVN: r87143

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

index b5fd1d9aa1a51a75133df8f5d78f0e1e80ef3036..6d7e47306dc95d6661e441b708db929d0f22a500 100644 (file)
@@ -1,3 +1,7 @@
+2004-09-07  Jan Hubicka  <jh@suse.cz>
+
+       * tree-ssa-loop-ivopts.c (iv_value): Avoid invalid sharing on niter.
+
 2004-09-07  Nathan Sidwell  <nathan@codesourcery.com>
 
        * builtins.c (fold_builtin_strchr): Use build_int_cst, not
index 7234660412b994ee85f21e8041967c82c4eabf3c..be4958d2a796e81fee1c149781b13ce54b480bae 100644 (file)
@@ -2908,7 +2908,7 @@ iv_value (struct iv *iv, tree niter)
   tree type = TREE_TYPE (iv->base);
 
   niter = fold_convert (type, niter);
-  val = fold (build2 (MULT_EXPR, type, iv->step, niter));
+  val = fold (build2 (MULT_EXPR, type, iv->step, unsave_expr_now (niter)));
 
   return fold (build2 (PLUS_EXPR, type, iv->base, val));
 }