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]

gcj: always emit static array data



The compiler places certain static array data into new decls.  These
decls were not being emitted when compiled with optimization enabled.
Gcj cannot compile and link the following with optimization:

public class Foo
{
  private final static int[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  public static void main (String[] args) {}
}

The following patch, which I have committed, marks these decls as
referenced, which then forces wrapup_global_declarations to emit them.
It is required in order to build libgcj with optimization.

1999-08-15  Anthony Green  <green@cygnus.com>

	* expr.c (java_lang_expand_expr): Mark static array data as
	referenced.

Index: expr.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/java/expr.c,v
retrieving revision 1.46
diff -u -r1.46 expr.c
--- expr.c      1999/08/10 16:58:12     1.46
+++ expr.c      1999/08/15 08:03:52
@@ -1944,6 +1944,7 @@
            DECL_INITIAL (init_decl) = init;
            DECL_IGNORED_P (init_decl) = 1;
            TREE_READONLY (init_decl) = 1;
+           TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (init_decl)) = 1;
            make_decl_rtl (init_decl, NULL, 1);
            init = init_decl;
          }

-- 
Anthony Green                                               Cygnus Solutions
                                                       Sunnyvale, California

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