This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
java/10878: miscompilation of boolean parameters from bytecode
- From: szabo dot daniel at dpg dot hu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 May 2003 08:10:22 -0000
- Subject: java/10878: miscompilation of boolean parameters from bytecode
- Reply-to: szabo dot daniel at dpg dot hu
>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: