Assembler statements inside inline funntion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi,

I have a doubt in embedded assembly code supported by GCC.

Assume I have an inline function with some assembler statements embedded
using asm().

inline void fun()
{
   asm("mfmsr  %r3\n\t"
       "loop:\n\t"
       ...
       ...
       "bne loop\n\t"
       ...);
}


If I call the inline function from two functions within same compilation
unit,
the label "loop" is present in both the functions. Since the label has scope
throughtout
the compilation unit, the assembler gives redefinition error for "loop".

Is there any option to supply to compiler so that GCC generates unique label
for "loop"
across funcion? Or is it a limitation in GCC? or is it unusual to write asm
statements
inside inline function?

Please clarify this.

Thanks and regards,
Jeffi

-- 
View this message in context: http://old.nabble.com/Assembler-statements-inside-inline-funntion-tp26789877p26789877.html
Sent from the gcc - Help mailing list archive at Nabble.com.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux