parse.y (java_stabilize_reference): Use save_expr instead of building a SAVE_EXPR...
authorAlexandre Petit-Bianco <apbianco@cygnus.com>
Tue, 16 Mar 1999 03:38:15 +0000 (03:38 +0000)
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>
Tue, 16 Mar 1999 03:38:15 +0000 (19:38 -0800)
1999-03-16  Alexandre Petit-Bianco  <apbianco@cygnus.com>
* parse.y (java_stabilize_reference): Use save_expr instead of
building a SAVE_EXPR node.
(java_complete_lhs): Patch the resulting string of the `+='
operator (if necessary) and complete the RHS after having built
the cast.

From-SVN: r25797

gcc/java/ChangeLog
gcc/java/parse.c
gcc/java/parse.y

index 7c00271f021dfbd795b9381e655792158b1ca078..e06e9573cc0f4df98a3825d86d608c3f3e3305a0 100644 (file)
@@ -1,3 +1,11 @@
+1999-03-16  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * parse.y (java_stabilize_reference): Use save_expr instead of
+       building a SAVE_EXPR node.
+       (java_complete_lhs): Patch the resulting string of the `+='
+       operator (if necessary) and complete the RHS after having built
+       the cast.
+
 Mon Mar 15 12:18:29 1999  Per Bothner  <bothner@cygnus.com>
 
        * class.c (make_class):  Don't set CLASS_P here (because
index 63e666202ac93a8bc179c5bf05b1570ee3d0acc9..f090ca515f535d07ab92d3f36d2fd59a9cc72768 100644 (file)
@@ -10122,7 +10122,7 @@ java_stabilize_reference (node)
     {
       tree op0 = TREE_OPERAND (node, 0);
       tree op1 = TREE_OPERAND (node, 1);
-      TREE_OPERAND (node, 0) = build1 (SAVE_EXPR, TREE_TYPE (op0), op0);
+      TREE_OPERAND (node, 0) = save_expr (op0);
       TREE_OPERAND (node, 1) = java_stabilize_reference (op1);
       return node;
     }
@@ -10537,9 +10537,13 @@ java_complete_lhs (node)
          /* Now complete the RHS. We write it back later on. */
          nn = java_complete_tree (TREE_OPERAND (node, 1));
 
+         if ((cn = patch_string (nn)))
+           nn = cn;
+
          /* The last part of the rewrite for E1 op= E2 is to have 
             E1 = (T)(E1 op E2), with T being the type of E1. */
-         nn = build_cast (EXPR_WFL_LINECOL (wfl_op2), TREE_TYPE (lvalue), nn);
+         nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2), 
+                                              TREE_TYPE (lvalue), nn));
        }
 
       /* If we're about to patch a NEW_ARRAY_INIT, we call a special
@@ -11986,7 +11990,6 @@ build_string_concatenation (op1, op2)
 {
   tree result;
   int side_effects = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2);
-
   
   /* Try to do some static optimization */
   if ((result = string_constant_concatenation (op1, op2)))
index 75ffbc3cc6170092e0f778abb617b4a8c73d8a50..3e5bd74e9f038f3e92df59bc4a7bea09c6c25aba 100644 (file)
@@ -7520,7 +7520,7 @@ java_stabilize_reference (node)
     {
       tree op0 = TREE_OPERAND (node, 0);
       tree op1 = TREE_OPERAND (node, 1);
-      TREE_OPERAND (node, 0) = build1 (SAVE_EXPR, TREE_TYPE (op0), op0);
+      TREE_OPERAND (node, 0) = save_expr (op0);
       TREE_OPERAND (node, 1) = java_stabilize_reference (op1);
       return node;
     }
@@ -7935,9 +7935,13 @@ java_complete_lhs (node)
          /* Now complete the RHS. We write it back later on. */
          nn = java_complete_tree (TREE_OPERAND (node, 1));
 
+         if ((cn = patch_string (nn)))
+           nn = cn;
+
          /* The last part of the rewrite for E1 op= E2 is to have 
             E1 = (T)(E1 op E2), with T being the type of E1. */
-         nn = build_cast (EXPR_WFL_LINECOL (wfl_op2), TREE_TYPE (lvalue), nn);
+         nn = java_complete_tree (build_cast (EXPR_WFL_LINECOL (wfl_op2), 
+                                              TREE_TYPE (lvalue), nn));
        }
 
       /* If we're about to patch a NEW_ARRAY_INIT, we call a special
@@ -9384,7 +9388,6 @@ build_string_concatenation (op1, op2)
 {
   tree result;
   int side_effects = TREE_SIDE_EFFECTS (op1) | TREE_SIDE_EFFECTS (op2);
-
   
   /* Try to do some static optimization */
   if ((result = string_constant_concatenation (op1, op2)))