When I compiled it by "gcc -Wall 1.c", I did not get any compilation errors. But surprisingly I got compilation error when I compiled it by "gcc -O3 -Wall 1.c", I got comilation error saying that label .JIT already defined .
It inlined the function, but also kept a separate copy because the function it is defined in isn't static.
How to solve it?
You can use local labels, for example void fun() { asm volatile (" movl $0xFFFFFFFF, %%ecx;" "0: loop 0b\n;" : : :"%ecx"); } Segher