<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 --- - LCSSA and SSAUpdater incorrectly update dbg.value"
   href="http://llvm.org/bugs/show_bug.cgi?id=15501">15501</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LCSSA and SSAUpdater incorrectly update dbg.value
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>atrick@apple.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>Created <span class=""><a href="attachment.cgi?id=10170" name="attach_10170" title="Contrived test case">attachment 10170</a> <a href="attachment.cgi?id=10170&action=edit" title="Contrived test case">[details]</a></span>
Contrived test case

clang -g -c -emit-llvm -S loop.c -O3 -mllvm -disable-llvm-optzns -o loop.ll

opt loop.ll -O3 -S -o loop-O3.ll

Notice that the dbg.value inside the loop now refers to the LCSSA value outside
the loop.

if.end2:                                          ; preds = %if.end
  %call3 = tail call i32 (...)* @bar() #2, !dbg !21
  %dec = add nsw i32 %dec5, -1, !dbg !17
  tail call void @llvm.dbg.value(metadata !{i32 %dec.lcssa}, i64 0, metadata
!12), !dbg !17
  %cmp = icmp slt i32 %dec, 0, !dbg !19
  br i1 %cmp, label %while.end, label %if.end, !dbg !19

while.end:                                        ; preds = %if.end2, %if.end,
%entry
  %dec.lcssa = phi i32 [ %dec3, %entry ], [ %dec5, %if.end ], [ %dec, %if.end2
]

llc does yield an assert, but it isn't very helpful.

Assertion failed: (TheCU && "Unable to find compile unit!"), function
beginFunction, file /Volumes/Source/fix/lib/CodeGen/AsmPrinter/DwarfDebug.cpp,
line 1362.

This is a general problem with RAUW on ValueHandle. It would be easy to fix
this test case without fixing the general problem. RAUW should *not* be called
by LCSSA or SSAUpdater.

See PR15413.</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>