java/10878: miscompilation of boolean parameters from bytecode

szabo.daniel@dpg.hu szabo.daniel@dpg.hu
Tue May 20 09:17:00 GMT 2003


>Number:         10878
>Category:       java
>Synopsis:       miscompilation of boolean parameters from bytecode
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 20 08:16:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     szabo.daniel@dpg.hu
>Release:        3.2.2
>Organization:
>Environment:
mingw, linux
>Description:
Boolean parameter will be misinterpreted when compiled from bytecode rather than from java source.
See in assembly (when compiled without any optimizations):
movb	%al, -1(%ebp)
then referencing the variable:
movl	-8(%ebp), %edx
>How-To-Repeat:
Compile the java source to bytecode, then compile it with gcj to produce assembly listing. Watch for the parameter representation of the boolean variable in the stack.
>Fix:
Compile from java source OR avoid booleans (use ints instead). Note: java bytecode treats booleans as ints already. They shouldn't be treaten like booleans, unless you want packed boolean arrays, which occurs very very rarely.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list