<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 --- - optimization failure when parameters passed by pointer (vs passing in a struct)"
   href="http://llvm.org/bugs/show_bug.cgi?id=22123">22123</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>optimization failure when parameters passed by pointer (vs passing in a struct)
          </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>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>LLVM Codegen
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>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=13649" name="attach_13649" title="files 1a.cpp, 1b.cpp, 2a.cpp and 2b.cpp">attachment 13649</a> <a href="attachment.cgi?id=13649&action=edit" title="files 1a.cpp, 1b.cpp, 2a.cpp and 2b.cpp">[details]</a></span>
files 1a.cpp, 1b.cpp, 2a.cpp and 2b.cpp

See files 1a.cpp, 1b.cpp, 2a.cpp and 2b.cpp in attach.

The only difference between 1*.cpp and 2*.cpp is that
1*.cpp pass parameters in a struct, while 2*.cpp pass
them by pointer.

compile:

$ clang++ -g -O2 -c 1a.cpp
$ clang++ -g -O2 -c 1b.cpp
$ clang++ -g -O2 -c 2a.cpp
$ clang++ -g -O2 -c 2b.cpp

disassemble: (GNU objdump (GNU Binutils) 2.24)

$ objdump -d 1a.o > 1a.s
$ objdump -d 1b.o > 1b.s
$ objdump -d 2a.o > 2a.s
$ objdump -d 2b.o > 2b.s

Files 1a.s and 1b.s are equivalent, but
files 2a.s and 2b.s are different: extra memory load in 2b.s.

On -O1, both pairs differ in the same way.

Tested on x86_64, armv7a, powerpc64.</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>