This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: Fix "PR 162" regression


The PR162.java test case fails now, even though the original PR was
fixed a long time ago.

The problem was that we weren't generating a <clinit> in all the
relevant cases.  In particular we weren't generating one if the
<clinit> had a MODIFY_EXPR whose second operand was not constant.

This patch fixes the problem.  I tested it by rebuilding libgcj and
then running `make check'.  There were no regressions.

Ok?

2001-03-14  Tom Tromey  <tromey@redhat.com>

	* parse.y (analyze_clinit_body): Return true if the second operand
	of a METHOD_EXPR is nonzero.

Tom

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.251.2.6
diff -u -r1.251.2.6 parse.y
--- parse.y	2001/02/20 21:15:48	1.251.2.6
+++ parse.y	2001/03/15 01:57:28
@@ -7588,7 +7588,7 @@
 }
 
 /* Analyzes a method body and look for something that isn't a
-   MODIFY_EXPR. */
+   MODIFY_EXPR with a constant value.  */
 
 static int
 analyze_clinit_body (bbody)
@@ -7612,11 +7612,10 @@
 	break;
 	
       case MODIFY_EXPR:
-	bbody = NULL_TREE;
-	break;
+	/* Return 0 if the operand is constant, 1 otherwise.  */
+	return ! TREE_CONSTANT (TREE_OPERAND (bbody, 1));
 
       default:
-	bbody = NULL_TREE;
 	return 1;
       }
   return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]