Alexandre Colucci
2010-Jul-23 09:20 UTC
[LLVMdev] warnings in inline assembly with used labels and -Wunused-label
Hi, 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: int main() { __asm__ { MyLabel: sub ebx,8 jg MyLabel } return 0; } 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 no warnings Thanks, Alexandre
Chris Lattner
2010-Jul-23 16:59 UTC
[LLVMdev] warnings in inline assembly with used labels and -Wunused-label
On Jul 23, 2010, at 2:20 AM, Alexandre Colucci wrote:> Hi, > > 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)?What version of llvm-gcc 4.2 are you using? I think that Dale just fixed this issue, so you might try SVN head to see if it is gone now. -Chris> > > Here is a small sample code that exhibits the issue: > > int main() > { > __asm__ > { > MyLabel: > sub ebx,8 > jg MyLabel > } > > return 0; > } > > > 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 > no warnings > > > Thanks, > Alexandre > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Dale Johannesen
2010-Jul-23 17:35 UTC
[LLVMdev] warnings in inline assembly with used labels and -Wunused-label
This is fixed in TOT (rev 107051 for C, 108732 for C++) On Jul 23, 2010, at 2:20 AMPDT, Alexandre Colucci wrote:> Hi, > > 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: > > int main() > { > __asm__ > { > MyLabel: > sub ebx,8 > jg MyLabel > } > > return 0; > } > > > 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 > no warnings > > > Thanks, > Alexandre > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Alexandre Colucci
2010-Jul-23 18:36 UTC
[LLVMdev] warnings in inline assembly with used labels and -Wunused-label
Thanks a lot. I should have tried ToT. Alexandre> This is fixed in TOT (rev 107051 for C, 108732 for C++) > > On Jul 23, 2010, at 2:20 AMPDT, Alexandre Colucci wrote: > >> Hi, >> >> 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: >> >> int main() >> { >> __asm__ >> { >> MyLabel: >> sub ebx,8 >> jg MyLabel >> } >> >> return 0; >> } >> >> >> 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 >> no warnings >> >> >> Thanks, >> Alexandre >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Maybe Matching Threads
- [LLVMdev] warnings in inline assembly with used labels and -Wunused-label
- Unique rows in data frame (with condition)
- global append changes since version 5
- [LLVMdev] Any objections to turning on -Wunused-parameter? (and any other -Wunused-* that are off?)
- hackish error handling