<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 failed: PSI.hasProfileSummary() && "Empty PSI?""
   href="https://bugs.llvm.org/show_bug.cgi?id=49914">49914</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failed: PSI.hasProfileSummary() && "Empty PSI?"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>artyom.polkovnikov@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I wanted to compile binary that will collect PGO data, used next command on my
Win10-64bit:

C:\bin\llvm\bin\clang.exe -m64 -g -O3 -std=c++20 -omain_clang_pgo_gen.exe
-fcs-profile-generate=./clang_pgo_data/ main.cpp

LLVM installation downloaded from
<a href="https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0-rc4/LLVM-12.0.0-rc4-win64.exe">https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0-rc4/LLVM-12.0.0-rc4-win64.exe</a>

main.cpp is tiny:
========
int main() {}
========

CLang compiler command above crashed with log:

===============================

Assertion failed: PSI.hasProfileSummary() && "Empty PSI?", file
C:\src\llvm_package_1200-rc4\llvm-project\llvm\lib\Transforms\Instrumentation\ControlHeightReduction.cpp,
line 448
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.
Stack dump:
0.  Program arguments: C:\\bin\\llvm\\bin\\clang.exe -cc1 -triple
x86_64-pc-windows-msvc19.28.29337 -emit-obj -mincremental-linker-compatible
--mrelax-relocations -disable-free -main-file-name main.cpp -mrelocation-model
pic -pic-level 2 -mframe-pointer=none -fmath-errno -fno-rounding-math
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic
-gno-column-info -gcodeview -debug-info-kind=limited
-fprofile-instrument=csllvm --dependent-lib=clang_rt.profile-x86_64.lib
-fprofile-instrument-path=./clang_pgo_data/default_%m.profraw -resource-dir
C:\\bin\\llvm\\lib\\clang\\12.0.0 -internal-isystem
C:\\bin\\llvm\\lib\\clang\\12.0.0\\include -internal-isystem "C:\\Program Files
(x86)\\Microsoft Visual
Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\include"
-internal-isystem "C:\\Program Files (x86)\\Microsoft Visual
Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\atlmfc\\include"
-internal-isystem "C:\\Program Files (x86)\\Windows
Kits\\10\\Include\\10.0.19041.0\\ucrt" -internal-isystem "C:\\Program Files
(x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared" -internal-isystem
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um"
-internal-isystem "C:\\Program Files (x86)\\Windows
Kits\\10\\include\\10.0.19041.0\\winrt" -O3 -std=c++20 -fdeprecated-macro
-fdebug-compilation-dir C:\\dev\\src\\libs\\kritos\\tools\\crypto_speed_tests
-ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility
-fms-compatibility-version=19.28.29337 -fdelayed-template-parsing
-fno-implicit-modules -fcxx-exceptions -fexceptions -vectorize-loops
-vectorize-slp -faddrsig -o
C:\\Users\\User\\AppData\\Local\\Temp\\main-89082e.o -x c++ main.cpp
1.  <eof> parser at end of file
2.  Per-module optimization passes
3.  Running pass 'CallGraph Pass Manager' on module 'main.cpp'.
4.  Running pass 'Reduce control height in the hot paths' on function '@main'
 #0 0x00007ff68e2a3486 (C:\bin\llvm\bin\clang.exe+0x22d3486)
 #1 0x00007ffd0d871881 (C:\WINDOWS\System32\ucrtbase.dll+0x71881)
 #2 0x00007ffd0d872851 (C:\WINDOWS\System32\ucrtbase.dll+0x72851)
 #3 0x00007ffd0d8741b5 (C:\WINDOWS\System32\ucrtbase.dll+0x741b5)
 #4 0x00007ffd0d8744f1 (C:\WINDOWS\System32\ucrtbase.dll+0x744f1)
 #5 0x00007ff68de6de61 (C:\bin\llvm\bin\clang.exe+0x1e9de61)
 #6 0x00007ff68de71934 (C:\bin\llvm\bin\clang.exe+0x1ea1934)
 #7 0x00007ff68da6ce99 (C:\bin\llvm\bin\clang.exe+0x1a9ce99)
 #8 0x00007ff68d594e2c (C:\bin\llvm\bin\clang.exe+0x15c4e2c)
 #9 0x00007ff68da6d5dd (C:\bin\llvm\bin\clang.exe+0x1a9d5dd)
#10 0x00007ff68e5cea04 (C:\bin\llvm\bin\clang.exe+0x25fea04)
#11 0x00007ff690d0adca (C:\bin\llvm\bin\clang.exe+0x4d3adca)
#12 0x00007ff68fba7ba3 (C:\bin\llvm\bin\clang.exe+0x3bd7ba3)
#13 0x00007ff68ebf4b65 (C:\bin\llvm\bin\clang.exe+0x2c24b65)
#14 0x00007ff68ebb2c93 (C:\bin\llvm\bin\clang.exe+0x2be2c93)
#15 0x00007ff68ec6ac84 (C:\bin\llvm\bin\clang.exe+0x2c9ac84)
#16 0x00007ff68bfd7d5e (C:\bin\llvm\bin\clang.exe+0x7d5e)
#17 0x00007ff68bfd49a4 (C:\bin\llvm\bin\clang.exe+0x49a4)
#18 0x00007ff68bfd46b6 (C:\bin\llvm\bin\clang.exe+0x46b6)
#19 0x00007ff690d35028 (C:\bin\llvm\bin\clang.exe+0x4d65028)
#20 0x00007ffd0f037034 (C:\WINDOWS\System32\KERNEL32.DLL+0x17034)
#21 0x00007ffd10082651 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x52651)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 12.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\bin\llvm\bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: C:\Users\User\AppData\Local\Temp\main-404500.cpp
clang: note: diagnostic msg: C:\Users\User\AppData\Local\Temp\main-404500.sh
clang: note: diagnostic msg: 

********************

===============================

main-404500.cpp:

===============================
# 1 "main.cpp"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 395 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "main.cpp" 2
int main() {}
===============================

main-404500.sh:

===============================
# Crash reproducer for clang version 12.0.0
# Driver args: "-m64" "-g" "-O3" "-std=c++20" "-o" "main_clang_pgo_gen.exe"
"-fcs-profile-generate=./clang_pgo_data/" "main.cpp"
# Original command:  "C:\\bin\\llvm\\bin\\clang.exe" "-cc1" "-triple"
"x86_64-pc-windows-msvc19.28.29337" "-emit-obj"
"-mincremental-linker-compatible" "--mrelax-relocations" "-disable-free"
"-main-file-name" "main.cpp" "-mrelocation-model" "pic" "-pic-level" "2"
"-mframe-pointer=none" "-fmath-errno" "-fno-rounding-math"
"-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-tune-cpu"
"generic" "-gno-column-info" "-gcodeview" "-debug-info-kind=limited"
"-fprofile-instrument=csllvm" "--dependent-lib=clang_rt.profile-x86_64.lib"
"-fprofile-instrument-path=./clang_pgo_data/default_%m.profraw" "-resource-dir"
"C:\\bin\\llvm\\lib\\clang\\12.0.0" "-internal-isystem"
"C:\\bin\\llvm\\lib\\clang\\12.0.0\\include" "-internal-isystem" "C:\\Program
Files (x86)\\Microsoft Visual
Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\include"
"-internal-isystem" "C:\\Program Files (x86)\\Microsoft Visual
Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.29333\\atlmfc\\include"
"-internal-isystem" "C:\\Program Files (x86)\\Windows
Kits\\10\\Include\\10.0.19041.0\\ucrt" "-internal-isystem" "C:\\Program Files
(x86)\\Windows Kits\\10\\include\\10.0.19041.0\\shared" "-internal-isystem"
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\um"
"-internal-isystem" "C:\\Program Files (x86)\\Windows
Kits\\10\\include\\10.0.19041.0\\winrt" "-O3" "-std=c++20" "-fdeprecated-macro"
"-fdebug-compilation-dir"
"C:\\dev\\src\\libs\\kritos\\tools\\crypto_speed_tests" "-ferror-limit" "19"
"-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility"
"-fms-compatibility-version=19.28.29337" "-fdelayed-template-parsing"
"-fno-implicit-modules" "-fcxx-exceptions" "-fexceptions" "-vectorize-loops"
"-vectorize-slp" "-faddrsig" "-o"
"C:\\Users\\User\\AppData\\Local\\Temp\\main-89082e.o" "-x" "c++" "main.cpp"
 "C:\\bin\\llvm\\bin\\clang.exe" "-cc1" "-triple"
"x86_64-pc-windows-msvc19.28.29337" "-emit-obj"
"-mincremental-linker-compatible" "--mrelax-relocations" "-disable-free"
"-main-file-name" "main.cpp" "-mrelocation-model" "pic" "-pic-level" "2"
"-mframe-pointer=none" "-fmath-errno" "-fno-rounding-math"
"-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-tune-cpu"
"generic" "-gno-column-info" "-gcodeview" "-debug-info-kind=limited"
"-fprofile-instrument=csllvm" "--dependent-lib=clang_rt.profile-x86_64.lib"
"-fprofile-instrument-path=./clang_pgo_data/default_%m.profraw" "-O3"
"-std=c++20" "-fdeprecated-macro" "-ferror-limit" "19" "-fno-use-cxa-atexit"
"-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.28.29337"
"-fdelayed-template-parsing" "-fno-implicit-modules" "-fcxx-exceptions"
"-fexceptions" "-vectorize-loops" "-vectorize-slp" "-faddrsig" "-x" "c++"
"main-404500.cpp"
=================================</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>