<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 --- - clang -m32 -O fails with long long function argument with message "Call result #3 has unhandled type i32""
   href="http://llvm.org/bugs/show_bug.cgi?id=15353">15353</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang -m32 -O fails with long long function argument with message "Call result #3 has unhandled type i32"
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.2
          </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>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jayzel@synopsys.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10075" name="attach_10075" title="Here is the results of trying to compile the program">attachment 10075</a> <a href="attachment.cgi?id=10075&action=edit" title="Here is the results of trying to compile the program">[details]</a></span>
Here is the results of trying to compile the program

On x86 32 bit architecture with C or C++ program clang fails to compile a
program with a long long argument passed to a function following a for
statement
to set the long long.

This works in 64 bit mode.  The problem is only when using optimization levels
from -O to -O3.  Without optimization or with -O4 the program compiles
successfully.
The program can be compiled with
clang -m32 -c -O clangfail.c
It will also fail with
clang++ -m32 -c -O clangfail.c

Following is the C file that causes the problem:
/*-----------------------------------------*/
void myfprintf(long long);
void integer_work(long count)
{
  long long i;
  long long result = 0;
  for (i=1; i <= count; i++) {
        result+=i;
 }
  myfprintf(result);
}</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>