This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

java/4489: bytecode generation endless loop with certain switch() exprs



>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"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]