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

    <tr>
        <th>Summary</th>
        <td>
            Adding a new function breaks important optimizations
        </td>
    </tr>

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

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

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

<pre>
    https://godbolt.org/z/Wc19njzMo


Here, commenting whole function `fun2` squashes the whole program to just two assembler instructions. WHY ? it's code exactly the same as `fun1`.

Also, leaving only one function, but uncommenting the second `add_row()` inside also breaks optimizations.

Possibly the optimizations depend on some border on program complexity. I don't know. Also, see how GCC works in same conditions — that's interesting. Sometimes it makes significantly better codes, sometimes worse. Possibly I hit UB. 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxck0GP2zYQhX8NdRlEkChZtg46bDZ1k0OBAkUR9FSQ4tjimuK4nNEqu7--oNbZOLnYEMh5873HGcPszxFxULuPavepMItMlAam8YJyNT4VltzLMIlcWTUPSh-VPp7JWQpSUjorfXxV-vh1rPv49PoHqeqTqh7ufz9jQqUfYaR5xig-nmGdKCCcljiKpwiqq05L1KqrgP9bDE_IIBPerl0TnZOZQQieFhaQlcAw42wDJvCRJS2bDpfw9fM_oJojeFF6zzCSQ8BvZpTwsimymREM3zrWqqvKe9SHwJRRA5rnzEkxvADFH6j50C4CS7xzswnjSNFlXePcv4lWpQ9K99mSj-wdgglMYBOaCwNdxc_-1bxR3xP8Scze3mh_ugYOrxgdUASmGcFScpjy5_eARpqvAb95eSnhC7hMuxe4RFpL-O6MEWGiFX5_fISV0oXBx7dUMr9_66R-0-pQqb4Fmcxbkj4KJuTst4S_aEbxMzJ4gdlckCEPkT_50cQctUURTFv8vHV9L1gpMZbwbvMLTF7g748lFG5oXN_0psCh3mvdt83uUBfTcLJtV3fN2NW9O-1PdY_aHprTvrLN7tDVh8IPutJtdai6utadrkrc2UNb7_p9Oza1dXvVVjgbH8oQnuc8tIVnXnCoK13rtgjGYuBtAbSOuMJ2qrTO-5CGXPTBLmdWbRU8C_-QES8Bhwfn8hgYyLXvQ317aj9fKYmJ8vNrFksKvy6Vl2mx5Uiz0sfc4vb34ZroCUdR-riBsdLHG_nzoP8PAAD__2vYQA4">