bug report (Internal compiler error)

egcs-bugs@cygnus.com egcs-bugs@cygnus.com
Wed Dec 2 20:49:00 GMT 1998


Hello I am a student in saga-u (Japan).
I use egcs C++ compiler on sun-sparc-solaris2.6.(egcs version is egcs-2.91.57)
When I try to compile , the compiler invoked "Internal compiler error".
And compiler said I should do bug-report. ^^;;)

However , same files succeed on sun-sparc-sunOS4.1:g++(gcc-2.7.2.1)
                                sun-sparc-solaris2.6:g++(gcc-2.8.1)
The source file is lnMatrix.cc lnMatrix.h , and makefile

-------------------------------lnMatrix.h----------------------------------------
#include <stdio.h>

class lnInfo{
public:
  friend class lnMatrix;
  double capacity;
  double trafic;
  double load;
  class lnInfo *next;
};

class lnMatrix{
protected:
  int size;
  lnInfo *tail;
  lnInfo *getAddr(int i , int j);
public:
  lnMatrix(int nsize);
  ~lnMatrix(void);
  double getCapacity(int i, int j);
  double getTrafic(int i, int j);
  double getLoad(int i, int j);
  
  void setCapacity(int i, int j,double newCapacity);
  void setTrafic(int i, int j,double newTrafic);
  void setLoad(int i, int j,double newLoad);
};
-------------------------------lnMatrix.cc---------------------------------------
#include "lnMatrix.h"

lnMatrix::lnMatrix(int nsize){
  size = nsize;
  lnInfo *element;
  tail = NULL;

  for(int i=0;i<=size*size;i++){
    element = new lnInfo;
    element->next = tail;
    tail = element;
  }
}

lnMatrix::~lnMatrix(int nsize){
  lnInfo *tmp;
  lnInfo *current;
  
  current = tail;
  while(current != NULL){
    tmp = current;
    delete tmp;
    current = current->next;
  }
}

lnInfo *lnMatrix::getAddr(int i , int j){
  int x = j , y = i;
  int number = (y-1)*size + x -1;
  lnInfo *current = tail;

  for(int i=0;i<number;i++){
    current = current->next;
    if(current == NULL)
      return NULL;
  }
  return current;
}

double lnMatrix::getCapacity(int i , int j){
  lnInfo *target = getAddr(i,j);
  return (target->capacity);
}

double lnMatrix::getTrafic(int i , int j){
  lnInfo *target = getAddr(i,j);
  return (target->trafic);
}

double lnMatrix::getLoad(int i , int j){
  lnInfo *target = getAddr(i,j);
  return (target->load);
}

void lnMatrix::setCapacity(int i, int j,double newCapacity){
  lnInfo *target = getAddr(i,j);
  target->capacity = newCapacity;
}

void lnMatrix::setTrafic(int i, int j,double newTrafic){
  lnInfo *target = getAddr(i,j);
  target->trafic = newTrafic;
}

void lnMatrix::setLoad(int i, int j,double newLoad){
  lnInfo *target = getAddr(i,j);
  target->load = newLoad;
}
-------------------------------makefile----------------------------------------
CC = c++
OBJ = lnMatrix.o
TARGET = 
CFLAGS = -g -Wall

lnMatrix.o: lnMatrix.cc lnMatrix.h
	$(CC) -c lnMatrix.cc $(CFLAGS)
clean: 
	rm -f *~ $(TARGET) $(OBJ)
--------------------------------------------------------------------------------
--------------------------------error message-----------------------------------
mitsuki@suzaku[59] make
c++ -c lnMatrix.cc -g -Wall
lnMatrix.cc: In method `lnMatrix::~lnMatrix()':
lnMatrix.cc:25: Internal compiler error.
lnMatrix.cc:25: Please submit a full bug report to `egcs-bugs@cygnus.com'.
make: *** [lnMatrix.o] Error 1
--------------------------------------------------------------------------------

This program may be wrong! then ignore please.....^^;)
bye!





More information about the Gcc-bugs mailing list