<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:hfinkel@anl.gov" title="Hal Finkel <hfinkel@anl.gov>"> <span class="fn">Hal Finkel</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - DSE miscompile"
   href="http://llvm.org/bugs/show_bug.cgi?id=17405">bug 17405</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - DSE miscompile"
   href="http://llvm.org/bugs/show_bug.cgi?id=17405#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - DSE miscompile"
   href="http://llvm.org/bugs/show_bug.cgi?id=17405">bug 17405</a>
              from <span class="vcard"><a class="email" href="mailto:hfinkel@anl.gov" title="Hal Finkel <hfinkel@anl.gov>"> <span class="fn">Hal Finkel</span></a>
</span></b>
        <pre>I'm closing this bug; the problem seems to be that the input IR is subtly
invalid. The call instruction:

%call5.1 = tail call signext i8 @toggle_value(%struct.Toggle* %1) #4

is marked as a tail call, and according to BasicAA cannot modify its
stack-allocated argument (although it actually does):

lib/Analysis/BasicAliasAnalysis.cpp:
  // If this is a tail call and Loc.Ptr points to a stack location, we know
that
  // the tail call cannot access or modify the local stack.
  // We cannot exclude byval arguments here; these belong to the caller of
  // the current function not to the current function, and a tail callee
  // may reference them.
  if (isa<AllocaInst>(Object))
    if (const CallInst *CI = dyn_cast<CallInst>(CS.getInstruction()))
      if (CI->isTailCall())
        return NoModRef;</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>