This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: 'otable_syms' defined but not used
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Michael Koch <konqueror at gmx dot de>
- Cc: Bryce McKinlay <bryce at mckinlay dot net dot nz>, <java-patches at gcc dot gnu dot org>
- Date: Sat, 20 Sep 2003 15:20:07 -0400 (EDT)
- Subject: Re: 'otable_syms' defined but not used
On Sat, 20 Sep 2003, Michael Koch wrote:
> I tried to compile libgcj with GCJFLAGS="-Wall -Werror" just for fun.
> Unfortunately it didnt even compiled the first java file it wanted to
> compile: java/lang/Class.java. I got this:
Interesting, I've never tried -Wall in libgcj. There are a lot of
warnings!
> Is there a way to not define 'otable_syms' if it is unused ?
Try this. It passed a full "make check" in libjava.
Jeff
2003-09-20 Jeff Sturm <jsturm@one-point.com>
* decl.c (java_init_decl_processing): Don't emit otable decls
if flag_indirect_dispatch is not set.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/decl.c,v
retrieving revision 1.160
diff -u -p -r1.160 decl.c
--- decl.c 3 Sep 2003 13:44:43 -0000 1.160
+++ decl.c 20 Sep 2003 19:16:32 -0000
@@ -634,17 +634,21 @@ java_init_decl_processing (void)
method_symbols_array_ptr_type = build_pointer_type
(method_symbols_array_type);
- otable_decl = build_decl (VAR_DECL, get_identifier ("otable"), otable_type);
- DECL_EXTERNAL (otable_decl) = 1;
- TREE_STATIC (otable_decl) = 1;
- TREE_READONLY (otable_decl) = 1;
- pushdecl (otable_decl);
+ if (flag_indirect_dispatch)
+ {
+ otable_decl = build_decl (VAR_DECL, get_identifier ("otable"),
+ otable_type);
+ DECL_EXTERNAL (otable_decl) = 1;
+ TREE_STATIC (otable_decl) = 1;
+ TREE_READONLY (otable_decl) = 1;
+ pushdecl (otable_decl);
- otable_syms_decl = build_decl (VAR_DECL, get_identifier ("otable_syms"),
- method_symbols_array_type);
- TREE_STATIC (otable_syms_decl) = 1;
- TREE_CONSTANT (otable_syms_decl) = 1;
- pushdecl (otable_syms_decl);
+ otable_syms_decl = build_decl (VAR_DECL, get_identifier ("otable_syms"),
+ method_symbols_array_type);
+ TREE_STATIC (otable_syms_decl) = 1;
+ TREE_CONSTANT (otable_syms_decl) = 1;
+ pushdecl (otable_syms_decl);
+ }
PUSH_FIELD (object_type_node, field, "vtable", dtable_ptr_type);
/* This isn't exactly true, but it is what we have in the source.