Bug 151756 - [compiler] unverifiable bytecode created with cvs head compiler
Summary: [compiler] unverifiable bytecode created with cvs head compiler
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.3 M2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-25 16:32 EDT by Tom Tromey CLA
Modified: 2007-01-16 02:49 EST (History)
0 users

See Also:


Attachments
test program (344 bytes, text/plain)
2006-07-25 16:32 EDT, Tom Tromey CLA
no flags Details
Proposed patch (1.10 KB, patch)
2006-08-14 14:16 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey CLA 2006-07-25 16:32:22 EDT
I'm using the ecj from cvs head.
For the attached java source code, the compiler generated invalid
bytecode.  The v_671 tagged compiler is correct here.

The bytecode for the method 'm' is not properly terminated:

...
 56: iload_1
 57: bipush 7
 59: if_icmple 62
 62: iinc 1 1
[that's it :-]
Comment 1 Tom Tromey CLA 2006-07-25 16:32:59 EDT
Created attachment 46779 [details]
test program
Comment 2 Olivier Thomann CLA 2006-08-14 14:16:26 EDT
Consequence of fix for bug 114894.
Philippe,

Please check the patch. Ideally we would like to set the lastAbruptPosition to the lastAbruptPosiiton before the optimized goto, but we lost it. I chose to reset it to -1 to prevent the side effect like this VerifyError.
If this is not the right value, we will have to keep a stack of abrupt positions.
I will release this patch meanwhile to prevent that kind of code to fail. In the worse case we would not optimize dead code anymore.
Comment 3 Olivier Thomann CLA 2006-08-14 14:16:46 EDT
Created attachment 47851 [details]
Proposed patch
Comment 4 Olivier Thomann CLA 2006-08-14 14:21:24 EDT
Added org.eclipse.jdt.core.tests.compiler.regression.ForStatementTest#test001
Comment 5 Philipe Mulet CLA 2006-09-11 03:29:29 EDT
+1 for 3.2.2
Comment 6 Philipe Mulet CLA 2006-09-11 03:31:05 EDT
Previous comment hit the wrong bug
Comment 7 Olivier Thomann CLA 2006-09-12 13:38:50 EDT
Fixed and released in HEAD.
Released for 3.3M2.
Need to be backported to 3.2.2 once 3.2.1 is shipped.
I leave the bug open to fix it for 3.2.2.
Comment 8 Olivier Thomann CLA 2006-09-12 13:41:52 EDT
Clear the milestone tag till 3.2.2 is added.
Comment 9 Olivier Thomann CLA 2006-09-15 11:51:19 EDT
Should be released in 3.2.2 only if bug 114894 is released.
Comment 10 Olivier Thomann CLA 2006-10-16 12:36:28 EDT
Released for 3.3M3 even if it was released earlier.
This is for verification purpose.
Comment 11 Frederic Fusier CLA 2006-10-29 07:21:12 EST
(In reply to comment #10)
> Released for 3.3M3 even if it was released earlier.
> This is for verification purpose.
> 
Verify it with 3.3 M2 build is enough instead of adding this comment which is not really accurate (no change has been released for 3.3 M3) and so may be confusing...

Verified for 3.3 M2 using build I20060922-0010.