<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Assertion `(SymbolContents == SymContentsUnset || SymbolContents == SymContentsOffset) && "Cannot get offset for a common/variable symbol"' failed"
   href="https://bugs.llvm.org/show_bug.cgi?id=33316">33316</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `(SymbolContents == SymContentsUnset || SymbolContents == SymContentsOffset) && "Cannot get offset for a common/variable symbol"' failed
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>MC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>eugeni.stepanov@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>