This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
java/4489: bytecode generation endless loop with certain switch() exprs
- To: gcc-gnats at gcc dot gnu dot org
- Subject: java/4489: bytecode generation endless loop with certain switch() exprs
- From: apbianco at redhat dot com
- Date: 6 Oct 2001 02:55:02 -0000
- Reply-To: apbianco at redhat dot com
>Number: 4489
>Category: java
>Synopsis: bytecode generation endless loop with certain switch() exprs
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 05 19:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Alex Petit-Bianco
>Release: unknown-1.0
>Organization:
>Environment:
all platforms
>Description:
Consider the following test case:
class Switch {
void foo (int keyBits, int blockBits) {
switch (keyBits >= blockBits ? keyBits : blockBits) {
case 0:
break;
case 1:
break;
}
}
}
It sends the bytecode generator into a endless loop.
Somethings appears to go wrong when the blocks are being
re-arranged in gcc/java/jcf-write.c:1814.
>How-To-Repeat:
$ gcj -C Switch.java
>Fix:
Use a temporary variable to compute the expression the
switch is operating on.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="dummy"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="dummy"