llvm-gcc 4.2 generates warnings when I compile inline assembly code that contains used labels with -Wunused-label. The generated code seems to work yet. gcc 4.2 doesn't generate those warnings. I haven't found any bugs regarding this issue in the llvm bug database.
Does anyone know if this is a known llvm issue? Is it a warning that I can ignore and does not affect the generated code? Is there a workaround to avoid these warnings (without turning off -Wunused-label)?
Here is a small sample code that exhibits the issue:
Compile with llvm-gcc 4.2 on MacOSX 10.6:
llvm-gcc-4.2 -arch i386 -Wunused-label -fasm-blocks -o inlineassembly_llvm inlineassembly.c
inlineassembly.c: In function ‘main’:
inlineassembly.c:7: warning: label ‘LASM$MyLabel’ defined but not used
Compile with gcc 4.2 on MacOSX 10.6:
gcc -arch i386 -Wunused-label -fasm-blocks -o inlineassembly inlineassembly.c