public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1159: Source parser miscompiles loops when using "-O"
@ 2000-12-20 12:20 bryce
  0 siblings, 0 replies; only message in thread
From: bryce @ 2000-12-20 12:20 UTC (permalink / raw)
  To: java-gnats

>Number:         1159
>Category:       java
>Synopsis:       Source parser miscompiles loops when using "-O"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:16:25 PST 2000
>Closed-Date:    
>Last-Modified:  
>Originator:     Bryce McKinlay
>Release:        gcc version 2.96 20000303 (experimental), also 2.95.2
>Organization:
>Environment:
Redhat 6.1
>Description:
The presence of certain combinations of "continue" 
and "break" within loops results in incorrect runtime 
behavior and/or crashes when compiling from source with 
"-O".

>How-To-Repeat:
Compile and run the attached test case. In this example, 
the crashes seem to occur on the 'break' statement after
the loop completes and one or more 'continue's have already
been executed, however this is a simplification of a more
complex loop in some of my code where I'm seeing all kinds
of bizzare behavior - not just on 'break' - but the 
presence of 'continue' definatly seems to be a factor.
>Fix:

>Release-Note:
>Audit-Trail:

Formerly PR gcj/161

>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="Loop.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Loop.java"

aW1wb3J0IGphdmEudXRpbC4qOwoKcHVibGljIGNsYXNzIExvb3AKewogIHN0YXRpYyBWZWN0b3Ig
c3R1ZmYgPSBuZXcgVmVjdG9yKCk7CgogIHB1YmxpYyBzdGF0aWMgdm9pZCBtYWluKFN0cmluZyBh
cmdzW10pCiAgewogICAgc3R1ZmYuYWRkRWxlbWVudCgiYmxvc3NvbSIpOwogICAgc3R1ZmYuYWRk
RWxlbWVudCgiIik7CiAgICBzdHVmZi5hZGRFbGVtZW50KCJidWJibGVzIik7CiAgICBzdHVmZi5h
ZGRFbGVtZW50KCJ6enoiKTsgICAgCiAgICBzdHVmZi5hZGRFbGVtZW50KCJ6enoiKTsgICAgCiAg
ICBzdHVmZi5hZGRFbGVtZW50KCJidXR0ZXJjdXAiKTsKICAKICAgIFN0cmluZyBuZXh0ID0gIiIs
IGxpbmU7ICAgIAogIAogICAgRW51bWVyYXRpb24gZSA9IHN0dWZmLmVsZW1lbnRzKCk7CiAgCiAg
ICB3aGlsZSAodHJ1ZSkKICAgICAgewkgCiAgICAgICAgaWYgKCFlLmhhc01vcmVFbGVtZW50cygp
KQoJICBicmVhazsJCgoJbGluZSA9IChTdHJpbmcpIGUubmV4dEVsZW1lbnQoKTsKCSAgCSAgCglp
ZiAobGluZS5sZW5ndGgoKSA9PSAwKQoJICBjb250aW51ZTsgIAoKCWlmIChsaW5lLmNoYXJBdCgw
KSAhPSAnYicpCgkgIGNvbnRpbnVlOwoJCglTeXN0ZW0ub3V0LnByaW50bG4obGluZSk7CiAgICAg
IH0KICB9CiAgCn0K


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:20 java/1159: Source parser miscompiles loops when using "-O" bryce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).