Skip to content
New issue

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

Assertion failed: (!isCommon()), function getOffset, file include/llvm/MC/MCSymbol.h, line 69. #23995

Closed
DimitryAndric opened this issue May 21, 2015 · 2 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@DimitryAndric
Copy link
Collaborator

Bugzilla Link 23621
Resolution FIXED
Resolved on Jun 06, 2015 15:30
Version trunk
OS All
CC @emaste

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

@DimitryAndric
Copy link
Collaborator Author

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 2
0
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

@llvmbot
Copy link
Member

llvmbot commented Jun 6, 2015

Fixed in 239227

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants