aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-07-13 18:25:37 +0000
committerTom Tromey <tromey@cygnus.com>2000-07-13 18:25:37 +0000
commit71a451aefb131e5de8e0af427f0a4ffc80a0aa93 (patch)
tree459d2e71b69887ae82c69e2f0d2cb7337f225fc7
parentcc6cba6f06eccdea626088566da1fcd32b65d2b0 (diff)
* lang-specs.h: Added %{I*}.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@35018 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/jcf-write.c24
-rw-r--r--gcc/java/lang-specs.h2
3 files changed, 27 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 0edfafbceff..4857d018219 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2000-07-13 Tom Tromey <tromey@cygnus.com>
+
+ * lang-specs.h: Added %{I*}.
+
2000-07-13 Zack Weinberg <zack@wolery.cumb.org>
* lang-specs.h: Use the new named specs. Remove unnecessary braces.
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 538c1a24f54..0ef29cab20b 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -290,6 +290,7 @@ static struct jcf_block * get_jcf_label_here PARAMS ((struct jcf_partial *));
static void put_linenumber PARAMS ((int, struct jcf_partial *));
static void localvar_alloc PARAMS ((tree, struct jcf_partial *));
static void localvar_free PARAMS ((tree, struct jcf_partial *));
+static void localvar_finish PARAMS ((tree, struct jcf_partial *));
static int get_access_flags PARAMS ((tree));
static void write_chunks PARAMS ((FILE *, struct chunk *));
static int adjust_typed_op PARAMS ((tree, int));
@@ -644,6 +645,25 @@ localvar_free (decl, state)
}
}
+/* Like localvar_free, but leaves the variable allocated. This lets
+ us avoid problems with inappropriate variable reuse in some
+ situations. */
+static void
+localvar_finish (decl, state)
+ tree decl;
+ struct jcf_partial *state;
+{
+ struct jcf_block *end_label = get_jcf_label_here (state);
+ int index = DECL_LOCAL_INDEX (decl);
+ register struct localvar_info **ptr = &localvar_buffer [index];
+ register struct localvar_info *info = *ptr;
+
+ info->end_label = end_label;
+
+ if (info->decl != decl)
+ abort ();
+}
+
#define STACK_TARGET 1
#define IGNORE_TARGET 2
@@ -2379,7 +2399,7 @@ generate_bytecode_insns (exp, target, state)
RESERVE (1);
OP1 (OPCODE_athrow);
NOTE_POP (1);
- localvar_free (exception_decl, state);
+ localvar_finish (exception_decl, state);
/* The finally block. First save return PC into return_link. */
define_jcf_label (finally_label, state);
@@ -2388,7 +2408,7 @@ generate_bytecode_insns (exp, target, state)
generate_bytecode_insns (finally, IGNORE_TARGET, state);
maybe_wide (OPCODE_ret, DECL_LOCAL_INDEX (return_link), state);
- localvar_free (return_link, state);
+ localvar_finish (return_link, state);
define_jcf_label (finished_label, state);
}
break;
diff --git a/gcc/java/lang-specs.h b/gcc/java/lang-specs.h
index c03301852dc..d912724dc30 100644
--- a/gcc/java/lang-specs.h
+++ b/gcc/java/lang-specs.h
@@ -31,6 +31,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
{".jar", "@java" },
{"@java",
"%{fjni:%{femit-class-file:%e-fjni and -femit-class-file are incompatible}}\
- %{!E:jc1 %i %(cc1_options) %{+e*} %{MD} %{MMD} %{M} %{MM}\
+ %{!E:jc1 %i %(cc1_options) %{+e*} %{I*} %{MD} %{MMD} %{M} %{MM}\
%{!S:-o %{|!pipe:%g.s} |\n\
as %(asm_options) %{!pipe:%g.s} %A }}"},