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]

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


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




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