aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@cygnus.com>2000-07-07 00:49:36 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-07-06 17:49:36 -0700
commit98a52c2ccf0f7c28c910a2bc17d0e97ff9f28bdb (patch)
tree0d9007d5892ffb0c44e98f6a33be8436e92322e8
parent24c3c71a8c15e208765dff463ba2b7a3f34fe82a (diff)
downloadgcc-98a52c2ccf0f7c28c910a2bc17d0e97ff9f28bdb.zip
gcc-98a52c2ccf0f7c28c910a2bc17d0e97ff9f28bdb.tar.gz
gcc-98a52c2ccf0f7c28c910a2bc17d0e97ff9f28bdb.tar.bz2
Java: fixes for the PRs gcj/{271,272,275}.
2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (parser_qualified_classname): Removed parameter `is_static'. (create_interface): Removed first passed parameter to parser_qualified_classname. (create_class): Likewise. Don't install alias on static innerclasses. Fixes gcj/275. 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (maybe_generate_pre_expand_clinit): Don't build a debugable statement with empty_stmt_node. Fixes gcj/272 2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com> * expr.c (build_instanceof): Layout type after it's loaded. Fixes gcj/271. (Fix to the PR gcj/271, gcj/272 and gcj/275: http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00000.html http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00002.html http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00001.html ) From-SVN: r34894
-rw-r--r--gcc/java/ChangeLog19
-rw-r--r--gcc/java/expr.c1
-rw-r--r--gcc/java/parse.c21
-rw-r--r--gcc/java/parse.y21
4 files changed, 32 insertions, 30 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 7c7c5d9..e6deecd 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -16,6 +16,25 @@
argument on the first pass for CNI as well as JNI.
(print_method_info): Set up method name on the first pass only.
+2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * parse.y (parser_qualified_classname): Removed parameter
+ `is_static'.
+ (create_interface): Removed first passed parameter to
+ parser_qualified_classname.
+ (create_class): Likewise. Don't install alias on static
+ innerclasses. Fixes gcj/275.
+
+2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * parse.y (maybe_generate_pre_expand_clinit): Don't build a
+ debugable statement with empty_stmt_node. Fixes gcj/272
+
+2000-07-01 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * expr.c (build_instanceof): Layout type after it's loaded. Fixes
+ gcj/271.
+
2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-write.c (push_long_const): Appropriately cast short negative
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 5b9b729..f01940f 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1073,6 +1073,7 @@ build_instanceof (value, type)
if (CLASS_P (type) && ! CLASS_LOADED_P (type))
{
load_class (type, 1);
+ safe_layout_class (type);
if (! TYPE_SIZE (type) || TREE_CODE (TYPE_SIZE (type)) == ERROR_MARK)
return error_mark_node;
}
diff --git a/gcc/java/parse.c b/gcc/java/parse.c
index 6d6715e..2910e44 100644
--- a/gcc/java/parse.c
+++ b/gcc/java/parse.c
@@ -156,7 +156,7 @@ static tree find_field PARAMS ((tree, tree));
static tree lookup_field_wrapper PARAMS ((tree, tree));
static int duplicate_declaration_error_p PARAMS ((tree, tree, tree));
static void register_fields PARAMS ((int, tree, tree));
-static tree parser_qualified_classname PARAMS ((int, tree));
+static tree parser_qualified_classname PARAMS ((tree));
static int parser_check_super PARAMS ((tree, tree, tree));
static int parser_check_super_interface PARAMS ((tree, tree, tree));
static void check_modifiers_consistency PARAMS ((int));
@@ -6347,7 +6347,7 @@ create_interface (flags, id, super)
tree id, super;
{
tree raw_name = EXPR_WFL_NODE (id);
- tree q_name = parser_qualified_classname (flags & ACC_STATIC, raw_name);
+ tree q_name = parser_qualified_classname (raw_name);
tree decl = IDENTIFIER_CLASS_VALUE (q_name);
EXPR_WFL_NODE (id) = q_name; /* Keep source location, even if refined. */
@@ -6482,7 +6482,7 @@ create_class (flags, id, super, interfaces)
tree class_id, decl;
tree super_decl_type;
- class_id = parser_qualified_classname (0, raw_name);
+ class_id = parser_qualified_classname (raw_name);
decl = IDENTIFIER_CLASS_VALUE (class_id);
EXPR_WFL_NODE (id) = class_id;
@@ -6538,13 +6538,6 @@ create_class (flags, id, super, interfaces)
CLASS_COMPLETE_P (decl) = 1;
add_superinterfaces (decl, interfaces);
- /* If the class is a top level inner class, install an alias. */
- if (INNER_CLASS_DECL_P (decl) && CLASS_STATIC (decl))
- {
- tree alias = parser_qualified_classname (1, raw_name);
- IDENTIFIER_GLOBAL_VALUE (alias) = decl;
- }
-
/* Add the private this$<n> field, Replicate final locals still in
scope as private final fields mangled like val$<local_name>.
This doesn't not occur for top level (static) inner classes. */
@@ -7484,14 +7477,12 @@ unresolved_type_p (wfl, returned)
qualification from the current package definition. */
static tree
-parser_qualified_classname (is_static, name)
- int is_static;
+parser_qualified_classname (name)
tree name;
{
tree nested_class_name;
- if (!is_static
- && (nested_class_name = maybe_make_nested_class_name (name)))
+ if ((nested_class_name = maybe_make_nested_class_name (name)))
return nested_class_name;
if (ctxp->package)
@@ -10159,7 +10150,7 @@ maybe_generate_pre_expand_clinit (class_type)
/* We build the assignment expression that will initialize the
field to its value. There are strict rules on static
initializers (8.5). FIXME */
- if (TREE_CODE (stmt) != BLOCK)
+ if (TREE_CODE (stmt) != BLOCK && stmt != empty_stmt_node)
stmt = build_debugable_stmt (EXPR_WFL_LINECOL (stmt), stmt);
java_method_add_stmt (mdecl, stmt);
}
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index da0a219..42274e6 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -81,7 +81,7 @@ static tree find_field PARAMS ((tree, tree));
static tree lookup_field_wrapper PARAMS ((tree, tree));
static int duplicate_declaration_error_p PARAMS ((tree, tree, tree));
static void register_fields PARAMS ((int, tree, tree));
-static tree parser_qualified_classname PARAMS ((int, tree));
+static tree parser_qualified_classname PARAMS ((tree));
static int parser_check_super PARAMS ((tree, tree, tree));
static int parser_check_super_interface PARAMS ((tree, tree, tree));
static void check_modifiers_consistency PARAMS ((int));
@@ -3649,7 +3649,7 @@ create_interface (flags, id, super)
tree id, super;
{
tree raw_name = EXPR_WFL_NODE (id);
- tree q_name = parser_qualified_classname (flags & ACC_STATIC, raw_name);
+ tree q_name = parser_qualified_classname (raw_name);
tree decl = IDENTIFIER_CLASS_VALUE (q_name);
EXPR_WFL_NODE (id) = q_name; /* Keep source location, even if refined. */
@@ -3784,7 +3784,7 @@ create_class (flags, id, super, interfaces)
tree class_id, decl;
tree super_decl_type;
- class_id = parser_qualified_classname (0, raw_name);
+ class_id = parser_qualified_classname (raw_name);
decl = IDENTIFIER_CLASS_VALUE (class_id);
EXPR_WFL_NODE (id) = class_id;
@@ -3840,13 +3840,6 @@ create_class (flags, id, super, interfaces)
CLASS_COMPLETE_P (decl) = 1;
add_superinterfaces (decl, interfaces);
- /* If the class is a top level inner class, install an alias. */
- if (INNER_CLASS_DECL_P (decl) && CLASS_STATIC (decl))
- {
- tree alias = parser_qualified_classname (1, raw_name);
- IDENTIFIER_GLOBAL_VALUE (alias) = decl;
- }
-
/* Add the private this$<n> field, Replicate final locals still in
scope as private final fields mangled like val$<local_name>.
This doesn't not occur for top level (static) inner classes. */
@@ -4786,14 +4779,12 @@ unresolved_type_p (wfl, returned)
qualification from the current package definition. */
static tree
-parser_qualified_classname (is_static, name)
- int is_static;
+parser_qualified_classname (name)
tree name;
{
tree nested_class_name;
- if (!is_static
- && (nested_class_name = maybe_make_nested_class_name (name)))
+ if ((nested_class_name = maybe_make_nested_class_name (name)))
return nested_class_name;
if (ctxp->package)
@@ -7461,7 +7452,7 @@ maybe_generate_pre_expand_clinit (class_type)
/* We build the assignment expression that will initialize the
field to its value. There are strict rules on static
initializers (8.5). FIXME */
- if (TREE_CODE (stmt) != BLOCK)
+ if (TREE_CODE (stmt) != BLOCK && stmt != empty_stmt_node)
stmt = build_debugable_stmt (EXPR_WFL_LINECOL (stmt), stmt);
java_method_add_stmt (mdecl, stmt);
}