egcs-2.93.22 1990517 on i586

Weidmann, Nicholas nicholas.weidmann@swx.ch
Tue May 25 05:44:00 GMT 1999


egcs-2.93.22 1990517 on i586 did not want to compile this:

template<int i> int foo(int v)
{
	__asm__ __volatile__("addl %1, %0" : "=a" (v) : "b" (i));

	return v;
}

int bar(int i)
{
	return foo<123>(i);
}

When compiling: g++ -c foo.cc

foo.cc: In function `int foo<123>(int)':
foo.cc:12: Instantiated from here
foo.cc:5: `volatile' undeclared (first use this function)
foo.cc:5: (Each undeclared ...
foo.cc:5: for each ....
foo.cc:5: warning: qualifier ignored on asm


When removing __volatile__ it does compile.

Have a nice day.

Nicolas


More information about the Gcc-bugs mailing list