<html>
    <head>
      <base href="http://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 --- - Inconsistent Output at O1 optimization level"
   href="http://llvm.org/bugs/show_bug.cgi?id=21440">21440</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Inconsistent Output at O1 optimization level
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sardask01@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>andrea.dibiagio@gmail.com, david.majnemer@gmail.com, dexonsmith@apple.com, llvmbugs@cs.uiuc.edu, rafael.espindola@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Test case :

suyog@suyog-Inspiron-N5010:~$ cat 1.c

#include<stdio.h>
int foo(long a) {
  long b = --a;
  return b > 0;
}
int main() {
  int x;
  if(foo(0x80000000L)==0)
    printf("Hi\n");
  else printf("Hello\n");
  return 0;
}


With -O0 output is : 
suyog@suyog-Inspiron-N5010:~$ Open/build-llvm-Desktop-Default/bin/clang -O0 1.c
suyog@suyog-Inspiron-N5010:~$ ./a.out 
Hello

With -O1 output is :
suyog@suyog-Inspiron-N5010:~$ Open/build-llvm-Desktop-Default/bin/clang -O1 1.c
suyog@suyog-Inspiron-N5010:~$ ./a.out 
Hi

With -O12 output is :
suyog@suyog-Inspiron-N5010:~$ Open/build-llvm-Desktop-Default/bin/clang -O2 1.c
suyog@suyog-Inspiron-N5010:~$ ./a.out 
Hello

The trunk revision is 220994</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>