Bad assembly output from g++, 2.95.2

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun Jul 2 05:29:00 GMT 2000


> The code will look something like this:
> 
> template<bool i>
> class something {
> public:
>     void stuff(int a) {
>        if(i) {
>           a = htonl(a)
>        }
>        ....work with a...
>     }
>     void more_stuff()...
> };
> 
> However, if I declare an  inline int other_htonl(int a) { return htonl(a); }
> outside the template class, and use this other_htonl() everywhere in the
> template class instead of htonl() the compilation succeeds.

Well, *that* sounds familiar. gcc 2.95 has problems with inline
assembly inside templates; I believe those are fixed now.

Regards,
Martin


More information about the Gcc-bugs mailing list