<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57870>57870</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang 15 assertion failure during LTO of stress-ng
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          nikic
      </td>
    </tr>
</table>

<pre>
    Building https://github.com/ColinIanKing/stress-ng with clang and `-flto` results in an assertion failure during the LTO step:
```
ld.gold: /home/npopov/repos/llvm-project/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:6597: std::pair<llvm::ValueInfo, long unsigned int> {anonymous}::ModuleSummaryIndexBitcodeReader::getValueInfoFromValueId(unsigned int): Assertion `VGI.first' failed.
```

The problematic input appears to be `stress-cpu.o`, which results in the same assertion when run through `llvm-dis`.

At a guess, this has something to do with ifuncs.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9Uslu2zAQ_RrqQkTQYknWQQfbaQqjLQq0Qe4UOZLYUqTAJa7_vkMpdRKgLUCQM5zlzfJ6I67dMUglpB7p5P3iSHkgxQOeUfop9Ck3Myono6Q-M_0J_VB13oJzdxhzQS_KFUORaUFJnd0Nyht8KboE5R2VGk2UOQfWS6PpwKQKFqgINqL6Cejnx6_UeVgieHZPsgPGv5xVVSIdjRJopog-mRnw0YtZzDMKFhbj8FXqeb5brPkB3L-o8ZE93kfpuREx7BswAfb1a9NTvkT0umqbiOJ8BMOzMGlJeVpzrR9PTAU468GQ4kSVwQaCdnLUILBRT8oPlDRHpo2-ziY40txvYV-MCAq-h3lm9nrWAn69g9-cRvC39A_WzJsiSLF_h1G0scTDbaA4pqeP53SQ1qGxWQcMIv3rJLf7EWeOg-oVzMxLjlmX4ClbFmDWUW9oDzHry5r5EtK40djxZZJ8ervauD7HZniz4MsEmtoQbdaEcYqp1t0I6VBM31ZyQFg6BoSJ2f0kHZ2Yow5XjEqkh6HCbDSTQ9DcpQl0eV2XTV1UVZuIrhRt2bLES6-gO61UzKt_8y1yzQz0RuEkWNX9h_p_aPSeXNI5LBqFqtk3WTJ1UNdCCAa7PmO8rZs947zO23onqnIADoliPSjXkepIikLDha4pUCbVfSK7IiuKrC3yvMixrRRjmkzwssn7nWiqHdlluCup0lhHauyY2G4tqQ-jQ6OSzrtXI3Yf-QIrHOZnwU_Gdlr-lDxZgbu18N_ZzE6k">