Reduced test case to gcc is here,
void coq_interprete()
{
register int accu asm("r7");
accu = 0;
}
# gcc-4.5 -S /home/yao/test.c
/home/yao/test.c: In function 'coq_interprete':
/home/yao/test.c:6: error: r7 cannot be used in asm here
No error if compiled with -fomit-frame-pointer
# gcc-4.5 -fomit-frame-pointer -S /home/yao/test.c
In thumb mode, r7 is used as frame pointer register. AFAIK, it is correct to report an error like this. Fix to this problem can be either using another register for variable accu on thumb mode or add -fomit-frame-pointer in gcc commandline.
Reduced test case to gcc is here,
void coq_interprete()
{
register int accu asm("r7");
accu = 0;
}
# gcc-4.5 -S /home/yao/test.c
/home/yao/test.c: In function 'coq_interprete':
/home/yao/test.c:6: error: r7 cannot be used in asm here
No error if compiled with -fomit- frame-pointer frame-pointer -S /home/yao/test.c
# gcc-4.5 -fomit-
In thumb mode, r7 is used as frame pointer register. AFAIK, it is correct to report an error like this. Fix to this problem can be either using another register for variable accu on thumb mode or add -fomit- frame-pointer in gcc commandline.