送交者: AQuestion 于 2005-6-30, 18:58:28:
The following code will not run correctly if
compiled with gcc -O2. It is ok without any optimization
or -O3. What is wrong. My inline asm knowledge
is very limited (from google), maybe there is something 
wrong there?
#include
void test(int num)
{
        int i;
        __asm__ __volatile__(
                        "1:"
                        "dec %%ecx \n\t"
                        "jnz 1b \n\t"
                        :
                        : "c" (num>>4)
                        : "memory"
                        );
        for(i=(num>>4)<<4; i main() 
	
}
{
        test(35);
}
 
所有跟贴: