java/10878: miscompilation of boolean parameters from bytecode

[email protected]
Newsgroups gmane.comp.gcc.prs
Message-ID <[email protected]>
>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:     [email protected]
>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:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.