java/1159
green@gcc.gnu.org
green@gcc.gnu.org
Sat Dec 23 12:16:00 GMT 2000
The following reply was made to PR java/1159; it has been noted by GNATS.
From: green@gcc.gnu.org
To: apbianco@gcc.gnu.org, bryce@albatross.co.nz, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: java/1159
Date: 23 Dec 2000 20:09:32 -0000
Synopsis: Source parser miscompiles loops when using "-O"
State-Changed-From-To: open->analyzed
State-Changed-By: green
State-Changed-When: Sat Dec 23 12:09:32 2000
State-Changed-Why:
You can work around this bug by compiling with -fno-defer-pop.
The defer-pop docs say:
Always pop the arguments to each function call as soon as that function
returns. For machines which must pop arguments after a function call,
the compiler normally lets arguments accumulate on the stack for several
function calls and pops them all at once.
Compare "gcj -O0 -fdefer-pops -S Loop.java" with
"gcj -O0 -fno-defer-pops -S Loop.java".
If you look at the asm code for the method calls within
our loop, you'll see that we're popping the stack twice (once after each function call, and the second time at the end of the loop)!
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=1159&database=gcc
More information about the Gcc-prs
mailing list