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]

Re: internal compiler error


Georg Baum <Georg.Baum@post.rwth-aachen.de> said:
> compiling the attached file gives me an internal compiler error, if I
> compile with g++ -c -O2 test.cpp. with -O or without optimizing it
> compiles well.
> 
> My system is Linux 2.0.34 with libc-5.4.44, running on a PII 233 / 64 MB
> RAM.
> config.guess: i686-pc-linux-gnulibc1

[snip]

> class QArray 
> {
> public:
>   QArray();
>   ~QArray(){}
>   char       *at( unsigned index ) const;
>   unsigned  size()    const	{ return 1/sizeof(double); }
>   double& operator[]( int i ) const
>     { return (double &)(*(double *)QArray::at(i*sizeof(double))); }
> };
> 
> 
> 
> double	afxfn(double x,QArray points,int sym)
> {
> 	unsigned	t;
> 	double	xa,ya,xb,yb;
> 	double	xd,yd;
> 	double	y,d,xx,xs;
> 
> 	sym = !sym;
> 	xx = 1.0;
> 	xs = 1.0;
> 
> 	xa = points[0];
> 	ya = points[1];
> 
> 	for(t = 1;t < (points.size() / 2) - 1;t++)
> 	{
> 		xd = points[t * 2];
> 		yd = points[t * 2 + 1];
> 		xb = xd;
> 		yb = yd;
> 
> 
> 		xa = xb;
> 		ya = yb;
> 	}
> 	xb = points[points.size() - 2];
> 	yb = points[points.size() - 1];
> 
> 	if(sym)
> 	{
> 		d = (yb - ya) / (xb - xa);
> 		y = ya + d * (xs - xa);
> 
> 		return y * 2.0 - 1.0;
> 	}
> 
> 	d = (yb - ya) / (xb - xa);
> 	y = ya + d * (xx - xa);
> 
> 	return y;
> }

For i586, linux-2.1.108, glibc-2.0.94, binutils-2.9.1.0.7 with
egcs-19980628 I have:

[root@sleipnir /tmp]# c++ -O2 -c tst.cc
../../egcs-19980628/gcc/reg-stack.c:2885: Internal compiler error in
function change_stack


-O3 gives the same, -O is silent.
-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile                               +56 32 672616







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