Commit 211ca15c by Richard Guenther Committed by Richard Biener

re PR java/38374 (constant pool references have wrong types in ADDR_EXPR)

2009-04-27  Richard Guenther  <rguenther@suse.de>

	* tree-cfg.c (remove_useless_stmts): Verify stmts afterwards.
	(verify_stmts): Dispatch to gimple/type verification code.
	* tree-inline.c (remap_gimple_op_r): Work around C++ FE
	issue with call argument types.

	java/
	PR java/38374
	* constants.c (build_constants_constructor): Retain the old
	pointer type as valid TYPE_POINTER_TO after patching the
	type of the constant pool decl.

From-SVN: r146831
parent fca5f3d1
2009-04-27 Richard Guenther <rguenther@suse.de>
* tree-cfg.c (remove_useless_stmts): Verify stmts afterwards.
(verify_stmts): Dispatch to gimple/type verification code.
* tree-inline.c (remap_gimple_op_r): Work around C++ FE
issue with call argument types.
2009-04-27 Michael Matz <matz@suse.de>
* tree-into-ssa.c (regs_to_rename, mem_syms_to_rename): Remove.
......
2009-04-27 Richard Guenther <rguenther@suse.de>
PR java/38374
* constants.c (build_constants_constructor): Retain the old
pointer type as valid TYPE_POINTER_TO after patching the
type of the constant pool decl.
2009-04-24 Ian Lance Taylor <iant@google.com>
* jcf-parse.c (handle_constant): Add cast to enum type.
......
......@@ -557,13 +557,22 @@ build_constants_constructor (void)
tree data_decl, tags_decl, tags_type;
tree max_index = build_int_cst (sizetype, outgoing_cpool->count - 1);
tree index_type = build_index_type (max_index);
tree tem;
/* Add dummy 0'th element of constant pool. */
tags_list = tree_cons (NULL_TREE, get_tag_node (0), tags_list);
data_list = tree_cons (NULL_TREE, null_pointer_node, data_list);
/* Change the type of the decl to have the proper array size.
??? Make sure to transition the old type-pointer-to list to this
new type to not invalidate all build address expressions. */
data_decl = build_constant_data_ref (false);
tem = TYPE_POINTER_TO (TREE_TYPE (data_decl));
if (!tem)
tem = build_pointer_type (TREE_TYPE (data_decl));
TYPE_POINTER_TO (TREE_TYPE (data_decl)) = NULL_TREE;
TREE_TYPE (data_decl) = build_array_type (ptr_type_node, index_type);
TYPE_POINTER_TO (TREE_TYPE (data_decl)) = tem;
DECL_INITIAL (data_decl) = build_constructor_from_list
(TREE_TYPE (data_decl), data_list);
DECL_SIZE (data_decl) = TYPE_SIZE (TREE_TYPE (data_decl));
......
......@@ -2084,6 +2084,11 @@ remove_useless_stmts (void)
remove_useless_stmts_1 (&gsi, &data);
}
while (data.repeat);
#ifdef ENABLE_TYPES_CHECKING
verify_types_in_gimple_seq (gimple_body (current_function_decl));
#endif
return 0;
}
......@@ -4313,6 +4318,14 @@ verify_stmts (void)
err |= true;
}
}
#ifdef ENABLE_TYPES_CHECKING
if (verify_gimple_phi (phi))
{
debug_gimple_stmt (phi);
err |= true;
}
#endif
}
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
......@@ -4349,6 +4362,14 @@ verify_stmts (void)
}
err |= verify_stmt (&gsi);
#ifdef ENABLE_TYPES_CHECKING
if (verify_types_in_gimple_stmt (gsi_stmt (gsi)))
{
debug_gimple_stmt (stmt);
err |= true;
}
#endif
addr = walk_gimple_op (gsi_stmt (gsi), verify_node_sharing, &wi);
if (addr)
{
......
......@@ -705,6 +705,13 @@ remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
gcc_assert (new_decl);
/* Replace this variable with the copy. */
STRIP_TYPE_NOPS (new_decl);
/* ??? The C++ frontend uses void * pointer zero to initialize
any other type. This confuses the middle-end type verification.
As cloned bodies do not go through gimplification again the fixup
there doesn't trigger. */
if (TREE_CODE (new_decl) == INTEGER_CST
&& !useless_type_conversion_p (TREE_TYPE (*tp), TREE_TYPE (new_decl)))
new_decl = fold_convert (TREE_TYPE (*tp), new_decl);
*tp = new_decl;
*walk_subtrees = 0;
}
......
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