Assembler errors with g++-2.8.1 & egcs (bug in binutils-2.8.1.0.23?)

Bernd Nottelmann nottelm@ptp283.uni-muenster.de
Mon Mar 16 09:06:00 GMT 1998


Hi,

now playing with templates I discover new bugs every day,
they become more and more weird from time to time ...
Here is the newest: consider the following program:

/*--------------------------------bug4.C--------------------------------*/
template <int n> class vec {
    double x[n];

    public:
    vec() {
 for (int i=0; i<n-1; ++i) x[i]=0;
    }

    vec(const vec<n>& v) {
 for (int i=0; i<n; ++i) x[i]=v(i);
    }

    vec(const vec<n-1>& v, const double& y) {
 for (int i=0; i<n-1; ++i) x[i]=v(i);
 x[n-1]=y;
    }

    inline double operator()(const int i) const {
 return x[i];
    }
};


template <int n> vec<n>& operator,(const vec<n-1>& v, const double& y) {
    return *(new vec<n>(v, y));
}

int main() {
    vec<4> v;
    vec<5> w;
    w=(v,3.);
}
/*--------------------------------bug4.C--------------------------------*/
The compiler accepts the code, but the assembler refuses to work.
I got the following error message from the (ix86-)assembler:

>g++ bug4.C
/tmp/cca05894.s: Assembler messages:
/tmp/cca05894.s:40: Error: Ignoring junk 'RCd_Rt3vec1iY01' after expression
/tmp/cca05894.s:149: Error: Rest of line ignored. First ignored character is `*'.
/tmp/cca05894.s:150: Error: ignoring unrecognized symbol type ""
/tmp/cca05894.s:150: Error: Rest of line ignored. First ignored character is `*'.
/tmp/cca05894.s:151: Error: invalid character '_' in opcode
/tmp/cca05894.s:216: Error: expected comma after name `__cm__H1i5_RCt3vec1i' in .size directive
/tmp/cca05894.s:216: Error: Rest of line ignored. First ignored character is `*'.

Bernd

PS: >as -V
GNU assembler version 980303 (i586-linux), using BFD version 2.8.1.0.23





More information about the Gcc-bugs mailing list