<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 --- - AA incorrect NoAlias result"
   href="http://llvm.org/bugs/show_bug.cgi?id=18460">18460</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>AA incorrect NoAlias result
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Global Analyses
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hfinkel@anl.gov
          </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>Created <span class=""><a href="attachment.cgi?id=11865" name="attach_11865" title="bugpoint reduced test case">attachment 11865</a> <a href="attachment.cgi?id=11865&action=edit" title="bugpoint reduced test case">[details]</a></span>
bugpoint reduced test case

BasicAliasAnalysis is incorrectly returning NoAlias in the following situation:

  %end147 = getelementptr inbounds %"struct.llvm::LiveRange::Segment"* %v97,
i64 -1, i32 1
  %end151 = getelementptr inbounds %"struct.llvm::LiveRange::Segment"* %Seg,
i64 0, i32 1
  %Value.i.i.i.i.i.i = getelementptr inbounds %"class.llvm::SlotIndex"*
%end147, i64 0, i32 0, i32 0
  ...
  %__b.__a.i = select i1 %cmp.i.i, %"class.llvm::SlotIndex"* %end151,
%"class.llvm::SlotIndex"* %end147
  %v117 = getelementptr inbounds %"class.llvm::SlotIndex"* %__b.__a.i, i64 0,
i32 0, i32 0
  %v118 = load i64* %v117, align 8, !tbaa !20
  store i64 undef, i64* %Value.i.i.i.i.i.i, align 8, !tbaa !20

Running:

opt -tbaa -basicaa -aa-eval -evaluate-tbaa -print-no-aliases -print-may-aliases
-disable-output < bugpoint-reduced-simplified.ll

will display (near the end of the output):

  NoAlias:   %v118 = load i64* %v117, align 8, !tbaa !12 <->   store i64 undef,
i64* %Value.i.i.i.i.i.i, align 8, !tbaa !12

This is incorrect, essentially saying that (gep(%end147, 0, 0, 0)) does not
alias (gep(select(..., ..., %end147), 0, 0, 0)), and it certainly might!

I've attached a test case (which is derived from LLVM's LiveInterval.cpp),
which is a bugpoint-reduced file (with some manual cleanup).</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>