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> 2010-05-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 40989 PR 40989
......
...@@ -500,6 +500,7 @@ build_constants_constructor (void) ...@@ -500,6 +500,7 @@ build_constants_constructor (void)
tree cons; tree cons;
tree tags_list = NULL_TREE; tree tags_list = NULL_TREE;
tree data_list = NULL_TREE; tree data_list = NULL_TREE;
VEC(constructor_elt,gc) *v = NULL;
int i; int i;
for (i = outgoing_cpool->count; --i > 0; ) for (i = outgoing_cpool->count; --i > 0; )
...@@ -596,12 +597,12 @@ build_constants_constructor (void) ...@@ -596,12 +597,12 @@ build_constants_constructor (void)
data_value = null_pointer_node; data_value = null_pointer_node;
tags_value = null_pointer_node; tags_value = null_pointer_node;
} }
START_RECORD_CONSTRUCTOR (cons, constants_type_node); START_RECORD_CONSTRUCTOR (v, constants_type_node);
PUSH_FIELD_VALUE (cons, "size", PUSH_FIELD_VALUE (v, "size",
build_int_cst (NULL_TREE, outgoing_cpool->count)); build_int_cst (NULL_TREE, outgoing_cpool->count));
PUSH_FIELD_VALUE (cons, "tags", tags_value); PUSH_FIELD_VALUE (v, "tags", tags_value);
PUSH_FIELD_VALUE (cons, "data", data_value); PUSH_FIELD_VALUE (v, "data", data_value);
FINISH_RECORD_CONSTRUCTOR (cons); FINISH_RECORD_CONSTRUCTOR (cons, v, constants_type_node);
return cons; return cons;
} }
......
...@@ -1461,50 +1461,54 @@ extern tree *type_map; ...@@ -1461,50 +1461,54 @@ extern tree *type_map;
#define FINISH_RECORD(RTYPE) layout_type (RTYPE) #define FINISH_RECORD(RTYPE) layout_type (RTYPE)
/* Start building a RECORD_TYPE constructor with a given TYPE in CONS. */ /* Start building a RECORD_TYPE constructor's elements in V. The
#define START_RECORD_CONSTRUCTOR(CONS, CTYPE) \ constructor will have type CTYPE. */
#define START_RECORD_CONSTRUCTOR(V, CTYPE) \
do \ do \
{ \ { \
CONS = build_constructor ((CTYPE), VEC_alloc (constructor_elt, gc, 0)); \ V = VEC_alloc (constructor_elt, gc, 0); \
CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (CONS), TYPE_FIELDS (CTYPE), \ CONSTRUCTOR_APPEND_ELT (V, TYPE_FIELDS (CTYPE), NULL); \
NULL); \
} \ } \
while (0) 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 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. */ super-class. Must be specified before calls to PUSH_FIELD_VALUE. */
#define PUSH_SUPER_VALUE(CONS, VALUE) \ #define PUSH_SUPER_VALUE(V, VALUE) \
do \ do \
{ \ { \
constructor_elt *_elt___ = VEC_last (constructor_elt, \ constructor_elt *_elt___ = VEC_last (constructor_elt, V); \
CONSTRUCTOR_ELTS (CONS)); \
tree _next___ = TREE_CHAIN (_elt___->index); \ tree _next___ = TREE_CHAIN (_elt___->index); \
gcc_assert (!DECL_NAME (_elt___->index)); \ gcc_assert (!DECL_NAME (_elt___->index)); \
_elt___->value = VALUE; \ _elt___->value = VALUE; \
CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (CONS), _next___, NULL); \ CONSTRUCTOR_APPEND_ELT (V, _next___, NULL); \
} \ } \
while (0) 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; NAME is a char* string used for error checking;
the initializer must be specified in order. */ the initializer must be specified in order. */
#define PUSH_FIELD_VALUE(CONS, NAME, VALUE) \ #define PUSH_FIELD_VALUE(V, NAME, VALUE) \
do \ do \
{ \ { \
constructor_elt *_elt___ = VEC_last (constructor_elt, \ constructor_elt *_elt___ = VEC_last (constructor_elt, V); \
CONSTRUCTOR_ELTS (CONS)); \
tree _next___ = TREE_CHAIN (_elt___->index); \ tree _next___ = TREE_CHAIN (_elt___->index); \
gcc_assert (strcmp (IDENTIFIER_POINTER (DECL_NAME (_elt___->index)), \ gcc_assert (strcmp (IDENTIFIER_POINTER (DECL_NAME (_elt___->index)), \
NAME) == 0); \ NAME) == 0); \
_elt___->value = VALUE; \ _elt___->value = VALUE; \
CONSTRUCTOR_APPEND_ELT (CONSTRUCTOR_ELTS (CONS), _next___, NULL); \ CONSTRUCTOR_APPEND_ELT (V, _next___, NULL); \
} \ } \
while (0) while (0)
/* Finish creating a record CONSTRUCTOR CONS. */ /* Finish creating a record CONSTRUCTOR CONS with type CTYPE and elements V. */
#define FINISH_RECORD_CONSTRUCTOR(CONS) \ #define FINISH_RECORD_CONSTRUCTOR(CONS, V, CTYPE) \
VEC_pop (constructor_elt, CONSTRUCTOR_ELTS (CONS)) 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_DECLS(NODE) BLOCK_VARS(NODE)
#define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE) #define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE)
......
...@@ -55,6 +55,7 @@ void ...@@ -55,6 +55,7 @@ void
compile_resource_data (const char *name, const char *buffer, int length) compile_resource_data (const char *name, const char *buffer, int length)
{ {
tree rtype, field = NULL_TREE, data_type, rinit, data, decl; 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, data_type = build_prim_array_type (unsigned_byte_type_node,
strlen (name) + length); strlen (name) + length);
...@@ -65,15 +66,15 @@ compile_resource_data (const char *name, const char *buffer, int length) ...@@ -65,15 +66,15 @@ compile_resource_data (const char *name, const char *buffer, int length)
rtype, field, "resource_length", unsigned_int_type_node); rtype, field, "resource_length", unsigned_int_type_node);
PUSH_FIELD (input_location, rtype, field, "data", data_type); PUSH_FIELD (input_location, rtype, field, "data", data_type);
FINISH_RECORD (rtype); FINISH_RECORD (rtype);
START_RECORD_CONSTRUCTOR (rinit, rtype); START_RECORD_CONSTRUCTOR (v, rtype);
PUSH_FIELD_VALUE (rinit, "name_length", PUSH_FIELD_VALUE (v, "name_length",
build_int_cst (NULL_TREE, strlen (name))); 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)); build_int_cst (NULL_TREE, length));
data = build_string (strlen(name) + length, buffer); data = build_string (strlen(name) + length, buffer);
TREE_TYPE (data) = data_type; TREE_TYPE (data) = data_type;
PUSH_FIELD_VALUE (rinit, "data", data); PUSH_FIELD_VALUE (v, "data", data);
FINISH_RECORD_CONSTRUCTOR (rinit); FINISH_RECORD_CONSTRUCTOR (rinit, v, rtype);
TREE_CONSTANT (rinit) = 1; TREE_CONSTANT (rinit) = 1;
decl = build_decl (input_location, 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