<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel <spatel+llvm@rotateright.com>"> <span class="fn">Sanjay Patel</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - clang miscompiles basic C code involving modulo at -O3"
   href="http://llvm.org/bugs/show_bug.cgi?id=20849">bug 20849</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;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
                
           </td>
           <td>spatel+llvm@rotateright.com
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>DUPLICATE
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - clang miscompiles basic C code involving modulo at -O3"
   href="http://llvm.org/bugs/show_bug.cgi?id=20849#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - clang miscompiles basic C code involving modulo at -O3"
   href="http://llvm.org/bugs/show_bug.cgi?id=20849">bug 20849</a>
              from <span class="vcard"><a class="email" href="mailto:spatel+llvm@rotateright.com" title="Sanjay Patel <spatel+llvm@rotateright.com>"> <span class="fn">Sanjay Patel</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=20849#c1">comment #1</a>)
<span class="quote">> This works for me with Clang trunk at r217196. It would be good to figure
> out which change fixed this and get it into 3.5.1.</span >

Hi Richard,

This was fixed with r214011 (<a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - wrong code at -O2 and -O3 on x86_64-linux-gnu (codegen)"
   href="show_bug.cgi?id=20355">bug 20355</a>):
<a href="http://llvm.org/viewvc/llvm-project?view=revision&revision=214011">http://llvm.org/viewvc/llvm-project?view=revision&revision=214011</a>

There was one more fix related to that vector division code at r215604:
<a href="http://llvm.org/viewvc/llvm-project?view=revision&revision=215604">http://llvm.org/viewvc/llvm-project?view=revision&revision=215604</a>

Note that integer division is still miscompiling:
<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - wrong code at -O2 and -O3 on x86_64-linux-gnu (only in 64-bit mode and affecting all clang versions) (scalar division)"
   href="show_bug.cgi?id=20494">bug 20494</a>

*** This bug has been marked as a duplicate of <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - wrong code at -O2 and -O3 on x86_64-linux-gnu (codegen)"
   href="show_bug.cgi?id=20355">bug 20355</a> ***</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>