java/1412: gcj miscompiles some loops with -O2
jeff.sturm@commerceone.com
jeff.sturm@commerceone.com
Wed Dec 20 12:26:00 GMT 2000
>Number: 1412
>Category: java
>Synopsis: gcj miscompiles some loops with -O2
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:19:40 PST 2000
>Closed-Date:
>Last-Modified: Mon Dec 11 15:30:01 PST 2000
>Originator: jeff.sturm@commerceone.com
>Release: 001125
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
The attached test program, derived from java.util.Properties,
dumps core if compiled with -O2.
>How-To-Repeat:
Compile and run TestProperties.java with -O or higher. If you
break on each iteration of the loop in gdb and do a "print $esp"
you'll see the stack pointer creeping. Eventually it
overwrites the return address.
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/381
From: Bryce McKinlay <bryce@albatross.co.nz>
To: jeff.sturm@commerceone.com
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/381: gcj miscompiles some loops with -O2
Date: Tue, 12 Dec 2000 11:23:24 +1300
jeff.sturm@commerceone.com wrote:
>> Synopsis: gcj miscompiles some loops with -O2
>
Yeah. This has always been a problem, even pre-2.95. Its the reason why
we can't turn on -O2 for compiling libgcj. It happens when you use
"continue" in a loop.
See PR 161:
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=161&database=java
regards
[ bryce ]
From: Jeff Sturm <jeff.sturm@appnet.com>
To: Bryce McKinlay <bryce@albatross.co.nz>
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/381: gcj miscompiles some loops with -O2
Date: Mon, 11 Dec 2000 18:26:10 -0500
Bryce McKinlay wrote:
> >> Synopsis: gcj miscompiles some loops with -O2
> Yeah. This has always been a problem, even pre-2.95. Its the reason why
> we can't turn on -O2 for compiling libgcj. It happens when you use
> "continue" in a loop.
I didn't find the existing PR. Thanks.
It seems to me this is pretty important to get good performance out of libgcj.
In the meantime I'll stick to compiling from bytecode, which seems to work fine.
--
Jeff Sturm
jeff.sturm@commerceone.com
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="PropertiesTest.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="PropertiesTest.java"
aW1wb3J0IGphdmEuaW8uKjsKCnB1YmxpYyBjbGFzcyBQcm9wZXJ0aWVzVGVzdCB7CiAgICBwdWJs
aWMgdm9pZCBsb2FkKFN0cmluZ1JlYWRlciBpbikgdGhyb3dzIElPRXhjZXB0aW9uIHsKICAgICAg
ICBCdWZmZXJlZFJlYWRlciByZWFkZXIgPSBuZXcgQnVmZmVyZWRSZWFkZXIoaW4pOwogICAgICAg
IHdoaWxlICh0cnVlKSB7CgkJCVN0cmluZyBsaW5lID0gcmVhZGVyLnJlYWRMaW5lKCk7CgkJCWlm
IChsaW5lID09IG51bGwpCgkJCQlicmVhazsKICAgICAgICAgICAgaWYgKGxpbmUubGVuZ3RoKCkg
PT0gMCB8fCBsaW5lLnN0YXJ0c1dpdGgoIiMiKSkKICAgICAgICAgICAgCWNvbnRpbnVlOwoJCQlp
bnQgcG9zID0gbGluZS5pbmRleE9mKCc9Jyk7CgkJCVN0cmluZyBrZXkgPSAocG9zID49IDAgPyBs
aW5lLnN1YnN0cmluZygwLCBwb3MpIDogIiIpOwoJCQlTdHJpbmcgZWxlbWVudCA9IGxpbmUuc3Vi
c3RyaW5nKCsrcG9zKTsKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGtleSArICIsIiAr
IGVsZW1lbnQpOwogICAgICAgIH0KICAgIH0KCglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJp
bmdbXSBhcmdzKSB7CgkJdHJ5IHsKCQkJUHJvcGVydGllc1Rlc3QgcHJvcHMgPSBuZXcgUHJvcGVy
dGllc1Rlc3QoKTsKCQkJcHJvcHMubG9hZChuZXcgU3RyaW5nUmVhZGVyKCIjIHRlc3QgcHJvcGVy
dGllc1xuIiArCgkJCQkiZm9vPWJhclxuIiArCgkJCQkiYmFyPWJhelxuIikpOwoJCX0gY2F0Y2gg
KFRocm93YWJsZSB0KSB7CgkJCXQucHJpbnRTdGFja1RyYWNlKCk7CgkJfQoJfQp9Cg==
More information about the Gcc-prs
mailing list