Summary: | [compiler] VerifyError: Expecting to find integer on stack | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Art Dyer <art.dyer> | ||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||
Status: | VERIFIED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | ||||||
Version: | 3.1 | ||||||
Target Milestone: | 3.1.2 | ||||||
Hardware: | PC | ||||||
OS: | Windows 2000 | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Art Dyer
2005-11-18 13:40:37 EST
FWIW, Jikes elides the floating-point compare entirely since it has no bearing on the value of the expression, which is always true: 0: ldc2_w #11; //long -26l 3: lstore_1 4: getstatic #18; //Field java/lang/System.out:Ljava/io/PrintStream; 7: getstatic #20; //Field f0:F 10: fconst_1 11: fadd 12: putstatic #20; //Field f0:F 15: iconst_1 16: invokevirtual #26; //Method java/io/PrintStream.println:(Z)V 19: return Javac does this (correct, but amusing): ... 18: fcmpg 19: iflt 22 // if less, goto 22, else goto 22 anyway 22: iconst_1 // put 1 on the stack ... 23: ifeq 30 // ... and see if it's equal to zero 26: iconst_1 27: goto 31 30: iconst_0 // this is unreachable 31: invokevirtual #6; //Method java/io/PrintStream.println:(Z)V Added BooleanTest#test018 Indeed, our boolean optimization failed in this case. Tuned implementation and now we produce same as jikes: public static void main(String[] args); 0 ldc2_w <Long -26> [18] 3 lstore_1 [l11] 4 getstatic System.out : PrintStream [20] 7 getstatic X.f0 : float [26] 10 fconst_1 11 fadd 12 putstatic X.f0 : float [26] 15 iconst_1 16 invokevirtual PrintStream.println(boolean) : void [28] 19 return Created attachment 30549 [details]
patch for HEAD
Added BooleanTest#test018-test030 Fixed both in HEAD and 3.1.2 stream. Rewrote boolean codegen to take out the flag OnlyValueRequiredMASK which was causing grief. Verified for 3.2M4 in I20051212-2000 Verified for 3.1.2 in M20060109-0800. |