gimplify.c (gimplify_compound_lval): Don't set ARRAY_REF or COMPONENT_REF variable...
authorRichard Henderson <rth@redhat.com>
Thu, 24 Jun 2004 05:21:27 +0000 (22:21 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 24 Jun 2004 05:21:27 +0000 (22:21 -0700)
        * gimplify.c (gimplify_compound_lval): Don't set ARRAY_REF or
        COMPONENT_REF variable fields unless they're non-constant.

From-SVN: r83578

gcc/ChangeLog
gcc/gimplify.c

index 9739978aa528ae6c738300d38eeac31af3b5074d..37024fbee1aaa784b9ec77eb749a25b503396d0d 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-23  Richard Henderson  <rth@redhat.com>
+
+       * 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  <robertmh@gnu.org>
 
        * config.gcc: Merge kfreebsd*-gnu with linux* and add knetbsd*-gnu.
index a4baa1e85e4bdba2f0a273e61e164cf1d0bd7203..480b8ebbf06127a579902d0c31eadfc6b9fcb973 100644 (file)
@@ -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);