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


Hi,

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

g++ -v: Reading specs from
/usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.90.29/specs
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)

I use egcs-1.0.3a with libg++-2.8.1-980505. I configured egcs with: 
configure --enable-shared --prefix=/usr/local/egcs
--exec-prefix=/usr/local/egcs
and bootstrapped with gcc-2.7.3 without problems. gcc lives in
/usr/local/gcc. I choose between the two compilers with a little script,
which sets some symlinks in /usr/local/bin, /usr/local/include and
/usr/local/lib. I have no other compiler installed in /usr or something.

Compiling the same file with gcc: no problem. The file is an extract
from the file afx.cpp, found in ksoundsys-0.0.29 (available on
ftp.kde.org/pub/kde/apps/multimedia) and a little bit of code from
qt-1.33 (www.troll.no). I tried to reduce the code, and to not include
any headers

I hope this is enough information to reproduce and remove the bug.

Georg

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;
}



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