------- Comment #2 from patrick at motec dot com dot au 2008-10-06 23:10
-------
The problem appears to be that the loop
for (; y < pa; y++) {
asm(" mullw 16,%3,%4 \n\t"
" mulhwu 17,%3,%4 \n\t"
" addc 16,16,%0 \n\t"
" addze 17,17 \n\t"
" lwz 18,%1 \n\t"
" addc 16,16,18 \n\t"
" addze %0,17 \n\t"
" stw 16,%1 \n\t"
:"=r"(cy),"=m"(_c[0]):"0"(cy),"r"(mu),"r"(tmpm[0]),"1"(_c[0]):"16", "17",
"18","%cc"); ++tmpm;;
++_c;
}
is being unrolled, resulting in
# 521 "src/mont/fp_montgomery_reduce.c" 1
mullw 16,28,0
mulhwu 17,28,0
addc 16,16,11
addze 17,17
lwz 18,4(29)
addc 16,16,18
addze 11,17
stw 16,4(29)
# 0 "" 2
.L335:
lwzx 5,31,3
# 521 "src/mont/fp_montgomery_reduce.c" 1
mullw 16,28,5
mulhwu 17,28,5
addc 16,16,11
addze 17,17
lwz 18,29,3
addc 16,16,18
addze 11,17
stw 16,29,3
# 0 "" 2
addi 3,3,4
and so on...
where the "lwz 18,29,3" is not understood by the assembler.
I am currently working around this problem by making the variable _c volatile,
which prevents the loop from being unrolled.
--
patrick at motec dot com dot au changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.3.0 4.3.1 4.3.2
Known to work| |4.1.1 4.1.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37758