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]

[gcjx] Patch: Set TREE_STATIC for static fields


-----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;

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