sh.c (sh_gimplify_va_arg_expr): Unshare the addr...
authorKaz Kojima <kkojima@gcc.gnu.org>
Tue, 29 Jul 2008 09:07:49 +0000 (09:07 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Tue, 29 Jul 2008 09:07:49 +0000 (09:07 +0000)
* config/sh/sh.c (sh_gimplify_va_arg_expr): Unshare the addr,
valist, next_fp, next_fp_tmp, next_fp_limit, next_o, next_o_limit,
next_stack, lab_false and lab_over trees.

From-SVN: r138233

gcc/ChangeLog
gcc/config/sh/sh.c

index aa4d3b2d9837eaa3b647dc2745158763a6c49e2c..3766bb6f42f05e16c3a26b1b6fe52d5a7d1faa0a 100644 (file)
@@ -1,3 +1,9 @@
+2008-07-29  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       * config/sh/sh.c (sh_gimplify_va_arg_expr): Unshare the addr,
+       valist, next_fp, next_fp_tmp, next_fp_limit, next_o, next_o_limit,
+       next_stack, lab_false and lab_over trees.
+
 2008-07-28  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/36957
index c7b8f5820625d66a48a1a6bc32be85325ab65eb6..44723c4d4a6e463673a13addcbc628b4b70df253 100644 (file)
@@ -7350,18 +7350,19 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
          tree cmp;
          bool is_double = size == 8 && TREE_CODE (eff_type) == REAL_TYPE;
 
-         tmp = build1 (ADDR_EXPR, pptr_type_node, next_fp);
-         gimplify_assign (addr, tmp, pre_p);
+         tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_fp));
+         gimplify_assign (unshare_expr (addr), tmp, pre_p);
 
-         gimplify_assign (next_fp_tmp, valist, pre_p);
+         gimplify_assign (unshare_expr (next_fp_tmp), valist, pre_p);
          tmp = next_fp_limit;
          if (size > 4 && !is_double)
-           tmp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (tmp), tmp,
-                         size_int (4 - size));
-         tmp = build2 (GE_EXPR, boolean_type_node, next_fp_tmp, tmp);
+           tmp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (tmp),
+                         unshare_expr (tmp), size_int (4 - size));
+         tmp = build2 (GE_EXPR, boolean_type_node,
+                       unshare_expr (next_fp_tmp), unshare_expr (tmp));
          cmp = build3 (COND_EXPR, void_type_node, tmp,
-                       build1 (GOTO_EXPR, void_type_node, lab_false),
-                       NULL_TREE);
+                       build1 (GOTO_EXPR, void_type_node,
+                               unshare_expr (lab_false)), NULL_TREE);
          if (!is_double)
            gimplify_and_add (cmp, pre_p);
 
@@ -7372,8 +7373,8 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
              tmp = build2 (BIT_AND_EXPR, sizetype, tmp,
                            size_int (UNITS_PER_WORD));
              tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
-                           next_fp_tmp, tmp);
-             gimplify_assign (next_fp_tmp, tmp, pre_p);
+                           unshare_expr (next_fp_tmp), tmp);
+             gimplify_assign (unshare_expr (next_fp_tmp), tmp, pre_p);
            }
          if (is_double)
            gimplify_and_add (cmp, pre_p);
@@ -7398,48 +7399,53 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
            }
 #endif /* FUNCTION_ARG_SCmode_WART */
 
-         tmp = build1 (GOTO_EXPR, void_type_node, lab_over);
+         tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (lab_over));
          gimplify_and_add (tmp, pre_p);
 
-         tmp = build1 (LABEL_EXPR, void_type_node, lab_false);
+         tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_false));
          gimplify_and_add (tmp, pre_p);
 
-         tmp = build1 (ADDR_EXPR, pptr_type_node, next_stack);
-         gimplify_assign (addr, tmp, pre_p);
-         gimplify_assign (next_fp_tmp, valist, pre_p);
+         tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_stack));
+         gimplify_assign (unshare_expr (addr), tmp, pre_p);
+         gimplify_assign (unshare_expr (next_fp_tmp),
+                          unshare_expr (valist), pre_p);
 
-         gimplify_assign (valist, next_fp_tmp, post_p);
+         gimplify_assign (unshare_expr (valist),
+                          unshare_expr (next_fp_tmp), post_p);
          valist = next_fp_tmp;
        }
       else
        {
-         tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, next_o,
-                       size_int (rsize));
-         tmp = build2 (GT_EXPR, boolean_type_node, tmp, next_o_limit);
+         tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
+                       unshare_expr (next_o), size_int (rsize));
+         tmp = build2 (GT_EXPR, boolean_type_node, tmp,
+                       unshare_expr (next_o_limit));
          tmp = build3 (COND_EXPR, void_type_node, tmp,
-                       build1 (GOTO_EXPR, void_type_node, lab_false),
-                       NULL_TREE);
+                       build1 (GOTO_EXPR, void_type_node,
+                               unshare_expr (lab_false)),
+                       NULL_TREE);
          gimplify_and_add (tmp, pre_p);
 
-         tmp = build1 (ADDR_EXPR, pptr_type_node, next_o);
-         gimplify_assign (addr, tmp, pre_p);
+         tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_o));
+         gimplify_assign (unshare_expr (addr), tmp, pre_p);
 
-         tmp = build1 (GOTO_EXPR, void_type_node, lab_over);
+         tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (lab_over));
          gimplify_and_add (tmp, pre_p);
 
-         tmp = build1 (LABEL_EXPR, void_type_node, lab_false);
+         tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_false));
          gimplify_and_add (tmp, pre_p);
 
          if (size > 4 && ! (TARGET_SH4 || TARGET_SH2A))
-           gimplify_assign (next_o, next_o_limit, pre_p);
+           gimplify_assign (unshare_expr (next_o),
+                            unshare_expr (next_o_limit), pre_p);
 
-         tmp = build1 (ADDR_EXPR, pptr_type_node, next_stack);
-         gimplify_assign (addr, tmp, pre_p);
+         tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_stack));
+         gimplify_assign (unshare_expr (addr), tmp, pre_p);
        }
 
       if (!result)
        {
-         tmp = build1 (LABEL_EXPR, void_type_node, lab_over);
+         tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_over));
          gimplify_and_add (tmp, pre_p);
        }
     }
@@ -7452,7 +7458,7 @@ sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
     {
       gimplify_assign (result, tmp, pre_p);
 
-      tmp = build1 (LABEL_EXPR, void_type_node, lab_over);
+      tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_over));
       gimplify_and_add (tmp, pre_p);
     }
   else