<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Wrong constant folding"
   href="https://llvm.org/bugs/show_bug.cgi?id=25649">25649</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrong constant folding
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ishiura-compiler@ml.kwansei.ac.jp
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>LLVM + clang-3.8 miscompiles the following code.

$ cat error.c
int a = 0;
long long b = 1LL;
long long c = 3LL;
volatile unsigned int d = 0U;
int f = 0;

int main ( void )
{
    int e = 6 / ((unsigned int)b * (3LL * (3 * c == 9)) << (1 ^ a || d >= 0));

    if ( e != 1 ) { f = e; __builtin_abort(); }

    return 0;
}

$ clang-3.8 error.c -m32 -w -O3

$ ./a.out                                 
zsh: abort      ./a.out

$ clang-3.8 -v                            
clang version 3.8.0 (trunk 254118)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
InstalledDir: /Users/home/clang/bin</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>