Path: utzoo!yunexus!telly!attcan!uunet!tut.cis.ohio-state.edu!SFI.SANTAFE.EDU!scp From: scp@SFI.SANTAFE.EDU ("Stephen C. Pope") Newsgroups: gnu.g++.bug Subject: g++-1.34.2 generating bogus sparc assembler code Message-ID: <8904051749.AA16941@laotse.santafe.edu> Date: 5 Apr 89 17:49:12 GMT Article-I.D.: laotse.8904051749.AA16941 Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 52 While trying to compile Lea's Matrix.4apr code, I ran into the following problem. I'm using g++-1.34.2, the Tuesday afternoon distribution, along with a random patch or two appearing after that distribution. All on a Sun4 SunOS4.0.1, and using the native assembler. laotse% g++ -v -g -O -fchar-charconst -I. -fstrength-reduce -c TriDiagMat.cc g++ version 1.34.2 /usr/local/lib/gcc-cpp -+ -v -I. -undef -D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix -D__sparc__ -D__su n__ -D__unix__ -D__OPTIMIZE__ TriDiagMat.cc /tmp/cca16931.cpp GNU CPP version 1.34 /usr/local/lib/gcc-c++ /tmp/cca16931.cpp -quiet -dumpbase TriDiagMat.cc -fchar-charconst -fstrength- reduce -opt -version -G -o /tmp/cca16931.s GNU C++ version 1.34.2 (sparc) compiled by GNU C version 1.34. as /tmp/cca16931.s -o TriDiagMat.o as: "/tmp/cca16931.s", line 2169: error: statement syntax as: "/tmp/cca16931.s", line 2425: error: statement syntax as: "/tmp/cca16931.s", line 2862: error: statement syntax as: "/tmp/cca16931.s", line 3312: error: statement syntax as: "/tmp/cca16931.s", line 3762: error: statement syntax as: "/tmp/cca16931.s", line 4212: error: statement syntax as: "/tmp/cca16931.s", line 4662: error: statement syntax as: "/tmp/cca16931.s", line 5112: error: statement syntax as: "/tmp/cca16931.s", line 5483: error: statement syntax as: "/tmp/cca16931.s", line 5651: error: statement syntax as: "/tmp/cca16931.s", line 5881: error: statement syntax as: "/tmp/cca16931.s", line 6376: error: statement syntax as: "/tmp/cca16931.s", line 7109: error: statement syntax (Investigating *only* the first error above!!!) After looking at the .s output, I see that intructions of the form mov [%l1], %o2 are being generated. The source line generating this is in TriDiagMat.h: inline double& TriDiagMat::ref(int i, int j) { return data[r * (j - i + 1) + j]; // this is the culprit here! } which is quite kosher. All the other errors are due to the generation of similar mov [%l?],%o? instructions. Stephen Pope The Santa Fe Institute scp@sfi.santafe.edu