From: rth Date: Thu, 24 Jun 2004 05:21:27 +0000 (+0000) Subject: * gimplify.c (gimplify_compound_lval): Don't set ARRAY_REF or X-Git-Tag: upstream/4.9.2~70320 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6780737f6e6b7d0648cccd70e28b465eedd18b7f;p=platform%2Fupstream%2Flinaro-gcc.git * gimplify.c (gimplify_compound_lval): Don't set ARRAY_REF or COMPONENT_REF variable fields unless they're non-constant. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83578 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9739978..37024fb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-06-23 Richard Henderson + + * gimplify.c (gimplify_compound_lval): Don't set ARRAY_REF or + COMPONENT_REF variable fields unless they're non-constant. + 2004-06-23 Robert Millan * config.gcc: Merge kfreebsd*-gnu with linux* and add knetbsd*-gnu. diff --git a/gcc/gimplify.c b/gcc/gimplify.c index a4baa1e..480b8eb 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1948,9 +1948,10 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, gimplified. */ if (!TREE_OPERAND (t, 2)) { - TREE_OPERAND (t, 2) = unshare_expr (array_ref_low_bound (t)); - if (!is_gimple_min_invariant (TREE_OPERAND (t, 2))) + tree low = unshare_expr (array_ref_low_bound (t)); + if (!is_gimple_min_invariant (low)) { + TREE_OPERAND (t, 2) = low; tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p, post_p, is_gimple_tmp_var, fb_rvalue); ret = MIN (ret, tret); @@ -1967,9 +1968,9 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, type (above). */ elmt_size = size_binop (EXACT_DIV_EXPR, elmt_size, factor); - TREE_OPERAND (t, 3) = elmt_size; - if (!is_gimple_min_invariant (TREE_OPERAND (t, 3))) + if (!is_gimple_min_invariant (elmt_size)) { + TREE_OPERAND (t, 3) = elmt_size; tret = gimplify_expr (&TREE_OPERAND (t, 3), pre_p, post_p, is_gimple_tmp_var, fb_rvalue); ret = MIN (ret, tret); @@ -1989,9 +1990,9 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p, /* Divide the offset by its alignment. */ offset = size_binop (EXACT_DIV_EXPR, offset, factor); - TREE_OPERAND (t, 2) = offset; - if (!is_gimple_min_invariant (TREE_OPERAND (t, 2))) + if (!is_gimple_min_invariant (offset)) { + TREE_OPERAND (t, 2) = offset; tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p, post_p, is_gimple_tmp_var, fb_rvalue); ret = MIN (ret, tret);