We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This assertion was reported in FreeBSD bug: https://bugs.freebsd.org/200362
The minimized test case is:
void fn1() { asm(".comm FOO, 1"); } void fn2() { fn1(); }
Compile this with any optimization level > 0, and it will assert:
$ ~/obj/237905-trunk-freebsd11-i386-ninja-rel-1/bin/clang -cc1 -emit-obj -O comm-func.c Assertion failed: (!isCommon()), function getOffset, file /share/dim/src/llvm/trunk/include/llvm/MC/MCSymbol.h, line 69. Abort trap
The text was updated successfully, but these errors were encountered:
Hmm, actually the test case is even simpler as plain assembly, just:
.comm FOO,1,1 .comm FOO,1,1
will already result in the assertion:
$ ~/obj/llvm-237905-trunk-freebsd11-i386-ninja-rel-1/bin/clang -cc1as -triple x86_64-unknown-freebsd -filetype obj comm-twice.s Assertion failed: (!isCommon()), function getOffset, file /share/dim/src/llvm/trunk/include/llvm/MC/MCSymbol.h, line 69. Abort trap
While this construct is obviously silly, I don't think clang should assert on it.
Note that GNU as assembles this just fine, of course:
$ as -V comm-twice.s -o comm-twice.o GNU assembler version 2.25 (x86_64-portbld-freebsd11.0) using BFD version (GNU Binutils) 2.25
$ objdump -x comm-twice.o
comm-twice.o: file format elf64-x86-64-freebsd comm-twice.o architecture: i386:x86-64, flags 0x00000010: HAS_SYMS start address 0x0000000000000000
Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000000 0000000000000000 0000000000000000 00000040 20 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .data 00000000 0000000000000000 0000000000000000 00000040 20 CONTENTS, ALLOC, LOAD, DATA 2 .bss 00000000 0000000000000000 0000000000000000 00000040 2**0 ALLOC SYMBOL TABLE: 0000000000000000 l d .text 0000000000000000 .text 0000000000000000 l d .data 0000000000000000 .data 0000000000000000 l d .bss 0000000000000000 .bss 0000000000000001 O COM 0000000000000001 FOO
Sorry, something went wrong.
Fixed in 239227
No branches or pull requests
Extended Description
This assertion was reported in FreeBSD bug: https://bugs.freebsd.org/200362
The minimized test case is:
void fn1() { asm(".comm FOO, 1"); }
void fn2() { fn1(); }
Compile this with any optimization level > 0, and it will assert:
$ ~/obj/237905-trunk-freebsd11-i386-ninja-rel-1/bin/clang -cc1 -emit-obj -O comm-func.c
Assertion failed: (!isCommon()), function getOffset, file /share/dim/src/llvm/trunk/include/llvm/MC/MCSymbol.h, line 69.
Abort trap
The text was updated successfully, but these errors were encountered: