This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: workaround for PR 27908
- From: Andrew Haley <aph at redhat dot com>
- To: Casey Marshall <csm at gnu dot org>
- Cc: java-patches at gcc dot gnu dot org
- Date: Wed, 7 Jun 2006 10:45:30 +0100
- Subject: Re: PATCH: workaround for PR 27908
- References: <B407FA29-D7C2-4D07-9DDF-E41B6541F11C@gnu.org>
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)
{