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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: workaround for PR 27908


Casey Marshall writes:
 > Hi, this patch works around PR 27908, which looks as though it is  
 > caused by GCJ not supporting the `volatile' keyword.
 > 
 > This patch is against the libjava version of VMSecureRandom, and not  
 > the upstream version from Classpath, since this fix is likely rather  
 > GCJ-specific (and since GCJ has it's own VMSecureRandom outside the  
 > classpath tree).

Try this:

2006-06-07  Andrew Haley  <aph@redhat.com>

	PR java/27908
	* class.c (add_field): Set TREE_THIS_VOLATILE on fields.

Index: gcc/java/class.c
===================================================================
--- gcc/java/class.c	(revision 114388)
+++ gcc/java/class.c	(working copy)
@@ -785,7 +785,11 @@
   if (flags & ACC_PROTECTED) FIELD_PROTECTED (field) = 1;
   if (flags & ACC_PRIVATE) FIELD_PRIVATE (field) = 1;
   if (flags & ACC_FINAL) FIELD_FINAL (field) = 1;
-  if (flags & ACC_VOLATILE) FIELD_VOLATILE (field) = 1;
+  if (flags & ACC_VOLATILE) 
+    {
+      FIELD_VOLATILE (field) = 1;
+      TREE_THIS_VOLATILE (field) = 1;
+    }
   if (flags & ACC_TRANSIENT) FIELD_TRANSIENT (field) = 1;
   if (is_static)
     {


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