<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - program crashes at movaps, unaligned stack address, -O3"
   href="https://bugs.llvm.org/show_bug.cgi?id=34038">34038</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>program crashes at movaps, unaligned stack address, -O3
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>4.0
          </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>release blocker
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>eric@youngblut.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=18898" name="attach_18898" title="C program for repro">attachment 18898</a> <a href="attachment.cgi?id=18898&action=edit" title="C program for repro">[details]</a></span>
C program for repro

ericy@mrpink:~$ /usr/bin/clang --version
clang version 4.0.0-1ubuntu1 (tags/RELEASE_400/rc1)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

ericy@mrpink:~$ /usr/bin/clang -O3 movaps_unaligned_crash.c  && ./a.out 
Segmentation fault

It does not repro with -O2.

You can see that it used the movaps instruction with an unaligned address.

(gdb) disassemble 
Dump of assembler code for function main:
   0x0000000000400490 <+0>:     sub    $0x28,%rsp
   0x0000000000400494 <+4>:     movq   $0x0,0x20(%rsp)
   0x000000000040049d <+13>:    movq   $0x0,0x18(%rsp)
   0x00000000004004a6 <+22>:    mov    0x200b7b(%rip),%rax        # 0x601028
<obj>
=> 0x00000000004004ad <+29>:    movaps 0x18(%rsp),%xmm0
   0x00000000004004b2 <+34>:    movaps %xmm0,(%rsp)
   0x00000000004004b6 <+38>:    mov    $0x601028,%edi
   0x00000000004004bb <+43>:    xor    %esi,%esi
   0x00000000004004bd <+45>:    xor    %edx,%edx
   0x00000000004004bf <+47>:    xor    %ecx,%ecx
   0x00000000004004c1 <+49>:    xor    %r8d,%r8d
   0x00000000004004c4 <+52>:    callq  *(%rax)
   0x00000000004004c6 <+54>:    xor    %eax,%eax
   0x00000000004004c8 <+56>:    add    $0x28,%rsp
   0x00000000004004cc <+60>:    retq   
End of assembler dump.
(gdb) p $rsp
$1 = (void *) 0x7fffffffdf50</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>