This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Asm bug in C++ templates
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Asm bug in C++ templates
- From: Hidvegi <hzoli at austin dot ibm dot com>
- Date: Mon, 15 Nov 1999 18:56:13 -0600 (CST)
The following program produces bad assembly output with
g++ -O3 -S foo.C
---------------------- CUT HERE ----------------------
template <class T>
class tmpl {
public:
static int foo(void);
};
template <class T>
int
tmpl<T>::foo(void)
{
int g;
__asm__ ("bad" "bad" : "=r" (g));
return g;
}
template tmpl<int>;
---------------------- CUT HERE ----------------------
The "badbad" string is missing from the assembly, or it is replaced by
junk. I tested this on rs6k and i386 with:
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
gcc version 2.95.2 19991024 (release) (on i386 RedHat 6.0 and rs6k AIX4.3.2)
gcc version 2.95 19990728 (release) (on rs6k aix 4.3.2)
Note that g++ -O2 works fine.
Zoli