Article View: gnu.gcc.help
Article #52775program cc1plus got fatal signal 6
From: Michael C. Grant
Date: Wed, 20 May 1992 00:46
Date: Wed, 20 May 1992 00:46
966 lines
22910 bytes
22910 bytes
The code attached below was run through g++-2.1 using the same compiler
options below as well as the -E option. I'm running on a Sun SparcServer.
SunOS Release 4.1.2 (ISL) #3: Mon Feb 17 01:42:17 PST 1992
g++ -DXMATH_INT -I/usr/local/share/lib/xmath/include -g -static -sun4 -c Linear.C
/usr/local/bin/gcc: Internal compiler error: program cc1plus got fatal signal 6
I couldn't determine what configure operands were used to build it.
Michael C. Grant
mcgrant@isl.stanford.edu
# 1 "Linear.C"
# 1 "Linear.H" 1
# 1 "AMI.H" 1
# 1 "ctdPtr.H" 1
class ctdRep {
friend class ctdPtr;
friend class ctdHndlPtr;
friend class ctdHndl;
int refs;
protected:
ctdRep( void );
virtual ~ctdRep( void ) {}
virtual ctdRep* copy( void ) const = 0;
};
class ctdPtr {
friend class ctdHndlPtr;
friend class ctdHndl;
protected:
ctdPtr( ctdRep *r );
ctdRep *rep;
ctdRep* getrep( void ) const;
public:
ctdPtr( void );
ctdPtr( const ctdPtr& s );
ctdPtr &operator=( const ctdPtr& q );
ctdPtr &operator=( int );
ctdRep *operator->( void ) const;
ctdPtr& isolate( void );
int shared( void ) const;
ctdPtr& release( void );
int operator==( int ) const;
int operator==( const ctdRep *q ) const;
int operator==( const ctdPtr &p ) const;
int operator!=( int ) const;
int operator!=( const ctdRep *q ) const;
int operator!=( const ctdPtr &p ) const;
virtual ~ctdPtr( void );
};
class ctdHndlPtr : public ctdRep {
friend class ctdHndl;
ctdPtr ptr;
virtual ctdRep *copy( void ) const;
ctdHndlPtr( void );
ctdHndlPtr( ctdRep *r );
};
class ctdHndl : public ctdPtr {
protected:
ctdRep* getrep( void ) const;
ctdPtr& getptr( void ) const;
public:
ctdHndl( void );
ctdHndl( const ctdHndl& s );
ctdHndl( ctdHndlPtr *p );
ctdHndl( ctdRep *r );
ctdHndl& operator<<( const ctdHndl& q );
ctdRep* operator->( void ) const;
ctdHndl& isolatePtr( void );
ctdHndl& isolateAll( void );
int operator==( int ) const;
int operator==( const ctdHndl &h ) const;
int operator==( const ctdRep *p ) const;
int operator!=( int ) const;
int operator!=( const ctdHndl &h ) const;
int operator!=( const ctdRep *p ) const;
};
# 1 "ctdPtr.I" 1
inline ctdPtr& ctdPtr::release( void ) {
if ( rep && --rep->refs <= 0 ) delete rep;
rep = 0;
return *this;
}
inline ctdPtr::~ctdPtr( void ) { release(); }
inline ctdRep::ctdRep( void ) { refs = 0; }
inline ctdPtr::ctdPtr( void ) { rep = 0; }
inline ctdPtr::ctdPtr( ctdRep *r ) { if ( rep = r ) rep->refs++; }
inline ctdPtr::ctdPtr( const ctdPtr& s ) { if ( rep = s.rep ) rep->refs++; }
inline ctdRep* ctdPtr::getrep( void ) const { return rep; }
inline ctdRep* ctdPtr::operator->( void ) const { return rep; }
inline ctdPtr &ctdPtr::operator=( const ctdPtr &q ) {
if ( rep != q.rep ) {
release();
if ( rep = q.rep ) rep->refs++;
}
return *this;
}
inline ctdPtr &ctdPtr::operator=( int ) { return release(); }
inline int ctdPtr::shared( void ) const {
return rep ? rep->refs > 1 : 1;
}
inline ctdPtr& ctdPtr::isolate( void ) {
if ( rep && rep->refs > 1 ) {
rep->refs--;
rep = rep->copy();
rep->refs = 1;
}
return *this;
}
inline int ctdPtr::operator==( int ) const { return rep == 0; }
inline int ctdPtr::operator!=( int ) const { return rep != 0; }
inline int ctdPtr::operator==( const ctdPtr &p ) const { return rep == p.rep; }
inline int ctdPtr::operator!=( const ctdPtr &p ) const { return rep != p.rep; }
inline int ctdPtr::operator==( const ctdRep *r ) const { return rep == r; }
inline int ctdPtr::operator!=( const ctdRep *r ) const { return rep != r; }
inline ctdHndlPtr::ctdHndlPtr( void ) : ptr() {}
inline ctdHndlPtr::ctdHndlPtr( ctdRep *r ) : ptr( r ) {}
inline ctdRep* ctdHndlPtr::copy( void ) const { return new ctdHndlPtr( ptr.rep ); }
inline ctdHndl::ctdHndl( ctdRep *r ) : ctdPtr( new ctdHndlPtr( r ) ) {}
inline ctdHndl::ctdHndl( ctdHndlPtr *p ) : ctdPtr( p ) {}
inline ctdHndl::ctdHndl( const ctdHndl &q ) : ctdPtr( q ) {}
inline ctdHndl::ctdHndl( void ) : ctdPtr() {}
inline ctdPtr& ctdHndl::getptr( void ) const { return ((ctdHndlPtr*)rep)->ptr; }
inline ctdRep* ctdHndl::getrep( void ) const {
return getptr().rep;
}
inline ctdRep *ctdHndl::operator->( void ) const {
return getrep();
};
inline ctdHndl& ctdHndl::operator<<( const ctdHndl& q ) {
( getptr().rep = q.getptr().rep )->refs++;
return *this;
}
inline ctdHndl& ctdHndl::isolatePtr( void ) {
getptr().isolate();
return *this;
}
inline ctdHndl& ctdHndl::isolateAll( void ) {
isolate();
isolatePtr();
return *this;
}
inline int ctdHndl::operator==( int ) const { return rep == 0; }
inline int ctdHndl::operator!=( int ) const { return rep != 0; }
inline int ctdHndl::operator==( const ctdHndl &p ) const {
return rep == p.rep ? 1 : !rep || !p.rep ? 0 : getptr().rep == p.getptr().rep;
}
inline int ctdHndl::operator==( const ctdRep* p ) const {
return rep ? getptr().rep == p : 0;
}
inline int ctdHndl::operator!=( const ctdRep* p ) const {
return rep ? getptr().rep != p : 1;
}
inline int ctdHndl::operator!=( const ctdHndl &p ) const {
return rep == p.rep ? 0 : !rep || !p.rep ? 1 : getptr().rep != p.getptr().rep;
}
# 99 "ctdPtr.H" 2
# 3 "AMI.H" 2
# 1 "datVec.H" 1
class datRep : public ctdRep {
friend class datVec;
protected:
long size;
double *data;
private:
datRep( long nsize, double *ndata = 0 );
datRep( double *ndata, long nsize = 0 );
virtual ~datRep( void );
public:
long length( void ) const;
protected:
ctdRep *copy( void ) const;
};
class datVec : public ctdPtr {
public:
datRep *operator->( void ) const;
operator double*( void ) const;
double &operator[]( long j ) const;
datVec( void ) {}
datVec( double *ndata );
datVec( long size, double *ndata = 0 );
datVec( double *ndata, long nsize );
};
# 1 "datVec.I" 1
# 1 "linpack.H" 1
extern "C" {
int dcopy_( long &, double *, long &, double *, long & );
int dgemv_( char *, long &, long &, double &, double *,
long &, double *, long &, double &, double *, long & );
int dpptrf_( char *, long &, double *, long & );
double dspgm_( char *, long &, double *, double * );
int dspev_( char *, char *, long &, double *, double *, double *,
long &, double *, long & );
int dspgst_( long &, char *, long &, double *, double *, long & );
double ddot_( long &, double *, long &, double *, long & );
int dscal_( long &, double &, double *, long & );
int drscl_( long &, double &, double *, long & );
int dlazro_( const long &, long &, double &, double &, double *, const long & );
int daxpy_( const long &, const double &, double *,
const long &, double *, const long & );
int dpptrs_( const char *, const long &, const long &,
double *, double *, const long &, long & );
}
# 3 "datVec.I" 2
inline datRep::datRep( long nsize, double *ndata ) {
size = nsize;
if ( size ) {
data = new double [size];
if ( ndata )
dcopy_( size, ndata, 1, data, 1 );
}
}
inline datRep::datRep( double *ndata, long nsize ) {
size = nsize;
data = ndata;
}
inline datRep::~datRep( void ) {
if ( size ) delete [] data;
}
inline long datRep::length( void ) const { return size; }
inline ctdRep* datRep::copy( void ) const { return new datRep( size, data ); }
inline datRep* datVec::operator->( void ) const { return (datRep *)rep; }
inline datVec::operator double*( void ) const { return ((datRep *)rep)->data; }
inline double &datVec::operator[]( long j ) const {
return ((datRep *)rep)->data[j];
}
inline datVec::datVec( long nsize, double *ndata ) :
ctdPtr( new datRep( nsize, ndata ) ) {}
inline datVec::datVec( double *ndata ) :
ctdPtr( new datRep( ndata, 0 ) ) {}
inline datVec::datVec( double *ndata, long nsize ) :
ctdPtr( new datRep( ndata, nsize ) ) {}
# 43 "datVec.H" 2
# 4 "AMI.H" 2
# 1 "/usr/local/share/lib/xmath/include/XmathLNX.h" 1
# 1 "/usr/local/share/lib/xmath/include/externTypes.h" 1
typedef enum {ETMATRIX, ETSTRING} externType;
typedef struct {
externType et;
int rows, columns, isReal;
double *real, *imag;
} et_matrix;
typedef struct {
externType et;
int len;
char *buf;
} et_string;
typedef enum {ERROR_FATAL, ERROR_WARNING} errorType;
extern "C" { et_matrix* AllocateMatrix
(int rows, int columns, int isReal); } ;
extern "C" { et_matrix* WrapMatrix
(int rows, int columns, double* real, double* imag); } ;
extern "C" { void DeleteMatrix (et_matrix* M); } ;
extern "C" { et_string* AllocateString (int len); } ;
extern "C" { et_string* WrapString (char* buffer); } ;
extern "C" { void DeleteString (et_string* s); } ;
# 4 "/usr/local/share/lib/xmath/include/XmathLNX.h" 2
typedef void (*functionPtr)(int lhs, externType** outputs,
int rhs, externType** inputs);
typedef struct {
char* name;
functionPtr fun;
int minIn, maxIn, minOut, maxOut;
char *helpText;
} functionData;
extern "C" { int XmathMain
(int argc, char **argv, functionData* fData, int resident); } ;
extern "C" { void XmathError
(errorType error, char* message, int argNum); } ;
# 7 "AMI.H" 2
class amiFactory {
public:
amiFactory( void ) {}
};
class AMIrep;
class AMIlist;
class AMI;
class AMIhndl : public ctdHndl {
friend class AMI;
public:
AMIhndl( const AMIrep *r );
AMIhndl( void );
AMIhndl( const AMIhndl& q );
AMIhndl& operator=( const AMIhndl& q );
AMIrep *operator->( void ) const;
AMIrep* amirep( void ) const;
AMIlist* list( void ) const;
AMI* ami( void ) const;
};
extern AMIhndl nullAMI;
class AMIrep : public ctdRep {
friend class AMIptr;
public:
int numVars ( void ) const;
int blockSize( void ) const;
virtual int maxBlock ( void ) const = 0;
virtual int numBlocks( void ) const = 0;
virtual int isList( void ) const = 0;
virtual int addAMI( const AMIhndl& newAMI ) = 0;
virtual int removeAMI( int ndx ) = 0;
virtual int convert( void ) = 0;
virtual AMIhndl& getAMI( int ndx ) const = 0;
virtual int setBase ( const datVec& X ) = 0;
virtual int newtonCalc( const datVec& g, const datVec& H ) = 0;
virtual int setLine ( const datVec& v ) = 0;
virtual int setRHS ( const datVec& newRHS );
virtual int checkRHS ( const datVec& B ) const;
virtual void barrUpdate( double &barrier, double &evWgt ) = 0;
virtual void lineGrant ( double alpha, double barrier,
double &gP, double &hP, double &gM, double &hM )=0;
virtual void lineNeNe ( double alpha, double &g, double &H )=0;
int findBarrier( double &barrier, double &evWgt );
virtual int checkRHS( const et_matrix *B ) const;
virtual int setRHS ( const et_matrix *B );
virtual AMIhndl make( int nrhs, const externType **rhs,
int &kr, char type ) = 0;
protected:
long M,N;
AMIrep( int varM = 0, int matN = 0 );
AMIrep( const AMIrep& q );
};
static const int listGrow = 5;
class AMIlist : public AMIrep {
public:
AMIlist( int varM = 0 );
~AMIlist( void );
virtual ctdRep *copy( void ) const;
int convert( void );
int maxBlock ( void ) const;
int numBlocks( void ) const;
int isList( void ) const;
AMIhndl& getAMI( int ndx ) const;
int addAMI ( const AMIhndl& newAMI );
int removeAMI( int ndx );
int setBase ( const datVec& X );
int newtonCalc( const datVec& g, const datVec &H );
int setLine ( const datVec& v );
void barrUpdate( double &barrier, double &evWgt );
void lineGrant ( double alpha, double barrier,
double &gP, double &hP, double &gM, double &hM );
void lineNeNe ( double alpha, double &g, double &H );
AMIhndl make( int nrhs, const externType **rhs, int &kr, char type );
enum { getGroups, getAMIs, getRemoves, getParents };
AMIhndl getAMI( int nrhs, const externType **rhs, int &kr,
int mode, int dk ) const;
int addAMI( int nlhs, externType **lhs, int &kl,
int nrhs, const externType **rhs, int &kr );
int modifyAMI( int nlhs, externType **lhs, int &kl,
int nrhs, const externType **rhs, int &kr );
int removeAMI( int nlhs, externType **lhs, int &kl,
int nrhs, const externType **rhs, int &kr );
int substituteAMI( int nlhs, externType **lhs, int &kl,
int nrhs, const externType **rhs, int &kr );
protected:
AMIlist( const AMIlist& q );
AMIhndl *list;
int blockCount,
listSize,
totBlocks;
};
class AMI : public AMIrep {
AMI( void );
public:
static AMIlist* factory;
static int error;
AMI( amiFactory );
virtual ctdRep *copy( void ) const;
int maxBlock( void ) const;
int numBlocks( void ) const;
int isList( void ) const;
int addAMI( const AMIhndl& newAMI );
int removeAMI( int ndx );
AMIhndl& getAMI( int ndx ) const;
int convert( void );
virtual int setBase ( const datVec& X );
virtual int newtonCalc( const datVec& g, const datVec& H );
virtual int setLine ( const datVec& v );
virtual AMIhndl make( int nrhs, const externType **rhs, int &kr, char type );
void barrUpdate( double &barrier, double &evWgt );
void lineGrant ( double alpha, double barrier,
double &gP, double &hP, double &gM, double &hM );
void lineNeNe ( double alpha, double &g, double &H );
protected:
AMI( int varM, int matN, int evSize = 0 );
AMI( const AMI& q );
datVec ev;
};
# 1 "AMI.I" 1
inline AMIhndl::AMIhndl( const AMIrep *r ) : ctdHndl( (ctdRep*)r ) {}
inline AMIhndl::AMIhndl( void ) : ctdHndl() {}
inline AMIrep* AMIhndl::operator->( void ) const {
return (AMIrep*)ctdHndl::getrep();
}
inline AMIrep* AMIhndl::amirep( void ) const {
return (AMIrep*)ctdHndl::getrep();
}
inline AMIlist* AMIhndl::list( void ) const {
return (AMIlist*)ctdHndl::getrep();
}
inline AMI* AMIhndl::ami( void ) const {
return (AMI*)ctdHndl::getrep();
}
inline AMIhndl::AMIhndl( const AMIhndl& q ) : ctdHndl( q ) {}
inline AMIhndl& AMIhndl::operator=( const AMIhndl& q ) {
ctdHndl::operator=( q );
return *this;
}
inline AMIrep::AMIrep( int varM, int matN ) : M(varM), N(matN) {}
inline AMIrep::AMIrep( const AMIrep& q ) : ctdRep( q ) { M=q.M; N=q.N; }
inline int AMIrep::numVars( void ) const { return M; }
inline int AMIrep::blockSize( void ) const { return N; }
inline AMIlist::AMIlist( int varM ) : AMIrep( varM ) {
list = 0;
totBlocks = listSize = blockCount = 0;
}
inline ctdRep* AMIlist::copy( void ) const {
return new AMIlist( *this );
}
inline AMIlist::~AMIlist( void ) {
for ( register int k = 0 ; k < blockCount ; k++ )
list[k].release();
if (listSize) delete [] list;
}
inline int AMIlist::maxBlock( void ) const { return totBlocks; }
inline int AMIlist::numBlocks( void ) const { return blockCount; }
inline int AMIlist::isList( void ) const { return 1; }
inline AMIhndl& AMIlist::getAMI( int ndx ) const {
return ndx < 0 || ndx >= blockCount ? nullAMI : list[ndx];
}
inline AMI::AMI( int varM, int matN, int evSize )
: ev( evSize ? evSize : matN ) { M = varM; N = matN; }
inline AMI::AMI( const AMI& q ) : AMIrep( q ), ev( q.ev ) {
ev.isolate();
}
inline AMI::AMI( amiFactory ) {
if ( factory == 0 ) factory = new AMIlist( -1 );
factory->addAMI( AMIhndl( this ) );
}
inline ctdRep* AMI::copy( void ) const { return 0; }
inline int AMI::maxBlock( void ) const { return 1; }
inline int AMI::numBlocks( void ) const { return 1; }
inline int AMI::isList( void ) const { return 0; }
inline int AMI::addAMI( const AMIhndl& ) { return -1; }
inline int AMI::removeAMI( int ) { return 1; }
inline AMIhndl& AMI::getAMI( int ) const { return nullAMI; }
inline int AMI::convert( void ) { return 0; }
inline int AMI::setBase( const datVec& ) { return 0; }
inline int AMI::newtonCalc( const datVec&, const datVec& ) { return 0; }
inline int AMI::setLine( const datVec& ) { return 0; }
inline AMIhndl AMI::make( int, const externType**, int&, char ) { return nullAMI; }
inline int AMIrep::checkRHS( const datVec & ) const { return 1; }
inline int AMIrep::setRHS( const datVec & ) { return 1; }
inline int AMIrep::setRHS( const et_matrix * ) { return 1; }
inline int AMIrep::checkRHS( const et_matrix * ) const { return 1; }
# 168 "AMI.H" 2
# 3 "Linear.H" 2
class Linear : public AMI {
public:
enum { dontTranspose, doTranspose };
Linear( amiFactory );
ctdRep* copy( void ) const;
int setBase( const datVec& X );
int newtonCalc( const datVec& g, const datVec& H );
int setLine( const datVec& v );
int setRHS( const datVec& newB );
int checkRHS( const datVec& newB ) const;
protected:
long MN;
datVec A,B,Anrm,Bnrm;
void replace( const datVec& datA, const datVec& datB,
int copyType = dontTranspose );
Linear( const datVec &newA, const datVec &newB,
int varM, int matN, int copyType );
Linear( const Linear& q );
public:
int checkRHS( const et_matrix *B ) const;
int setRHS( const et_matrix *B );
AMIhndl make( int nrhs, const externType** rhs, int& kr, char type );
};
# 1 "Linear.I" 1
inline Linear::Linear( const datVec& datA, const datVec& datB,
int varM, int matN, int copyType )
: AMI( varM, matN ), MN( varM*matN ), Anrm( MN ), Bnrm( matN ) {
replace( datA, datB, copyType );
}
inline Linear::Linear( const Linear& q )
: AMI( q ), MN( q.MN ), Anrm( q.MN ), Bnrm( q.N ) {
replace( q.A, q.B, dontTranspose );
Anrm.isolate(); Bnrm.isolate();
}
inline Linear::Linear( amiFactory f ) : AMI( f ) {}
inline ctdRep* Linear::copy( void ) const {
return new Linear( *this );
}
inline int Linear::checkRHS( const datVec& newB ) const {
return newB->length() != 0 && newB->length() != N;
}
inline int Linear::setRHS( const datVec& newB ) {
if ( checkRHS( newB ) ) return 1;
B = newB;
return 0;
}
inline int Linear::checkRHS( const et_matrix *newB ) const {
return ( newB->rows != N );
}
# 39 "Linear.H" 2
# 1 "Linear.C" 2
# 1 "XmathErr.H" 1
int XmathVarErr( errorType severity, int argNum, char *errStr, ... );
# 4 "Linear.C" 2
static Linear lin( amiFactory() );
void Linear::replace( const datVec& datA, const datVec& datB, int copyType ) {
if ( datB != 0 )
B = datB;
if ( datA != 0 )
if ( copyType == doTranspose ) {
A = datVec( MN );
for ( register long j = 0, k = 0 ; j < MN ; k++, j += N )
dcopy_( N, (double*)datA + k, M, (double*)A + j, 1 );
} else
A = datA;
}
int Linear::setBase( const datVec& X ) {
dcopy_( N, B, 1, Bnrm, 1 );
dgemv_( "No trans", N, M, -1.0, A, N, X, 1, 1.0, Bnrm, 1 );
int notPD = 0;
for ( register int k = 0 ; k < N && !notPD ; notPD |= Bnrm[k++] <= 0 );
return notPD;
}
int Linear::newtonCalc( const datVec& g, const datVec& H ) {
dcopy_( MN, A, 1, Anrm, 1 );
for ( register long i = 0 ; i < N ; i++ )
drscl_( M, Bnrm[i], &Anrm[i], N );
register long curCol = 0;
for ( i = 0 ; i < M ; i++ ) {
register long col2 = 0;
for ( register long j = 0, hndx = i ; j <= i ;
hndx += M - ++j, col2 += N )
H[ hndx ] += ddot_( N, &Anrm[curCol], 1, &Anrm[col2], 1);
for ( j = 0 ; j < N ; j++ )
g[ i ] += Anrm[curCol++];
}
return 0;
}
int Linear::setLine( const datVec &dX ) {
dgemv_( "No trans", N, M, -1.0, Anrm, N, dX, 1, 0.0, ev, 1 );
return 0;
}
AMIhndl Linear::make( int nrhs, const externType **rhs, int &kr, char type ) {
if ( type != 'L' && type != 'l' ) return nullAMI;
if ( nrhs <= kr || *rhs[kr] != ETMATRIX ) {
XmathVarErr( ERROR_FATAL, kr,
"Expected the A matrix in this position" );
return nullAMI;
}
M = ((et_matrix*)rhs[kr])->columns;
N = ((et_matrix*)rhs[kr])->rows;
datVec datA( M*N, ((et_matrix*)rhs[kr++])->real );
if ( nrhs <= kr || *rhs[kr] != ETMATRIX || ((et_matrix*)rhs[kr])->rows != N ) {
XmathVarErr( ERROR_FATAL, kr,
"Expected a %ld-by-1 vector for parameter B.", N );
return nullAMI;
}
datVec datB( N, ((et_matrix*)rhs[kr++])->real );
AMIhndl ans( new Linear( datA, datB, (int)M, (int)N, doTranspose ) );
return ans;
}
int Linear::setRHS( const et_matrix *newB ) {
if ( checkRHS( newB ) )
return 1;
B = datVec( N, newB->real );
return 0;
}
Technical Details
Message-ID:
<9205200046.AA13200@ISL.Stanford.EDU>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!isl.stanford.edu!mcgrantShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,c1024430d8c11a7f,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1992-05-19 13:14:02 PST Newsgroups: gnu.gcc.help Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!isl.stanford.edu!mcgrant From: mcgrant@isl.stanford.edu (Michael C. Grant) Subject: program cc1plus got fatal signal 6 Message-ID: <9205200046.AA13200@ISL.Stanford.EDU> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 20 May 1992 00:46:24 GMT Lines: 971