------- Comment #5 from ubizjak at gmail dot com 2010-04-08 17:45 ------- The problem is, that when "rewritten" gets inlined (in -O2+ case), you can't expect argument to be passed into the inlined section of the function via locations, specifed by ABI. So, you have:
$main..ng: lda $30,-48($30) #,, stq $26,16($30) #, stq $9,24($30) #, .prologue 1 stq $31,32($30) # array, stq $31,40($30) # array, .set macro # 35 "test.c" 1 ldq $1,0($16) # b0 # b0 clr $3 # ofs # ofs ldq $2,8($16) # b1 # b1 cmoveq $1,64,$3 # ofs = (b0 ? ofs : 64); # b0, ofs cmoveq $1,$2,$1 # output = (b0 ? b0 : b1); # b0, b1 cttz $1,$4 # temp = cttz(temp); # b0, temp addq $4,$3,$9 # ret = temp + ofs # temp, ofs, result_1 which is clearly wrong, due to wrong ASM. So, invalid. -- ubizjak at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43691