c - Impossible constraint in ‘asm’ error and indirect call without "*" warning -
in seoul virtual machine monitor project, encountered inline assembler code
asm volatile ("call %p0; 1:" : : "i"(foo))
which compiles , runs when optimized -o2; fails compile -o0 optimization, yielding error:
error: impossible constraint in ‘asm’
foo 32 bits int taken immediate value call instruction.
when googled, this suggests me replace "i" constraint "ic", did; , code compile :
warning: indirect call without « * »
how can avoid warning?
nb:
- gcc version 4.9.2
- asm %p modifier prevent gcc append $ in front of int value. generate "call foo" instead of "call $foo".
Comments
Post a Comment