From 6b094f38d7561422c087a31d26a8d36b58d7a549 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 7 Sep 2004 16:56:50 +0200 Subject: [PATCH] * tree-ssa-loop-ivopts.c (iv_value): Avoid invalid sharing on niter. From-SVN: r87143 --- gcc/ChangeLog | 4 ++++ gcc/tree-ssa-loop-ivopts.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b5fd1d9aa1a..6d7e47306dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2004-09-07 Jan Hubicka + + * tree-ssa-loop-ivopts.c (iv_value): Avoid invalid sharing on niter. + 2004-09-07 Nathan Sidwell * builtins.c (fold_builtin_strchr): Use build_int_cst, not diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 7234660412b..be4958d2a79 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -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)); } -- 2.30.2