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: loop in asm


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



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