Commit c4e64f39 by Nathan Froyd Committed by Nathan Froyd

re PR middle-end/44103 (New Java test failures)

	PR 44103
	* java-tree.h (START_RECORD_CONSTRUCTOR): Change first argument to a
	vector.  Move call to build_constructor...
	(FINISH_RECORD_CONSTRUCTOR): ...here.  Add necessary arguments.  Clear
	TREE_CONSTANT on the constructor.
	(PUSH_SUPER_VALUE): Change first argument to a vector.
	(PUSH_FIELD_VALUE): Likewise.
	* resource.c (compile_resource_data): Update calls to above macros.
	* constants.c (build_constants_constructor): Likewise.
	* class.c (build_utf8_ref): Likewise.
	(make_field_value): Likewise.
	(make_method_value): Likewise.
	(add_table_and_syms): New function.
	(make_class_data): Call it.  Update calls to above macros.
	(build_symbol_table_entry): New function.
	(build_symbol_entry): Call it.  Update calls to above macros.
	(emit_symbol_table): Likewise.
	(make_catch_class_record): Update calls to above macros.
	(build_assertion_table_entry): New function.
	(add_assertion_table_entry): Call it.
	(emit_assertion_table): Likewise.

From-SVN: r159414
parent bc8ddfe6
2010-05-14 Nathan Froyd <froydnj@codesourcery.com>
PR 44103
* java-tree.h (START_RECORD_CONSTRUCTOR): Change first argument to a
vector. Move call to build_constructor...
(FINISH_RECORD_CONSTRUCTOR): ...here. Add necessary arguments. Clear
TREE_CONSTANT on the constructor.
(PUSH_SUPER_VALUE): Change first argument to a vector.
(PUSH_FIELD_VALUE): Likewise.
* resource.c (compile_resource_data): Update calls to above macros.
* constants.c (build_constants_constructor): Likewise.
* class.c (build_utf8_ref): Likewise.
(make_field_value): Likewise.
(make_method_value): Likewise.
(add_table_and_syms): New function.
(make_class_data): Call it. Update calls to above macros.
(build_symbol_table_entry): New function.
(build_symbol_entry): Call it. Update calls to above macros.
(emit_symbol_table): Likewise.
(make_catch_class_record): Update calls to above macros.
(build_assertion_table_entry): New function.
(add_assertion_table_entry): Call it.
(emit_assertion_table): Likewise.
2010-05-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 40989
......
......@@ -500,6 +500,7 @@ build_constants_constructor (void)
tree cons;
tree tags_list = NULL_TREE;
tree data_list = NULL_TREE;
VEC(constructor_elt,gc) *v = NULL;
int i;
for (i = outgoing_cpool->count; --i > 0; )
......@@ -596,12 +597,12 @@ build_constants_constructor (void)
data_value = null_pointer_node;
tags_value = null_pointer_node;
}
START_RECORD_CONSTRUCTOR (cons, constants_type_node);
PUSH_FIELD_VALUE (cons, "size",
START_RECORD_CONSTRUCTOR (v, constants_type_node);
PUSH_FIELD_VALUE (v, "size",
build_int_cst (NULL_TREE, outgoing_cpool->count));
PUSH_FIELD_VALUE (cons, "tags", tags_value);
PUSH_FIELD_VALUE (cons, "data", data_value);
FINISH_RECORD_CONSTRUCTOR (cons);
PUSH_FIELD_VALUE (v, "tags", tags_value);
PUSH_FIELD_VALUE (v, "data", data_value);
FINISH_RECORD_CONSTRUCTOR (cons, v, constants_type_node);
return cons;
}
......
......@@ -1461,50 +1461,54 @@ extern tree *type_map;
#define FINISH_RECORD(RTYPE) layout_type (RTYPE)
/* Start building a RECORD_TYPE constructor with a given TYPE in CONS. */
#define START_RECORD_CONSTRUCTOR(CONS, CTYPE) \
/* Start building a RECORD_TYPE constructor's elements in V. The
constructor will have type CTYPE. */
#define START_RECORD_CONSTRUCTOR(V, CTYPE) \
do \
{ \
CONS = build_constructor ((CTYPE), VEC_alloc (constructor_elt, gc, 0)); \
CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (CONS), TYPE_FIELDS (CTYPE), \
NULL); \
V = VEC_alloc (constructor_elt, gc, 0); \
CONSTRUCTOR_APPEND_ELT (V, TYPE_FIELDS (CTYPE), NULL); \
} \
while (0)
/* Append a field initializer to CONS for the dummy field for the inherited
/* Append a field initializer to V for the dummy field for the inherited
fields. The dummy field has the given VALUE, and the same type as the
super-class. Must be specified before calls to PUSH_FIELD_VALUE. */
#define PUSH_SUPER_VALUE(CONS, VALUE) \
#define PUSH_SUPER_VALUE(V, VALUE) \
do \
{ \
constructor_elt *_elt___ = VEC_last (constructor_elt, \
CONSTRUCTOR_ELTS (CONS)); \
constructor_elt *_elt___ = VEC_last (constructor_elt, V); \
tree _next___ = TREE_CHAIN (_elt___->index); \
gcc_assert (!DECL_NAME (_elt___->index)); \
_elt___->value = VALUE; \
CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (CONS), _next___, NULL); \
CONSTRUCTOR_APPEND_ELT (V, _next___, NULL); \
} \
while (0)
/* Append a field initializer to CONS for a field with the given VALUE.
/* Append a field initializer to V for a field with the given VALUE.
NAME is a char* string used for error checking;
the initializer must be specified in order. */
#define PUSH_FIELD_VALUE(CONS, NAME, VALUE) \
#define PUSH_FIELD_VALUE(V, NAME, VALUE) \
do \
{ \
constructor_elt *_elt___ = VEC_last (constructor_elt, \
CONSTRUCTOR_ELTS (CONS)); \
constructor_elt *_elt___ = VEC_last (constructor_elt, V); \
tree _next___ = TREE_CHAIN (_elt___->index); \
gcc_assert (strcmp (IDENTIFIER_POINTER (DECL_NAME (_elt___->index)), \
NAME) == 0); \
_elt___->value = VALUE; \
CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (CONS), _next___, NULL); \
CONSTRUCTOR_APPEND_ELT (V, _next___, NULL); \
} \
while (0)
/* Finish creating a record CONSTRUCTOR CONS. */
#define FINISH_RECORD_CONSTRUCTOR(CONS) \
VEC_pop (constructor_elt, CONSTRUCTOR_ELTS (CONS))
/* Finish creating a record CONSTRUCTOR CONS with type CTYPE and elements V. */
#define FINISH_RECORD_CONSTRUCTOR(CONS, V, CTYPE) \
do \
{ \
VEC_pop (constructor_elt, V); \
CONS = build_constructor (CTYPE, V); \
TREE_CONSTANT (CONS) = 0; \
} \
while (0)
#define BLOCK_EXPR_DECLS(NODE) BLOCK_VARS(NODE)
#define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE)
......
......@@ -55,6 +55,7 @@ void
compile_resource_data (const char *name, const char *buffer, int length)
{
tree rtype, field = NULL_TREE, data_type, rinit, data, decl;
VEC(constructor_elt,gc) *v = NULL;
data_type = build_prim_array_type (unsigned_byte_type_node,
strlen (name) + length);
......@@ -65,15 +66,15 @@ compile_resource_data (const char *name, const char *buffer, int length)
rtype, field, "resource_length", unsigned_int_type_node);
PUSH_FIELD (input_location, rtype, field, "data", data_type);
FINISH_RECORD (rtype);
START_RECORD_CONSTRUCTOR (rinit, rtype);
PUSH_FIELD_VALUE (rinit, "name_length",
START_RECORD_CONSTRUCTOR (v, rtype);
PUSH_FIELD_VALUE (v, "name_length",
build_int_cst (NULL_TREE, strlen (name)));
PUSH_FIELD_VALUE (rinit, "resource_length",
PUSH_FIELD_VALUE (v, "resource_length",
build_int_cst (NULL_TREE, length));
data = build_string (strlen(name) + length, buffer);
TREE_TYPE (data) = data_type;
PUSH_FIELD_VALUE (rinit, "data", data);
FINISH_RECORD_CONSTRUCTOR (rinit);
PUSH_FIELD_VALUE (v, "data", data);
FINISH_RECORD_CONSTRUCTOR (rinit, v, rtype);
TREE_CONSTANT (rinit) = 1;
decl = build_decl (input_location,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment