This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bad assembly output from g++, 2.95.2
- To: jakob at ostenfeld dot dtu dot dk
- Subject: Re: Bad assembly output from g++, 2.95.2
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sun, 2 Jul 2000 14:29:26 +0200
- CC: gcc-bugs at gcc dot gnu dot org
- References: <20000627223356.A19686@ostenfeld.dtu.dk> <200006280622.IAA00865@loewis.home.cs.tu-berlin.de> <20000630171350.U1603@ostenfeld.dtu.dk>
> 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