<html>
    <head>
      <base href="https://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 --- - Incorrect code when hoist spill to a BB with landingpad successor"
   href="https://llvm.org/bugs/show_bug.cgi?id=27612">27612</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect code when hoist spill to a BB with landingpad successor
          </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>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>Register Allocator
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>wmi@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=16296" name="attach_16296" title="testcase 1.cc">attachment 16296</a> <a href="attachment.cgi?id=16296&action=edit" title="testcase 1.cc">[details]</a></span>
testcase 1.cc

We had an internal test SEGV after r266162. A testcase 1.cc was extracted and
attached.

~/workarea/llvm-r266162/dbuild/bin/clang++ -std=c++11 -fPIC
-fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,return,returns-nonnull-attribute,shift-exponent,unreachable,vla-bound
-fno-sanitize-recover=all -O1 -S 1.cc

The following code was problematic:

        xorl    %edi, %edi
        callq   _ZlsIiEv1CIT_Ej@PLT
.Ltmp2:
        movq    %r12, 24(%rbx)          # 8-byte Spill
# BB#5:

_ZlsIiEv1CIT_Ej@PLT was a func which may throw. Before hoisting, Spill (movq   
%r12, 24(%rbx)) existed in both fall through code and landingpad of callq  
_ZlsIiEv1CIT_Ej@PLT. It is incorrect to insert Spill after the call during
hoisting.  

When we hoist spill to a BB with landingpad successor, if the live interval of
the spill reg live into the landingpad successor, the spill should be inserted
before the last split point, i.e., before the call that may throw.

Will send out a patch for review soon.</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>