parse.y (patch_binop): Minor constant folding.
authorPer Bothner <per@bothner.com>
Tue, 4 Dec 2001 01:24:59 +0000 (17:24 -0800)
committerPer Bothner <bothner@gcc.gnu.org>
Tue, 4 Dec 2001 01:24:59 +0000 (17:24 -0800)
* parse.y (patch_binop):  Minor constant folding.

* parse.y (build_current_thisn):  Shorter 'buffer'.

From-SVN: r47588

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

index ca9284ccdd93114269cfd1fd63af1a36c92f3c39..ae85b1a1e2e33c824cc83640953f27d21ee43c76 100644 (file)
@@ -1,3 +1,9 @@
+2001-12-03  Per Bothner  <per@bothner.com>
+
+       * parse.y (patch_binop):  Minor constant folding.
+
+       * parse.y (build_current_thisn):  Shorter 'buffer'.
+
 2001-12-03  Per Bothner  <per@bothner.com>
 
        * decl.c (complete_start_java_method):  Now generate TRY_FINALLY_EXPR
index 09d5cd69d8a62c1967cc786fa63c8e692d505030..608ec91bc6074067c4e94fbcf1374718ba46d050 100644 (file)
@@ -8619,7 +8619,7 @@ build_current_thisn (type)
   static int saved_type_i = 0;
   static int initialized_p;
   tree decl;
-  char buffer [80];
+  char buffer [24];
   int i = 0;
 
   /* Register SAVED_THISN and SAVED_TYPE with the garbage collector.  */
@@ -13770,6 +13770,14 @@ patch_binop (node, wfl_op1, wfl_op2)
          error_found = 1;
          break;
        }
+      else if (integer_zerop (op1))
+       {
+         return code == TRUTH_ANDIF_EXPR ? op1 : op2;
+       }
+      else if (integer_onep (op1))
+       {
+         return code == TRUTH_ANDIF_EXPR ? op2 : op1;
+       }
       /* The type of the conditional operators is BOOLEAN */
       prom_type = boolean_type_node;
       break;