<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 - [BasicAA] test-suite stepanov_v1p2 fails with -disable-basicaa"
   href="https://bugs.llvm.org/show_bug.cgi?id=36830">36830</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[BasicAA] test-suite stepanov_v1p2 fails with -disable-basicaa
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>paulsson@linux.vnet.ibm.com
          </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=20095" name="attach_20095" title="reduced testcase">attachment 20095</a> <a href="attachment.cgi?id=20095&action=edit" title="reduced testcase">[details]</a></span>
reduced testcase

I have reduced this and found out that the only difference of the succeeding
and failing programs lies in the initialization of two pointers:

        .type   s_end,@object           # @s_end
+       .section        .bss,"aw",@nobits
        .globl  s_end
        .p2align        3
 s_end:
-       .quad   double_array+16000
+       .space  8
        .size   s_end, 8

        .type   t_0,@object             # @t_0
        .globl  t_0
        .p2align        3
 t_0:
-       .quad   double_array
+       .space  8
        .size   t_0, 8

s_end is supposed to point to the end of the array, and t_0 to its first
element.

The code is otherwise identical, and it certainly seems to assume that these
addresses have been initialized correctly.

Not sure exactly why this happens, but it seems to take place before
instruction selection, during the LLVM I/R optimization passes. The difference
after them is also only in the declaration of @s_end and @t_0.

bin/clang -O3 -march=z13 ./stepanov_v1p2.ii -o ./a.out; ./a.out
test 0 passed: 6000.000000 == 6000.000000

bin/clang -O3 -march=z13 ./stepanov_v1p2.ii -o ./a.out -mllvm -disable-basicaa;
./a.out
test 0 failed: 0.000000 != 6000.000000</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>