__builtin_constant_p and inline assembly constraints

Andrew Haley aph@gcc.gnu.org
Wed Aug 23 11:26:00 GMT 2006


Simon Kagstrom writes:
 > 
 > #define _syscall1(type,name,atype,a) \
 > type name(atype a) { \
 > 	register unsigned long __v0 asm("$2"); \
 > 	__asm__ volatile (".set  push\n.set  noreorder\n"); \
 >         __emit_parameter(a); \
 > 	__asm__ volatile ( \
 > 	".short 0xffff\t#" #name "\n\t" \
 >         ".short %1\n" \
 > 	: "=&r" (__v0) \
 > 	: "i" (__NR_##name) ); \
 >         __asm__ volatile(".set\tpop\n"); \
 > 	return (type) __v0; \
 > }

I'm still trying to get my head around what the assembler will do when
gcc moves these asms around.

Put the ".set  push\n.set  noreorder\n" stuff *inside* the asms.  Please.  :-)

Andrew.



More information about the Gcc-help mailing list