This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
compiler segfault
- To: gcc-bugs at gcc dot gnu dot org
- Subject: compiler segfault
- From: Olivier <olivier at zipworld dot com dot au>
- Date: Mon, 15 Oct 2001 19:56:36 +1000
Hi,
I originally posted this email to java@gcc.gnu.org, Alexandre
Petit-Bianco seems to believe it is a middle-end bug.
-------------------------------------------------------------------------
GCJ (today's cvs head) segfault when compiling the following code:
public class Speed
{
public static final void main(String[] args) {
try {
int iterations = 1000000;
int blocksize = (int)System.currentTimeMillis();
long elapsed = -System.currentTimeMillis();
float secs = (elapsed > 1) ? (float) elapsed : 1;
float speed = (float) iterations * blocksize;
elapsed += System.currentTimeMillis();
secs = (elapsed > 1) ? (float) elapsed : 1;
speed = (float) blocksize * iterations;
System.out.println(speed);
} catch (Exception x) {
x.printStackTrace(System.err);
}
}
}
tournesol$ gcj --classpath=/usr/local/gcc/share/libgcj.jar -O2 -c -o Speed.o
+Speed.java
Speed.java: In class `Speed':
Speed.java: In method `Speed.main(java.lang.String[])':
Speed.java:1: Internal compiler error in fixup_abnormal_edges, at
+reload1.c:9478Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
Trying to simplify the code any futher fixes the problem!!!
I am using Debian Sid, x86 with gcj compiled as follow:
export CFLAGS="-O2 -funroll-loops"
export GCJFLAGS="-O2 -funroll-loops -fkeep-inline-functions"
~/gcc/configure --prefix=/usr/local/gcc --enable-shared --enable-haifa
+--enable-threads=posix --enable-languages=c++,java --enable-java-gc=boehm
Alexandre Petit-Bianco reply's:
I have an up-to-date compiler and a week-old compiler. It shows up in
both. If changes in reload1.c are responsible for this, the problem
was introduced between 1.298 and now (1.302)
> Trying to simplify the code any futher fixes the problem!!!
So we have a test case then! You can write to bugs@gcc.gnu.org. It's
most likely a middle-end bug.
I'll add this to our test suite, as it would have been better to
detect this bug earlier (some patterns of try/catch have been breaking
reload1 routines in the past.)
Antonio Ake writes:
> I wonder. What happend if you change to -O1 or -00?
The compilation succeeds. It fails for -O2 and above.
--
----------------------------------------------------------------------
Olivier Louchart-Fletcher
Email: olivier@zipworld.com.au