From: lavog00@DMI.USherb.CA (GUYLAIN LAVOIE)
Subject: GCC internal fatal error, cc1plus got a fatal signal 6???
Organization: Universite de Sherbrooke -- departement de Mathematiques et d'Informatique
Date: Fri, 31 Jul 1992 07:41:00 GMT

Hi all, I or should I say GCC 2.1 has a BIG problem!!!

Gcc is usually working fine but now! ho boy!

the compiler is returning this error!

c:\projet\glgraph>gcc -c linklist.cc
cp-class.c:2371: failed assertion `IDENTIFIER_TEMPLATE (t) != NULL_TREE'
GCC: internal compiler error: program cc1plus got fatal signal 6

with these files

* NOTE: This code is not mine, it's MR. X's (Don't know, sorry MR. X) files


========== CUT HERE linklist.cc ===========

// -------------- linklist.cc

#include <string.h>
#include "linklist.h"

// ------- linked list destructor
LinkedList::~LinkedList(void)
{
	ListEntry *thisentry = FirstEntry;

	while (thisentry != NULL)	{
		delete thisentry->entrydata;
		ListEntry *hold = thisentry;
		thisentry = thisentry->NextEntry;
		delete hold;
	}
}

// --------- add an entry to the list
void LinkedList::addentry(void *newentry, int size)
{
	/* ------- build the new entry ------- */
	ListEntry *thisentry = new ListEntry;
	thisentry->entrydata = new char[size];
	memcpy(thisentry->entrydata, newentry, size);

	if (CurrEntry == NULL)	{
		thisentry->PrevEntry = NULL;
		// ---- adding to the beginning of the list 
		if (FirstEntry != NULL)	{
			/* ---- already entries in this list ---- */
			thisentry->NextEntry = FirstEntry;
			FirstEntry->PrevEntry = thisentry;
		}
		else	{
			// ----- adding to an empty list 
			thisentry->NextEntry = NULL;
			LastEntry = thisentry;
		}
		FirstEntry = thisentry;
	}
	else	{
		// ------- inserting into the list 
		thisentry->NextEntry = CurrEntry->NextEntry;
		thisentry->PrevEntry = CurrEntry;
		if (CurrEntry == LastEntry)
			// ---- adding to the end of the list 
			LastEntry = thisentry;
		else
			// ---- inserting between existing entries 
			CurrEntry->NextEntry->PrevEntry = thisentry;
		CurrEntry->NextEntry = thisentry;
	}
	CurrEntry = thisentry;
}

// ---------- delete the current entry from the list
void LinkedList::delete_entry(void)
{
	if (CurrEntry != NULL)	{
		if (CurrEntry->NextEntry != NULL)
			CurrEntry->NextEntry->PrevEntry = CurrEntry->PrevEntry;
		else
			LastEntry = CurrEntry->PrevEntry;
		if (CurrEntry->PrevEntry != NULL)
			CurrEntry->PrevEntry->NextEntry = CurrEntry->NextEntry;
		else
			FirstEntry = CurrEntry->NextEntry;
		delete CurrEntry->entrydata;
		ListEntry *hold = CurrEntry->NextEntry;
		delete CurrEntry;
		CurrEntry = hold;
	}
}

// ---- get the first entry in the list
void *LinkedList::getfirst(void)
{
	CurrEntry = FirstEntry;
	return CurrEntry == NULL ? NULL : CurrEntry->entrydata;
}

// ---- get the next entry in the list
void *LinkedList::getnext(void)
{
	if (CurrEntry == NULL)
		CurrEntry = FirstEntry;
	else
		CurrEntry = CurrEntry->NextEntry;
	return CurrEntry == NULL ? NULL : CurrEntry->entrydata;
}

// ---- get the previous entry in the list
void *LinkedList::getprev(void)
{
	if (CurrEntry == NULL)
		CurrEntry = LastEntry;
	else
		CurrEntry = CurrEntry->PrevEntry;
	return CurrEntry == NULL ? NULL : CurrEntry->entrydata;
}

// ---- get the last entry in the list
void *LinkedList::getlast(void)
{
	CurrEntry = LastEntry;
	return CurrEntry == NULL ? NULL : CurrEntry->entrydata;
}
#ifndef LINKLIST
#define LINKLIST

============ END linklist.cc ==============

============ CUT HERE linklist.h ==============

#include <stdio.h>

class LinkedList {
	typedef struct list_entry	{
		struct list_entry *NextEntry;
		struct list_entry *PrevEntry;
		void *entrydata;
	} ListEntry;
	ListEntry *FirstEntry;
	ListEntry *LastEntry;
	ListEntry *CurrEntry;
public:
	// ---- constructor
	LinkedList(void)
		{ FirstEntry = LastEntry = CurrEntry = NULL; }
	// ---- destructor
	~LinkedList(void);
	// ---- add an entry
	void addentry(void *newentry, int size);
	// ---- delete the current entry
	void delete_entry(void);
	// ---- get the first entry in the list
	void *getfirst(void);
	// ---- get the next entry in the list
	void *getnext(void);
	// ---- get the previous entry in the list
	void *getprev(void);
	// ---- get the last entry in the list
	void *getlast(void);
	// ---- get the current entry in the list
	void *getcurr(void)
		{return CurrEntry==NULL ? NULL : CurrEntry->entrydata;}
};

#endif

============= END linklist.h ==============
Thanks...
Guylain Lavoie
LAVOG00@DMI.USherb.CA