This is the mail archive of the 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]

[tree-ssa][java] fix some -O3 test cases


-FAIL: TLtest -O3 compilation from source
-FAIL: anfi -O3 compilation from source
-FAIL: anon -O3 compilation from source
-FAIL: anon2 -O3 compilation from source
-FAIL: anon3 -O3 compilation from source
-FAIL: anon4 -O3 compilation from source
-FAIL: anon_ctor_itf_arg -O3 compilation from source

All of these failures were for missing symbols.  Fixed by emitting
everything that can refer to symbols before telling cgraph that we're
done.  Otherwise it'll make the wrong decisions about what symbols
need to me emitted.  Worse, if cgraph doesn't know that symbols are
addressable, it can decide that they can be compiled with more
efficient calling conventions than the default ABI allows.

It looks like this same fix may be required on mainline, but I don't
know why these tests aren't failing there.  Would someone Java savvy
please look into this?


	* jcf-parse.c (java_parse_file): Finalize cgraph after emitting
	class tables.

Index: jcf-parse.c
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision
diff -u -p -r1.118.2.21 jcf-parse.c
--- jcf-parse.c	1 Dec 2003 19:39:12 -0000
+++ jcf-parse.c	2 Dec 2003 05:05:20 -0000
@@ -1112,9 +1112,7 @@ java_parse_file (int set_yydebug ATTRIBU
   java_expand_classes ();
   if (!java_report_errors () && !flag_syntax_only)
-      /* Optimize and expand all classes compiled from source.  */
-      cgraph_finalize_compilation_unit ();
-      cgraph_optimize ();
+      /* Expand all classes compiled from source.  */
       java_finish_classes ();
       /* Emit the .jcf section.  */
@@ -1131,6 +1129,11 @@ java_parse_file (int set_yydebug ATTRIBU
 	     atable_decl, atable_methods, atable_syms_decl, ptr_type_node);
       emit_catch_table ();
+      /* Only finalize the compilation unit after we've told cgraph which
+	 functions have their addresses stored.  */
+      cgraph_finalize_compilation_unit ();
+      cgraph_optimize ();
   write_resource_constructor ();

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