diff options
author | Andrew Haley <aph@redhat.com> | 2005-02-14 14:58:22 +0000 |
---|---|---|
committer | Andrew Haley <aph@gcc.gnu.org> | 2005-02-14 14:58:22 +0000 |
commit | 891df09c5617d2c3614404ef855da2dca72534a2 (patch) | |
tree | a661e23976ca842861dc949f3ed1a8516a828a76 /gcc/java/decl.c | |
parent | d633cfe524a361b4a5d1845e9b7fb78c2d813d7c (diff) | |
download | gcc-891df09c5617d2c3614404ef855da2dca72534a2.zip gcc-891df09c5617d2c3614404ef855da2dca72534a2.tar.gz gcc-891df09c5617d2c3614404ef855da2dca72534a2.tar.bz2 |
re PR java/19907 (Incorrect code generated for ManifestElement.java)
2005-02-14 Andrew Haley <aph@redhat.com>
PR java/19907
* expr.c (expand_byte_code): Call promote_arguments().
(promote_arguments): New function.
* decl.c (check_local_unnamed_variable): Remve special case for
new verifier.
(find_local_variable): Promote all boolean types to int
when searching for local variable decls.
From-SVN: r95015
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r-- | gcc/java/decl.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c index ad1b55e..b7aa616 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -263,24 +263,14 @@ check_local_unnamed_variable (tree best, tree decl, tree type) initially held a pointer arg -- or vice versa -- we create a new VAR_DECL. - ???: As long as verification is correct, this will be a + ???: As long as verification is correct, this will be a compatible type. But maybe we should create a dummy variable and replace all references to it with the DECL and a - NOP_EXPR. + NOP_EXPR. */ || (TREE_CODE (decl_type) == POINTER_TYPE && TREE_CODE (decl) == PARM_DECL - && TREE_CODE (type) == POINTER_TYPE) - - /* The new verifier requires a similar treatment in the - situation where the parameter has an integral type which - promotes to `int'. */ - || (flag_new_verifier - && TREE_CODE (decl) == PARM_DECL - && INTEGRAL_TYPE_P (decl_type) - && TYPE_PRECISION (decl_type) <= 32 - && INTEGRAL_TYPE_P (type) - && TYPE_PRECISION (type) <= 32)) + && TREE_CODE (type) == POINTER_TYPE)) { if (best == NULL_TREE || (decl_type == type && TREE_TYPE (best) != type)) @@ -312,6 +302,16 @@ find_local_variable (int index, tree type, int pc ATTRIBUTE_UNUSED) tmp = DECL_LOCAL_SLOT_CHAIN (tmp); } + /* gcj has a function called promote_type(), which is used by both + the bytecode compiler and the source compiler. Unfortunately, + the type systems for the Java VM and the Java language are not + the same: a boolean in the VM promotes to an int, not to a wide + boolean. If our caller wants something to hold a boolean, that + had better be an int, because that slot might be re-used + later in integer context. */ + if (TREE_CODE (type) == BOOLEAN_TYPE) + type = integer_type_node; + /* If we don't find a match, create one with the type passed in. The name of the variable is #n#m, which n is the variable index in the local variable area and m is a dummy identifier for |