Atomic builtins always defined -- bug or feature?

Joseph Garvin joseph.h.garvin@gmail.com
Fri Jun 5 18:06:00 GMT 2009


On Fri, Jun 5, 2009 at 11:47 AM, Andrew Haley<aph@redhat.com> wrote:
> It'll call out to a library function if there isn't a builtin instruction.
> If you want to do a configure check, try running or linking the program.

If I compile with -march=i386, and do ./a.out, it runs without errors.
Here's my .cpp file:

int main()
{
	int x;
	__sync_add_and_fetch(&x, 1);

	return 0;
}

Since I have a main, if __sync_add_and_fetch were undefined, wouldn't
it already be trying to link and give an error?



More information about the Gcc-help mailing list