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]

Re: Bad assembly output from g++, 2.95.2


> 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

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