Message ID | 20130504072024.GF28963@tucnak.redhat.com |
---|---|
State | New |
Headers | show |
On Sat, May 04, 2013 at 09:20:24AM +0200, Jakub Jelinek wrote: > 2013-05-04 Jakub Jelinek <jakub@redhat.com> > > PR libgcj/57074 > * class.c (emit_symbol_table): Use array type of the > right size for the_syms_decl and its DECL_INITIAL, instead > of symbols_array_type. Set TREE_TYPE (the_syms_decl) to it. > (emit_assertion_table): Use array type of the right size > for table_decl and its DECL_INITIAL. This passes bootstrap and regression test on powerpc64-linux, with my .org validataion patch applied. Thanks!
>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
Jakub> 2013-05-04 Jakub Jelinek <jakub@redhat.com>
Jakub> PR libgcj/57074
Jakub> * class.c (emit_symbol_table): Use array type of the
Jakub> right size for the_syms_decl and its DECL_INITIAL, instead
Jakub> of symbols_array_type. Set TREE_TYPE (the_syms_decl) to it.
Jakub> (emit_assertion_table): Use array type of the right size
Jakub> for table_decl and its DECL_INITIAL.
This is fine with me if it works.
The current code was always cheating here.
Tom
--- gcc/java/class.c.jj 2013-01-11 09:02:30.000000000 +0100 +++ gcc/java/class.c 2013-05-02 20:38:13.848886817 +0200 @@ -2958,9 +2958,14 @@ emit_symbol_table (tree name, tree the_t null_pointer_node); CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, null_symbol); - table = build_constructor (symbols_array_type, v); + tree symbols_arr_type + = build_prim_array_type (symbol_type, vec_safe_length (v)); + + table = build_constructor (symbols_arr_type, v); /* Make it the initial value for otable_syms and emit the decl. */ + TREE_TYPE (the_syms_decl) = symbols_arr_type; + relayout_decl (the_syms_decl); DECL_INITIAL (the_syms_decl) = table; DECL_ARTIFICIAL (the_syms_decl) = 1; DECL_IGNORED_P (the_syms_decl) = 1; @@ -3109,12 +3114,15 @@ emit_assertion_table (tree klass) null_pointer_node); CONSTRUCTOR_APPEND_ELT (v, NULL_TREE, null_entry); + + tree type + = build_prim_array_type (assertion_entry_type, vec_safe_length (v)); - ctor = build_constructor (assertion_table_type, v); + ctor = build_constructor (type, v); table_decl = build_decl (input_location, VAR_DECL, mangled_classname ("_type_assert_", klass), - assertion_table_type); + type); TREE_STATIC (table_decl) = 1; TREE_READONLY (table_decl) = 1;