[llvm-bugs] [Bug 33316] New: Assertion `(SymbolContents == SymContentsUnset || SymbolContents == SymContentsOffset) && "Cannot get offset for a common/variable symbol"' failed

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 5 15:07:56 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33316

            Bug ID: 33316
           Summary: Assertion `(SymbolContents == SymContentsUnset ||
                    SymbolContents == SymContentsOffset) && "Cannot get
                    offset for a common/variable symbol"' failed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: eugeni.stepanov at gmail.com
                CC: llvm-bugs at lists.llvm.org

The following only happens with macosx in the target triple.

$ cat x.ll
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.12.0"

@a = private constant i8 42
@b = private alias i8, i8* @a
@c = private alias i8, i8* @b

define i8* @f(i64 %x) {
  %y = getelementptr i8, i8* @c, i64 %x
  ret i8* %y
}

$ bin/llc -filetype=obj -o /dev/null x.ll
llc: /code/llvm/include/llvm/MC/MCSymbol.h:323: uint64_t
llvm::MCSymbol::getOffset() const: Assertion `(SymbolContents ==
SymContentsUnset || SymbolContents == SymContentsOffset) && "Cannot get offset
for a common/variable symbol"' failed.
#0 0x0000000001c1c4e4 PrintStackTraceSignalHandler(void*) (bin/llc+0x1c1c4e4)
#1 0x0000000001c1c806 SignalHandler(int) (bin/llc+0x1c1c806)
#2 0x00007f5ee8730330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x00007f5ee7320c37 gsignal
/build/eglibc-MjiXCM/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007f5ee7324028 abort
/build/eglibc-MjiXCM/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007f5ee7319bf6 __assert_fail_base
/build/eglibc-MjiXCM/eglibc-2.19/assert/assert.c:92:0
#6 0x00007f5ee7319ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#7 0x000000000179c64d getLabelOffset(llvm::MCAsmLayout const&, llvm::MCSymbol
const&, bool, unsigned long&) (bin/llc+0x179c64d)
#8 0x000000000179a47e getSymbolOffsetImpl(llvm::MCAsmLayout const&,
llvm::MCSymbol const&, bool, unsigned long&) (bin/llc+0x179a47e)
#9 0x000000000179a56e llvm::MCAsmLayout::getSymbolOffset(llvm::MCSymbol const&)
const (bin/llc+0x179a56e)
#10 0x00000000017810f7 llvm::MCAssembler::evaluateFixup(llvm::MCAsmLayout
const&, llvm::MCFixup const&, llvm::MCFragment const*, llvm::MCValue&, unsigned
long&) const (bin/llc+0x17810f7)
#11 0x0000000001782b68 llvm::MCAssembler::layout(llvm::MCAsmLayout&)
(bin/llc+0x1782b68)
#12 0x0000000001782e4b llvm::MCAssembler::Finish() (bin/llc+0x1782e4b)
#13 0x000000000179f011 (anonymous namespace)::MCMachOStreamer::FinishImpl()
(bin/llc+0x179f011)
#14 0x00000000012fc6da llvm::AsmPrinter::doFinalization(llvm::Module&)
(bin/llc+0x12fc6da)
#15 0x0000000001706eff llvm::FPPassManager::doFinalization(llvm::Module&)
(bin/llc+0x1706eff)
#16 0x00000000017073bd llvm::legacy::PassManagerImpl::run(llvm::Module&)
(bin/llc+0x17073bd)
#17 0x0000000000693c40 compileModule(char**, llvm::LLVMContext&)
(bin/llc+0x693c40)
#18 0x0000000000690b3b main (bin/llc+0x690b3b)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170605/66c45e62/attachment-0001.html>


More information about the llvm-bugs mailing list