<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 --- - [AArch64] Incorrect code generation"
   href="https://llvm.org/bugs/show_bug.cgi?id=23408">23408</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[AArch64] Incorrect code generation
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: AArch64
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>simontaylor1@ntlworld.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>Compiling the following code with any level of optimization above -O0 produces
incorrect assembly for AArch64.

====

typedef struct {float v[2];} vec2;
typedef struct {float v[3];} vec3;

vec2 getVec2();

vec3 getVec3()
{
 vec2 myVec = getVec2();

 vec3 res;
 res.v[0] = myVec.v[0];
 res.v[1] = myVec.v[1];
 res.v[2] = 1;
 return res;
}

====

$ clang -arch arm64 -O1 test.c -S -o - 
    .section    __TEXT,__text,regular,pure_instructions
    .globl    _getVec3
    .align    2
_getVec3:                               ; @getVec3
; BB#0:
    b    _getVec2

====

I haven't tested trunk, but the bug occurs on both the 3.6.0 and 3.5.2 binary
releases for OS X from the llvm.org download page, as well as the Apple LLVM
6.1 and 6.0 compilers shipped with Xcode 6.3 and 6.2 respectively.

I'm guessing it's an AArch64 backend issue, at least the armv7 code appears
correct for this test case.</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>