I've got a problem with the toolchain, where I'm doing something like this:
static inline void SetupMatrix (MATRIX mat)
{
asm __volatile__ ("\n\
lqc2 vf4,0x00(%0)\n\
lqc2 vf5,0x10(%0)\n\
lqc2 vf6,0x20(%0)\n\
lqc2 vf7,0x30(%0)\n\
": : "r" (mat));
}
The compiler is throwing up this error:
error: Internal compiler error at expr.c:2672
Where the line it is throwing up on is asm __volatile__ line. It is also complaining about this:
error C2143: syntax error : missing ')' before ':'
Which is referring to the ": : "r" (mat)); line
Any ideas?
Inline assembly
Probably your compiler settings because I copied and pasted it into my code and it compiled perfectly.
I even used it to write my own little asm test,
which again compiled perfectly and worked(I.e it outputted 50) so I don't think your code is at fault.
I even used it to write my own little asm test,
Code: Select all
void AddTest()
{
int num1=5;
int num2=10;
int out=0;
asm __volatile__ ("\n\
mult %0,%1,%2\n\
":"=r"(out):"r"(num1),"r"(num2));
printf("Result:%d \n",out);
}