<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 - Internal clang error while compiling llvm code"
   href="https://bugs.llvm.org/show_bug.cgi?id=46436">46436</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Internal clang error while compiling llvm code
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>9.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tarasber@yandex.ru
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I have this llvm-code in "t.ll" file:

//--------------------------------------------------------
// t.ll:
//--------------------------------------------------------
%type.0 = type i32()
@g.0 = alias %type.0, %type.0* null


!llvm.module.flags = !{!5}
!5 = !{i32 2, !"Debug Info Version", i32 3}
//--------------------------------------------------------
// try to optimize: 
// clang t.ll -o to.ll -O3 -S -emit-llvm
// and I see this:
//--------------------------------------------------------

C:\Users\User\mpl-c\build>clang t.ll -o to.ll -O3 -S -emit-llvm
Aliasee should be either GlobalValue or ConstantExpr
i32 ()* @g.0
fatal error: error in backend: Broken module found, compilation aborted!
Stack dump:
0.      Program arguments: C:\Users\User\mpl\clang.exe -cc1 -triple
x86_64-pc-windows-msvc19.24.28316 -emit-llvm -disable-free
-disable-llvm-verifier -discard-value-names -main-file-name t.ll
-mrelocation-model pic -pi
c-level 2 -mthread-model posix -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -dwarf-column-info -momit-leaf-frame-pointer
-coverage-notes-file C:\Users\User\mpl-c\build\to.gcno -re
source-dir C:\Users\User\lib\clang\9.0.0 -O3 -fdebug-compilation-dir
C:\Users\User\mpl-c\build -ferror-limit 19 -fmessage-length 218
-fno-use-cxa-atexit -fms-extensions -fms-compatibility
-fms-compatibility-version=19.
24.28316 -fdelayed-template-parsing -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-faddrsig -o to.ll -x ir t.ll
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 9.0.0 (tags/RELEASE_900/final)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Users\User\mpl
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang: note: diagnostic msg: Error generating preprocessed source(s) - no
preprocessable inputs.</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>