<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 --- - movaps used for unaligned memory -march=slm -m32"
   href="http://llvm.org/bugs/show_bug.cgi?id=22756">22756</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>movaps used for unaligned memory -march=slm -m32
          </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>chh@google.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>Built and run on Linux host:
  clang++ -march=slm -m32 -O2  -S -o /tmp/p0.s /tmp/p0.cpp


$ cat /tmp/p0.cpp
typedef struct my_attr_t {
  int flags;
  void* stack_base;
  int stack_size;
  int guard_size;
  int sched_policy;
  int sched_priority;
} my_attr_t;
extern "C" void foo0();
extern "C" void foo1(my_attr_t*);
extern "C" void foo2(unsigned);
extern "C" void my_test1(my_attr_t const *attr) {
  my_attr_t tmp;
  foo0();
  foo2(sizeof(tmp));
  foo1(&tmp);
  tmp = *attr;  // *attr might not be aligned.
  foo1(&tmp);
}


$ cat /tmp/p1.s
    .text
    .file    "/tmp/p0.cpp"
    .globl    my_test1
    .align    16, 0x90
    .type    my_test1,@function
my_test1:                               # @my_test1
    .cfi_startproc
# BB#0:                                 # %entry
    pushl    %edi
.Ltmp0:
    .cfi_def_cfa_offset 8
    pushl    %esi
.Ltmp1:
    .cfi_def_cfa_offset 12
    subl    $52, %esp
.Ltmp2:
    .cfi_def_cfa_offset 64
.Ltmp3:
    .cfi_offset %esi, -12
.Ltmp4:
    .cfi_offset %edi, -8
    movl    64(%esp), %esi
    calll    foo0
    movl    $24, (%esp)
    calll    foo2
    leal    16(%esp), %edi
    movl    %edi, (%esp)
    calll    foo1
    movsd    16(%esi), %xmm0         # xmm0 = mem[0],zero
    movsd    %xmm0, 32(%esp)
    movups    (%esi), %xmm0
    movl    %edi, (%esp)
    movaps    %xmm0, 16(%esp)         # ERROR, should be movups
    calll    foo1
    addl    $52, %esp
    popl    %esi
    popl    %edi
    retl
.Ltmp5:
    .size    my_test1, .Ltmp5-my_test1
    .cfi_endproc


    .ident    "clang version 3.7.0 (<a href="http://llvm.org/git/clang.git">http://llvm.org/git/clang.git</a>
3e1cca7ad0cc730b54c1a2057f9ce36a85eab75a) (llvm/trunk 230778)"
    .section    ".note.GNU-stack","",@progbits



The passed in attr pointer could point to a 4-byte aligned my_attr_t subobject
inside other object.</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>