* 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 b5fd1d9..6d7e473 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 7234660..be4958d 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));
 }