Segmentation fault compiling java program with gcj 4.1.1 and -fprofile-arcs
Stephen Torri
storri@torri.org
Tue Feb 27 15:19:00 GMT 2007
When I try to compile the following program I get a segmentation fault
from gcj:
storri@base ~/Documents/StephenTorri/comp6210 $ gcj --main=Fibonacci Fibonacci.java -fprofile-arcs
Fibonacci.java:1: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugs.gentoo.org/> for instructions.
I tried to see if there was a back trace in gdb but I apparently did
build in debugging information. There was no stack or debugging symbols
found.
The program I used is below. Do I need to rebuild gcj to have debugging
information?
Stephen
------------------------------
class Fibonacci {
public int calculate ( int n )
{
int output = 0;
if ( n > 1 )
{
output = calculate ( n - 1 ) + calculate ( n - 2 );
}
else
{
output = n;
}
return output;
}
public static void main ( String[] inc )
{
if ( inc.length > 0 )
{
Fibonacci f_ref = new Fibonacci();
int n = Integer.parseInt(inc[0]);
while ( n != -1 )
{
System.out.println( "Calculated fibonacci number: " + f_ref.calculate ( n ) );
n--;
}
}
return;
}
}
More information about the Gcc-help
mailing list