<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 - [PPC] Assertion failed:`isVariable() && "Invalid accessor!"'"
   href="https://bugs.llvm.org/show_bug.cgi?id=45366">45366</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[PPC] Assertion failed:`isVariable() && "Invalid accessor!"'
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>llc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>v.churavy@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We are observing segmentation faults and corresponding assertion errors on PPC
since upgrading to LLVM 8/9/10 from LLVM 6.

Corresponding downstream issue: <a href="https://github.com/JuliaLang/julia/issues/35025">https://github.com/JuliaLang/julia/issues/35025</a>

The assertion error for LLVM 9 is:

```
julia-debug:
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/include/llvm/MC/MCSymbol.h:303:
const llvm::MCExpr* llvm::MCSymbol::getVariableValue(bool) const: Assertion
`isVariable() && "Invalid accessor!"' failed.

signal (6): Aborted
in expression starting at none:0
gsignal at /lib64/libc.so.6 (unknown line)
abort at /lib64/libc.so.6 (unknown line)
__assert_fail_base at /lib64/libc.so.6 (unknown line)
__assert_fail at /lib64/libc.so.6 (unknown line)
getVariableValue at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/include/llvm/MC/MCSymbol.h:303
finish at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp:199
Finish at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/lib/MC/MCStreamer.cpp:911
doFinalization at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1666
doFinalization at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/lib/Target/PowerPC/PPCAsmPrinter.cpp:1386
doFinalization at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/lib/IR/LegacyPassManager.cpp:1703
runOnModule at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/lib/IR/LegacyPassManager.cpp:1779
run at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/lib/IR/LegacyPassManager.cpp:1863
run at
/home/vchuravy/julia/deps/srccache/llvm-9.0.1/lib/IR/LegacyPassManager.cpp:1894
operator() at /home/vchuravy/julia/src/jitlayers.cpp:1025
jl_dump_native at /home/vchuravy/julia/src/jitlayers.cpp:1064
jl_write_compiler_output at /home/vchuravy/julia/src/precompile.c:93
jl_atexit_hook at /home/vchuravy/julia/src/init.c:227
main at /home/vchuravy/julia/ui/repl.c:218
generic_start_main.isra.0 at /lib64/libc.so.6 (unknown line)
__libc_start_main at /lib64/libc.so.6 (unknown line)
Allocations: 160184348 (Pool: 160149044; Big: 35304); GC: 158
```

I was unsuccessful in reproducing it outside Julia sofar.

A corresponding segmentation fault in LLVM10 looks like:

```
signal (11): Segmentation fault
in expression starting at none:0
_ZN12_GLOBAL__N_120PPCTargetELFStreamer6finishEv at
/buildworker/worker/package_linuxppc64le/build/usr/bin/../lib/libLLVM-10jl.so
(unknown line)
Allocations: 159123504 (Pool: 159085215; Big: 38289); GC: 131
Segmentation fault (core dumped)
make[1]: ***
[/buildworker/worker/package_linuxppc64le/build/usr/lib/julia/sys-o.a] Error 1
```

To reproduce with Julia:

```
git clone <a href="https://github.com/JuliaLang/julia">https://github.com/JuliaLang/julia</a>
git checkout vc/upgrade_llvm_10

cat <<EOT >> Make.user
USE_BINARYBUILDER=0
LLVM_DEBUG=1
LLVM_ASSERTIONS=1
FORCE_ASSERTIONS=1
EOT
```

I will continue to try to reproduce this outside Julia</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>