OSDN Git Service

* parse.y (patch_binop): Minor constant folding.
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Dec 2001 01:24:59 +0000 (01:24 +0000)
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Dec 2001 01:24:59 +0000 (01:24 +0000)
* parse.y (build_current_thisn):  Shorter 'buffer'.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47588 138bc75d-0d04-0410-961f-82ee72b054a4

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

index ca9284c..ae85b1a 100644 (file)
@@ -1,5 +1,11 @@
 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
        instead of CLEANUP_POINT_EXPR and WITH_CLEANUP_EXPR.
        * jcf-write.c (generate_bytecode_insns):  Remove support for
index 09d5cd6..608ec91 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;