diff options
| author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-13 19:30:47 +0000 |
|---|---|---|
| committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-13 19:30:47 +0000 |
| commit | d3dc666ea7fd95dabc401b23f0460dfd99f24174 (patch) | |
| tree | 381fbfa6314b752218f977d1bb3a01148c26892e /gcc/java/expr.c | |
| parent | b8ddb2e8d069c020eb01e7a0ebad5aa7a77939ef (diff) | |
| download | ppe42-gcc-d3dc666ea7fd95dabc401b23f0460dfd99f24174.tar.gz ppe42-gcc-d3dc666ea7fd95dabc401b23f0460dfd99f24174.zip | |
* expr.c (int highest_label_pc_this_method,
start_label_pc_this_method): New globals.
(lookup_label): Add start_label_pc_this_method to pc for label, and
update highest_label_pc_this_method. This prevents conflicts between
labels from different methods.
* java-tree.h: Declare new globals.
* jcf-parse.c (parse_class_file): If needed bump
start_label_pc_this_method and reset highest_label_pc_this_method.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100896 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
| -rw-r--r-- | gcc/java/expr.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index b48847126b8..90f8ff40460 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -138,6 +138,12 @@ int stack_pointer; const unsigned char *linenumber_table; int linenumber_count; +/* Largest pc so far in this method that has been passed to lookup_label. */ +int highest_label_pc_this_method = -1; + +/* Base value for this method to add to pc to get generated label. */ +int start_label_pc_this_method = 0; + void init_expr_processing (void) { @@ -1766,7 +1772,9 @@ lookup_label (int pc) { tree name; char buf[32]; - ASM_GENERATE_INTERNAL_LABEL(buf, "LJpc=", pc); + if (pc > highest_label_pc_this_method) + highest_label_pc_this_method = pc; + ASM_GENERATE_INTERNAL_LABEL(buf, "LJpc=", start_label_pc_this_method + pc); name = get_identifier (buf); if (IDENTIFIER_LOCAL_VALUE (name)) return IDENTIFIER_LOCAL_VALUE (name); |

