variable assigned to register
Hello,
We are using code like this:
__attribute_
inline void svcSendMessage (U32 a, U32 b)
{
register U32 r0 __asm__("r0") = a;
register U32 r1 __asm__("r1") = b;
__asm__ __volatile__ ("svc %0"
: /* output */
: "i" 12345, "r" (r0), "r" (r1) /* input(s) */
: /* list of clobbered registers */);
}
It is "C" wrapper to SVC system call with 2 params in r0 and r1. But there is problem. It works fine with 4.9 2014q3. But not with 4.8 2014q3 (optimalization -O2 is OK, but -O1 and -Oq are sometimes broken).
Because it is SVC wrapper, we can't allow to select register by compiler as usualy for inlined asm.
Where is problem? How to solve this?
PS: I know about possibility to write wrapper in ASM as normal function. But it take longer time ( 2-16 ticks for function call and return depended to branch predictor) I realy want to write inline version for C.
Jiri
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- jdobry
- Solved:
- Last query:
- Last reply: