This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: Set TREE_STATIC for static fields
- From: Ranjit Mathew <rmathew at gmail dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Sun, 15 Jan 2006 22:02:09 +0530
- Subject: [gcjx] Patch: Set TREE_STATIC for static fields
- Openpgp: url=http://ranjitmathew.hostingzero.com/aa_6C114B8F.txt
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
As I have remarked elsewhere, a long-standing ICE prevents
GCJX from bootstrapping on Linux right now:
http://gcc.gnu.org/ml/gcc/2006-01/msg00162.html
The bug is in the Tree-SSA operands processing code, but the
relevant code path is being taken because of a bug in GCJX
itself. This was because we were not setting TREE_STATIC
for static fields of a class. The attached patch fixes this.
In mainline GCJ, this is done by add_field() in class.c.
Note that FIELD_STATIC is the same as TREE_STATIC (see
java-tree.h).
With this patch I'm able to bootstrap *much* further than
java/lang/Character.java. It finally fails again while
processing gnu/java/awt/BitwiseXORComposite.java - the
assertion in make_decl_rtl() (varasm.c) fails for the
"sp" local variable in the method compose() of the inner
class java.awt.BitwiseXORComposite$GeneralContext. I shall
investigate this failure in a while.
Tested on i686-pc-linux-gnu.
OK?
Thanks,
Ranjit.
- --
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://rmathew.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFDynkIYb1hx2wRS48RAvjDAKCgfsrbfoMWpkNo5SUwpqiP7TzkoQCaA63W
Tbx9pToV6KIhHzy9RBR49/Y=
=ru7v
-----END PGP SIGNATURE-----
Index: ChangeLog
from Ranjit Mathew <rmathew@gcc.gnu.org>
* builtins.cc (tree_builtins::add): Set TREE_STATIC for static
fields.
Index: builtins.cc
===================================================================
--- builtins.cc (revision 109722)
+++ builtins.cc (working copy)
@@ -1,6 +1,6 @@
// Various built-in functions.
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -187,6 +187,7 @@ tree_builtins::add (tree context, model_
}
else
{
+ TREE_STATIC (result) = 1;
// We clear this later if we compile the field's declaring
// class.
DECL_EXTERNAL (result) = 1;