Well, nothing is really wrong



所有跟贴·加跟贴·新语丝科技论坛

送交者: wasguru 于 2005-6-30, 23:35:15:

回答: Strange behavior under x86/linux of very short code 由 AQuestion 于 2005-6-30, 18:58:28:

Because you specified that register ecx will hold the input value (num>>4), under -O2 the compiler assumes that ecx still holds that value after the asm statement. Also note that (num>>4) is a common subexpression, so the initial value of i is "optimized" to "ecx >4)<<4" becomes a constant expression, and the compiler will preevaluate it into a constant (32).




所有跟贴:


加跟贴

笔名: 密码(可选项): 注册笔名请按这里

标题:

内容(可选项):

URL(可选项):
URL标题(可选项):
图像(可选项):


所有跟贴·加跟贴·新语丝科技论坛