This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/5537] Error compiling simple bytecode with jsr


------- Additional Comments From rmathew at gcc dot gnu dot org  2004-07-15 06:05 -------
The problem is that for the instruction following a jsr,
we need to merge the type state just before the jsr with
the modified type state from the ret of the subroutine
that the jsr calls - we were not keeping track of the type
state before the jsr at all, leading to this bug.

I have a very simple patch that fixes this bug, but it
unfortunately reveals other problems in the verifier,
some of which cause libjava testsuite failures. I'll
submit a full patch if I'm able to resolve these.

Here is the simple patch that cures the bug exposed by
this PR as against the current mainline:

Index: verify.c
===================================================================
--- verify.c    2004-07-15 11:19:53.000000000 +0530
+++ verify.c    2004-07-15 11:21:41.000000000 +0530
@@ -1346,6 +1346,10 @@ verify_jvm_instructions (JCF* jcf, const
          {
            tree target = lookup_label (oldpc + IMMEDIATE_s2);
            tree return_label = lookup_label (PC);
+           if (LABEL_TYPE_STATE (return_label) == NULL_TREE)
+             {
+               merge_type_state (return_label);
+             }
            PUSH_TYPE (return_address_type_node);
            /* The return label chain will be null if this is the first
               time we've seen this jsr target.  */

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5537


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]