<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:hfinkel@anl.gov" title="Hal Finkel <hfinkel@anl.gov>"> <span class="fn">Hal Finkel</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Incorrect code when right shifting signed int by more than its size"
   href="https://bugs.llvm.org/show_bug.cgi?id=39914">bug 39914</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 - Incorrect code when right shifting signed int by more than its size"
   href="https://bugs.llvm.org/show_bug.cgi?id=39914#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - Incorrect code when right shifting signed int by more than its size"
   href="https://bugs.llvm.org/show_bug.cgi?id=39914">bug 39914</a>
              from <span class="vcard"><a class="email" href="mailto:hfinkel@anl.gov" title="Hal Finkel <hfinkel@anl.gov>"> <span class="fn">Hal Finkel</span></a>
</span></b>
        <pre>While I understand why you think that should be true, given how the operation
might work at the hardware level, the C/C++ specifications don't define the
behavior of shifts greater-than or equal-to the number of bits in the type.
Clang's behavior here is not a bug. The optimizer optimizes code assuming that
code that exhibits undefined behavior is not actually executed (and, thus, it
doesn't really matter what it does). You might find it useful to compile your
code with -fsanitize=undefined to enable the undefined-behavior sanitizer.</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>