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]

internal compiler error


../../egcs-19980608/gcc/function.c:3266: Internal compiler error in function instantiate_virtual_regs_1

Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.91.40/specs
gcc version egcs-2.91.40 19980608 (gcc2 ss-980502 experimental)

System:
	intel pentium
	Linux 2.0.34
	libc 5.4.33


----------------------------------------------------------------------------
# 1 "ttt.cpp"
# 1 "fract.h" 1



typedef int int32;
typedef long long int64;

class fract {
	static const int shift=16;
	int32 d; 
public:
	fract() {}
	fract(int i) { d=i<<shift; }
	fract(double o) { d=(int)((1<<shift)*o+0.5); }

	operator bool() const { return d; }
	operator int() const { return d>>shift; }
	operator double() const { return (double)d/(1<<shift); }

	int32 &direct() { return d; }
	int32 fp() const { return d&((1<<shift)-1); }

	fract &operator=(fract f) { d=f.d; }
	fract &operator=(int f) { d=f<<shift; }
	fract &operator=(double f) { d=(int)((1<<shift)*f+0.5); }

	fract operator+(fract f) const { fract t; t.d=d+f.d; return t; }
	fract operator+(int f) const { fract t; t=*this+(fract)f; return t; }
	fract operator+(double f) const { fract t; t=*this+(fract)f; return t; }
	fract operator-(fract f) const { fract t; t.d=d-f.d; return t; }
	fract operator-(int f) const { fract t; t=*this-(fract)f; return t; }
	fract operator-(double f) const { fract t; t=*this-(fract)f; return t; }
	fract operator*(fract) const;
	fract operator*(int32 i) const { fract t; t.d=d*i; return t; }
	fract operator*(double i) const;
	fract operator/(fract f) const;
	fract operator/(int i) const { fract t; t.d=d/i; return t; }
	fract operator/(double i) const;
	fract operator-() const { fract t; t.d=-d; return t; }

	fract &operator+=(fract f) { d+=f.d; return *this; }
	fract &operator-=(fract f) { d-=f.d; return *this; }

	int operator<(fract f)	const { return d<f.d; }
	int operator<=(fract f)	const { return d<=f.d; }
	int operator>(fract f)	const { return d>f.d; }
	int operator>=(fract f)	const { return d>=f.d; }
	int operator!=(fract f)	const { return d!=f.d; }
	int operator==(fract f)	const { return d==f.d; } 

	int operator<(int i)	const { return *this<fract(i); }
	int operator<=(int i)	const { return *this<=fract(i); }
	int operator>(int i)	const { return *this>fract(i); }
	int operator>=(int i)	const { return *this>=fract(i); }
	int operator!=(int i)	const { return *this!=fract(i); }
	int operator==(int i)	const { return *this==fract(i); } 

	int operator<(double i)		const { return *this<fract(i); }
	int operator<=(double i)	const { return *this<=fract(i); }
	int operator>(double i)		const { return *this>fract(i); }
	int operator>=(double i)	const { return *this>=fract(i); }
	int operator!=(double i)	const { return *this!=fract(i); }
	int operator==(double i)	const { return *this==fract(i); } 
};

inline fract fract::operator*(fract f) const
{
	fract t; 
	t.d=((long long)d*f.d)>>shift; 
	return t; 
}

inline fract fract::operator*(double i) const 
{
	fract t; 
	t.d=(int32)(d*i+0.5); 
	return t; 
}

inline fract fract::operator/(fract f) const 
{
	fract t;
	t.d=(((int64)d<<shift)/f.d); 
	return t;
}

inline fract fract::operator/(double i) const 
{ 
	fract t; 
	t.d=(int)(d/i+0.5); 
	return t; 
}

inline int operator*(int i,fract f)
{
	return i*(int)f;
}

inline double operator*(double i,fract f)
{
	return i*(double)f;
}

inline int operator/(int i,fract f)
{
	return i/(int)f;
}

inline double operator/(double d,fract f)
{
	return d/(double)f;
}

inline int operator+(int i,fract f)
{
	return i+(int)f;
}

inline double operator+(double i,fract f)
{
	return i+(double)f;
}

inline int operator-(int i,fract f)
{
	return i-(int)f;
}

inline double operator-(double i,fract f)
{
	return i-(double)f;
}


# 1 "ttt.cpp" 2


test()
{
	fract left[4][3], right[4][3], M[3][3];
	fract t=M[1][0]+M[1][1]+M[1][2];
	right[0][1]=left[0][1]=t<0? t:(fract)0;
	right[1][1]=left[1][1]=t<0? (fract)0:t;
	right[2][1]=left[2][1]=t<0? (fract)0:t;
	right[3][1]=left[3][1]=t<0? (fract)0:t;
}


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