aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/constants.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-04-27 11:18:38 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-04-27 11:18:38 +0000
commit211ca15cb41d3ae362b6e0b01e47344a9b30d987 (patch)
tree311268027d8b08e109c2a84ccb88ed8b40680011 /gcc/java/constants.c
parentfca5f3d11ce7bc4c2c1b302217d0a4247f2596fd (diff)
downloadgcc-211ca15cb41d3ae362b6e0b01e47344a9b30d987.zip
gcc-211ca15cb41d3ae362b6e0b01e47344a9b30d987.tar.gz
gcc-211ca15cb41d3ae362b6e0b01e47344a9b30d987.tar.bz2
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
Diffstat (limited to 'gcc/java/constants.c')
-rw-r--r--gcc/java/constants.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index 526d9c7..70d628b 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -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));