Invalid code generated from release 1.1.1 and snapshot 19990228
Dirk Düllmann
Dirk.Duellmann@cern.ch
Tue Mar 16 02:06:00 GMT 1999
Martin,
(once again for egcs-bugs)
sorry for being rather unspecific in my last mail:
The problem is that egcs generates a wrong symbol for
the setValue method in the following program:
class point {
public:
void setValues (int , int , float const [][3] ) {}
};
int main()
{
const float pts[][3] = {{-4.5,-2.0, 8.0}, {-2.0, 1.0, 8.0},
{ 2.0, 3.0,-5.0}, { 4.5, -2.0, -6.0}};
point mypoint ;
mypoint.setValues(0,4, pts);
exit(0);
}
The symbols produced are:
dirkd@pcitasd36[~/src/egcs-bugs] nm -C exp.o
00000000 ? .LFB2
0000001b ? .LFE2
00000000 ? __FRAME_BEGIN__
U exit
00000000 t gcc2_compiled.
00000000 T main
00000000 W point::setValues(int, int, float const (*)[2])
So setValue got a signature with an array of two instead
of an array of three elements.
If all sources are compiled using egcs, this symbol seems to
consistently wrong also in references produced for calls.
Therefore in this case the compile and link work and there
seems to be no problem!
If you link against an object file or lib generated with
e.g. g++ 2.7.2 the link fails since g++ generates the
correct symbol.
I think even if this is for now just an version interoperability
problem it should be fixed. Unfortunately this will introduce another
interoperability problem object files produced with 1.1.1 and the
new egcs version with this fix :-(
Thanks for your help, Dirk
"Martin v. Loewis" wrote:
>
> > the following program fails during linking step with:
>
> Dirk,
>
> Thanks for your bug report. I can't reproduce the problem on
> i586-pc-linux-gnu, using either egcs-2.93.11 or egcs-2.91.60.
>
> If you still experience the problem, you'll need to give more details.
>
> Thanks,
> Martin
More information about the Gcc-bugs
mailing list