This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug java/15734] New: internal compiler error: Segmentation fault


Dear GCJ guru,

Compiling a small class created with scala 1.1.1.3 
(http://scala.epfl.ch/downloads/Web_Installers/InstData/Linux/NoVM/install.bin)
I get this message:

~$ scalac Factorial.scala 
~$ gcj --CLASSPATH=/usr/local/Scala/lib Factorial.class 

Factorial.scala: In class `Factorial':
Factorial.scala: In method `Factorial.fact_rec(int)':
Factorial.scala:14: internal compiler error: Segmentation fault

The scala source is below. Unfortunately, there is no way to send you the .class
files created by scalac with this web form. You can either reply to me so I can
send you the rest, or install scala from the above URL -- it's simple ;)

Sorry, can't figure out what a host/target/buid triplet is: I've built gcc with
the 3.3.2 gcc installed on Mandrake 10.0 Linux, kernel 2.6.3-4mdk.

gcj -v gives:
Reading specs from /home/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/specs
Reading specs from
/home/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.0/../../../libgcj.spec
rename spec lib to liborig
Configured with: ../configure --enable-language=c,c++,f77,java
Thread model: posix
gcc version 3.4.0


object Factorial with Application {

  def fact_rec(n: Int): Int =
    if (n == 0) 1
    else n * fact_rec(n - 1);

  def fact_tail(n: Int): Int =
    if (n == 0) 1
    else {
      def iter(x: Int, result: Int): Int =
        if (x > n) result
        else iter(x + 1, result * x);
      iter(1, 1)
    };

  def fact_iter(n: Int): Int = {
    var i = n;
    var prod = 1;
    while (i > 0) {
      prod = prod * i;
      i = i - 1
    }
    prod
  }

  Console.println("fact_rec(5) = " + fact_rec(5));
  Console.println("fact_rec(10) = " + fact_rec(10));
  Console.println;

  Console.println("fact_tail(5) = " + fact_tail(5));
  Console.println("fact_tail(10) = " + fact_tail(10));
  Console.println;

  Console.println("fact_iter(5) = " + fact_iter(5));
  Console.println("fact_iter(10) = " + fact_iter(10));
}

-- 
           Summary: internal compiler error: Segmentation fault
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dolfi at zkm dot de
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15734


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]