summaryrefslogtreecommitdiffstats
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-05 21:10:07 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-05 21:10:07 +0000
commitdd82eabd026e382d6bd34ab49c80521efbde3dae (patch)
tree6125e0290d9b6e83ae6f4e2dd48bdf11dfdaa937 /gcc/java/class.c
parent42d4b3a532d14e9c51cfa4f3e8e987eee118cea1 (diff)
downloadppe42-gcc-dd82eabd026e382d6bd34ab49c80521efbde3dae.tar.gz
ppe42-gcc-dd82eabd026e382d6bd34ab49c80521efbde3dae.zip
d
* class.c (make_field_value): DECL_INITIAL may be a string literal; temporarily zero it while calling rest_of_decl_compilation. * java-tree.h (string_ptr_type_node): Add declaration. * decl.c: Define and initialize string_ptr_type_node. * parse.y (patch_string_cst): Use string_ptr_type_node. * parse.h (LOOP_HAS_LABEL_P, LOOP_HAS_LABEL_SKIP_P): Removed. * parse.y (for_statement): Now unconditionally exit_block. (finish_labeled_statement): No longer exit_block if for-loop. (patch_loop_statement): Check harder if the loop is already labeled. * parse.y (patch_initialized_static_field): Removed function. (maybe_generate_clinit): Removed special handling for interfaces. (java_complete_expand_methods): Do a preliminary java_complete_tree on <clinit> to determine if it can be removed. (java_complete_expand_method): Remove special handling for <clinit>. (java_complete_lhs): For BLOCK and EXPR_WITH_FILE_LOCATION optimize if we get back empty_stmt_node. For MODIFY_EXPR, re-do checking of static initializers. (fold_constant_for_init): Don't return immediate if VAR_DECL. For VAR_DECL, pass correct context. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26790 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index e7f72ae1170..2e00e74eb47 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -1025,9 +1025,16 @@ make_class_data (type)
tree init = make_field_value (field);
if (FIELD_STATIC (field))
{
+ tree initial = DECL_INITIAL (field);
static_field_count++;
static_fields = tree_cons (NULL_TREE, init, static_fields);
+ /* If the initial value is a string constant,
+ prevent output_constant from trying to assemble the value. */
+ if (initial != NULL_TREE
+ && TREE_TYPE (initial) == string_ptr_type_node)
+ DECL_INITIAL (field) = NULL_TREE;
rest_of_decl_compilation (field, (char*) 0, 1, 1);
+ DECL_INITIAL (field) = initial;
}
else
{
OpenPOWER on IntegriCloud