summaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-17 17:39:05 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-17 17:39:05 +0000
commitf6875e9cc74abd2ec3b000074accd89b2b7f53d7 (patch)
tree96d693db1f60c111e9a3672d73aabfa2c5980216 /gcc/java/decl.c
parent25de73d538fa5bd4b0d2fa83b5d875c63b56f5bd (diff)
downloadgcc-f6875e9cc74abd2ec3b000074accd89b2b7f53d7.tar.gz
2003-09-12 Andrew Haley <aph@redhat.com>
* java-tree.h (LOCAL_VAR_OUT_OF_SCOPE_P): New. (struct lang_decl_var:freed): New variable. * decl.c (poplevel): Mark local vars that have gone out of scope. (push_jvm_slot): Don't use the RTL of a var that has gone out of scope. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73675 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r--gcc/java/decl.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index e23cb120c3a..4b0c4963f3a 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -116,7 +116,8 @@ push_jvm_slot (int index, tree decl)
tmp = TREE_VEC_ELT (decl_map, index);
while (tmp != NULL_TREE)
{
- if (TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (tmp)))
+ if (TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (tmp))
+ && ! LOCAL_VAR_OUT_OF_SCOPE_P (tmp))
rtl = DECL_RTL_IF_SET (tmp);
if (rtl != NULL)
break;
@@ -1266,6 +1267,7 @@ poplevel (int keep, int reverse, int functionbody)
tree block = 0;
tree decl;
int block_previously_created;
+ {
#if defined(DEBUG_JAVA_BINDING_LEVELS)
binding_depth--;
@@ -1306,12 +1308,13 @@ poplevel (int keep, int reverse, int functionbody)
&& DECL_INITIAL (decl) != 0
&& TREE_ADDRESSABLE (decl))
{
- /* If this decl was copied from a file-scope decl
- on account of a block-scope extern decl,
- propagate TREE_ADDRESSABLE to the file-scope decl.
-
- DECL_ABSTRACT_ORIGIN can be set to itself if warn_return_type is
- true, since then the decl goes through save_for_inline_copying. */
+ /* If this decl was copied from a file-scope decl on account
+ of a block-scope extern decl, propagate TREE_ADDRESSABLE
+ to the file-scope decl.
+
+ DECL_ABSTRACT_ORIGIN can be set to itself if
+ warn_return_type is true, since then the decl goes
+ through save_for_inline_copying. */
if (DECL_ABSTRACT_ORIGIN (decl) != 0
&& DECL_ABSTRACT_ORIGIN (decl) != decl)
TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1;
@@ -1322,6 +1325,11 @@ poplevel (int keep, int reverse, int functionbody)
pop_function_context ();
}
}
+ else if (TREE_CODE (decl) == VAR_DECL
+ && DECL_LANG_SPECIFIC (decl) != NULL
+ && DECL_LOCAL_SLOT_NUMBER (decl))
+ LOCAL_VAR_OUT_OF_SCOPE_P (decl) = 1;
+ }
/* If there were any declarations in that level,
or if this level is a function body,