<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:paulsson@linux.vnet.ibm.com" title="Jonas Paulsson <paulsson@linux.vnet.ibm.com>"> <span class="fn">Jonas Paulsson</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Csmith program prints checksum at -O0, but crashes at -O1"
   href="https://bugs.llvm.org/show_bug.cgi?id=34827">bug 34827</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Csmith program prints checksum at -O0, but crashes at -O1"
   href="https://bugs.llvm.org/show_bug.cgi?id=34827#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Csmith program prints checksum at -O0, but crashes at -O1"
   href="https://bugs.llvm.org/show_bug.cgi?id=34827">bug 34827</a>
              from <span class="vcard"><a class="email" href="mailto:paulsson@linux.vnet.ibm.com" title="Jonas Paulsson <paulsson@linux.vnet.ibm.com>"> <span class="fn">Jonas Paulsson</span></a>
</span></b>
        <pre>Thanks for explaining.

I see that at-O1 clang inserts a 'trap' instruction before an 'unreachable'. I
suppose this then just means as you explained that LLVM has detected an
undefined behaviour and inserts a trap so that the program terminates.

At -O0, the 'unreachable' becomes an empty (machine) basic block which then
will certainly be undefined behaviour in this case, as it is last in the linear
layout of the function (and reached via a conditional jump)...</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>