This is the mail archive of the gcc-help@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]
Other format: [Raw text]

Re: Can a float volatile asm be used as optimization barrier?


Hi,

Something like:

#define add(new)			\
	({int __old;			\
		asm("addl %1,%0\n\t"	\
			:"=g"(__old)	\
			:"g"(new));	\
					\
		__old;			\
	})

int tst(int in)
{
int y;

	y=add(in);

	return y;
}

kevin


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