From 40aaba2b814b0495d3ef50ccb0b607484c0866e7 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 26 May 2000 01:16:20 +0000 Subject: [PATCH] re GNATS gcj/162 (gcj does not initialize interfaces according to spec) * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC when trying to see if field's class should be initialized. Always initialize field's declaring class, not qualified class. For PR gcj/162. From-SVN: r34182 --- gcc/java/ChangeLog | 5 +++++ gcc/java/parse.c | 3 +-- gcc/java/parse.y | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index fefc0344e83..c1f0371357d 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,5 +1,10 @@ 2000-05-25 Tom Tromey + * parse.y (resolve_field_access): Don't check DECL_LANG_SPECIFIC + when trying to see if field's class should be initialized. Always + initialize field's declaring class, not qualified class. + For PR gcj/162. + * parse.y (array_constructor_check_entry): Pass `wfl_value', not `wfl_operator', to maybe_build_primttype_type_ref. Fixes PR gcj/235. diff --git a/gcc/java/parse.c b/gcc/java/parse.c index c89c2d24e37..17b8f23bdd7 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -11236,7 +11236,6 @@ resolve_field_access (qual_wfl, field_decl, field_type) is_static = JDECL_P (decl) && FIELD_STATIC (decl); if (FIELD_FINAL (decl) && JPRIMITIVE_TYPE_P (TREE_TYPE (decl)) - && DECL_LANG_SPECIFIC (decl) && DECL_INITIAL (decl)) { field_ref = DECL_INITIAL (decl); @@ -11250,7 +11249,7 @@ resolve_field_access (qual_wfl, field_decl, field_type) return error_mark_node; if (is_static && !static_final_found && !flag_emit_class_files && !flag_emit_xref) - field_ref = build_class_init (type_found, field_ref); + field_ref = build_class_init (DECL_CONTEXT (decl), field_ref); } else field_ref = decl; diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 317d1f89cbc..f504544b269 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -8604,7 +8604,6 @@ resolve_field_access (qual_wfl, field_decl, field_type) is_static = JDECL_P (decl) && FIELD_STATIC (decl); if (FIELD_FINAL (decl) && JPRIMITIVE_TYPE_P (TREE_TYPE (decl)) - && DECL_LANG_SPECIFIC (decl) && DECL_INITIAL (decl)) { field_ref = DECL_INITIAL (decl); @@ -8618,7 +8617,7 @@ resolve_field_access (qual_wfl, field_decl, field_type) return error_mark_node; if (is_static && !static_final_found && !flag_emit_class_files && !flag_emit_xref) - field_ref = build_class_init (type_found, field_ref); + field_ref = build_class_init (DECL_CONTEXT (decl), field_ref); } else field_ref = decl; -- 2.30.2