Hi,
I just updated from r190763 to r191137 and started getting failures in
generated assembly language when debug info is enabled. Here is the test
case:
// Compile and run for every target.
// RUN: %ecc -g -o %t %s && %t
// FAIL: %armecc -g -o %t %s && %armrun %t
// FAIL: %armebecc -g -o %t %s && %armebrun %t
// RUN: %i386ecc -g -o %t %s && %i386run %t
// FAIL: %microblazeecc -g -o %t %s && %microblazerun %t
// FAIL: %mipsecc -g -o %t %s && %mipsrun %t
// FAIL: %mipselecc -g -o %t %s && %mipselrun %t
// FAIL: %ppcecc -g -o %t %s && %ppcrun %t
// FAIL: %ppc64ecc -g -o %t %s && %ppc64run %t
// RUN: %x86_64ecc -g -o %t %s && %x86_64run %t
int comm;
int main()
{
comm = 6;
}
This fails on all but the x86 processors. The typical failure looks like
this:
...
.type comm, at object # @comm
.comm comm,4,4
.cfi_sections .debug_frame
.bss
.L.bss_end:
...
.L.debug_abbrev_end:
.section .debug_aranges,"", at progbits
.long 36 # Length of ARange Set
.short 2 # DWARF Arange version number
.long .L.debug_info_begin0 # Offset Into Debug Info Section
.byte 4 # Address Size (in bytes)
.byte 0 # Segment Size (in bytes)
.byte 255
.byte 255
.byte 255
.byte 255
.long comm
.Lset0 = .L.bss_end-comm
.long .Lset0
The typical error message is:
/tmp/debug-8ecf9d.s: Assembler messages:
/tmp/debug-8ecf9d.s: Error: invalid operands (.bss and *COM* sections)
for `-' when setting `.Lset0'
Is it legal to mix .comm symbols and .bss symbols in assembly? Is the
x86 success a bug or a feature?
-Rich
Interesting. File please? Thanks. On Sep 21, 2013 6:01 AM, "Richard Pennington" <rich at pennware.com> wrote:> Hi, > > I just updated from r190763 to r191137 and started getting failures in > generated assembly language when debug info is enabled. Here is the test > case: > > // Compile and run for every target. > // RUN: %ecc -g -o %t %s && %t > // FAIL: %armecc -g -o %t %s && %armrun %t > // FAIL: %armebecc -g -o %t %s && %armebrun %t > // RUN: %i386ecc -g -o %t %s && %i386run %t > // FAIL: %microblazeecc -g -o %t %s && %microblazerun %t > // FAIL: %mipsecc -g -o %t %s && %mipsrun %t > // FAIL: %mipselecc -g -o %t %s && %mipselrun %t > // FAIL: %ppcecc -g -o %t %s && %ppcrun %t > // FAIL: %ppc64ecc -g -o %t %s && %ppc64run %t > // RUN: %x86_64ecc -g -o %t %s && %x86_64run %t > > int comm; > int main() > { > comm = 6; > } > > This fails on all but the x86 processors. The typical failure looks like > this: > ... > .type comm, at object # @comm > .comm comm,4,4 > .cfi_sections .debug_frame > .bss > .L.bss_end: > ... > .L.debug_abbrev_end: > .section .debug_aranges,"", at progbits > .long 36 # Length of ARange Set > .short 2 # DWARF Arange version number > .long .L.debug_info_begin0 # Offset Into Debug Info Section > .byte 4 # Address Size (in bytes) > .byte 0 # Segment Size (in bytes) > .byte 255 > .byte 255 > .byte 255 > .byte 255 > .long comm > .Lset0 = .L.bss_end-comm > .long .Lset0 > > The typical error message is: > /tmp/debug-8ecf9d.s: Assembler messages: > /tmp/debug-8ecf9d.s: Error: invalid operands (.bss and *COM* sections) for > `-' when setting `.Lset0' > > Is it legal to mix .comm symbols and .bss symbols in assembly? Is the x86 > success a bug or a feature? > > -Rich > ______________________________**_________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130921/5019a597/attachment.html>
If it thinks the symbol is in the BSS section, then it should never have tried to use .comm to emit it I think. On x86 it does not try to mix and match, which is why it works. AFAIK comm symbols are regarded as having no section, rather than being bss, so I think it's a bug in whatever code printed that .comm statement. I'll look into this tomorrow.> Eric Christopher <mailto:echristo at gmail.com> > Saturday, September 21, 2013 11:26 AM > > Interesting. File please? Thanks. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > Richard Pennington <mailto:rich at pennware.com> > Saturday, September 21, 2013 5:52 AM > Hi, > > I just updated from r190763 to r191137 and started getting failures in > generated assembly language when debug info is enabled. Here is the > test case: > > // Compile and run for every target. > // RUN: %ecc -g -o %t %s && %t > // FAIL: %armecc -g -o %t %s && %armrun %t > // FAIL: %armebecc -g -o %t %s && %armebrun %t > // RUN: %i386ecc -g -o %t %s && %i386run %t > // FAIL: %microblazeecc -g -o %t %s && %microblazerun %t > // FAIL: %mipsecc -g -o %t %s && %mipsrun %t > // FAIL: %mipselecc -g -o %t %s && %mipselrun %t > // FAIL: %ppcecc -g -o %t %s && %ppcrun %t > // FAIL: %ppc64ecc -g -o %t %s && %ppc64run %t > // RUN: %x86_64ecc -g -o %t %s && %x86_64run %t > > int comm; > int main() > { > comm = 6; > } > > This fails on all but the x86 processors. The typical failure looks > like this: > ... > .type comm, at object # @comm > .comm comm,4,4 > .cfi_sections .debug_frame > .bss > .L.bss_end: > ... > .L.debug_abbrev_end: > .section .debug_aranges,"", at progbits > .long 36 # Length of ARange Set > .short 2 # DWARF Arange version number > .long .L.debug_info_begin0 # Offset Into Debug Info Section > .byte 4 # Address Size (in bytes) > .byte 0 # Segment Size (in bytes) > .byte 255 > .byte 255 > .byte 255 > .byte 255 > .long comm > .Lset0 = .L.bss_end-comm > .long .Lset0 > > The typical error message is: > /tmp/debug-8ecf9d.s: Assembler messages: > /tmp/debug-8ecf9d.s: Error: invalid operands (.bss and *COM* sections) > for `-' when setting `.Lset0' > > Is it legal to mix .comm symbols and .bss symbols in assembly? Is the > x86 success a bug or a feature? > > -Rich > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130921/6207b088/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: compose-unknown-contact.jpg Type: image/jpeg Size: 770 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130921/6207b088/attachment.jpg>