<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 --- - invalid vectorization of fcmp oge and friends"
   href="http://llvm.org/bugs/show_bug.cgi?id=22371">22371</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>invalid vectorization of fcmp oge and friends
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>pitrou@free.fr
          </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>Trying llvm3.6rc1 with Numba, I get crashes on some vectorized code for ordered
comparisons.

For a loop running "fcmp oge" over an array of doubles, generated assembly
looks like this (x86-64):

    .align    8
.LCPI0_0:
    .quad    4607182418800017408
    .text
    .globl    "__main__.fn.float64.float64.array(float64,_1d,_C,_nonconst)"
    .align    16, 0x90
    .type   
"__main__.fn.float64.float64.array(float64,_1d,_C,_nonconst)",@function
"__main__.fn.float64.float64.array(float64,_1d,_C,_nonconst)":
    movq    32(%rdx), %r8
    testq    %r8, %r8
    jle    .LBB0_19
    movq    24(%rdx), %rcx
    cmplesd    %xmm0, %xmm1
    movabsq    $.LCPI0_0, %rax
    andpd    (%rax), %xmm1
        [snip]

The "andpd (%rax), %xmm1" crashes. AFAIU, that's because $.LCPI0_0 is not
16-byte aligned.

A quick look with gdb seems to confirm that hypothesis:

(gdb) info registers rax
rax            0x7ffff7fea058    140737354047576
(gdb) x/2 0x7ffff7fea058
0x7ffff7fea058:    0x00000000    0x3ff00000</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>