<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 --- - [ARM] crash while folding SP-update into vpush/vpop"
   href="http://llvm.org/bugs/show_bug.cgi?id=19136">19136</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[ARM] crash while folding SP-update into vpush/vpop
          </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>Windows NT
          </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>weimingz@codeaurora.org
          </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=12230" name="attach_12230" title="llc < test.ll">attachment 12230</a> <a href="attachment.cgi?id=12230&action=edit" title="llc < test.ll">[details]</a></span>
llc < test.ll

When build LLVM with assertion on, it crashes:
*** Bad machine code: Using an undefined physical register ***
- function:    test
- basic block: BB#2 exit (0x16e2ee0)
- instruction: %SP<def,tied1> = t2LDMIA_RET %SP<tied0>, pred:14, pred:%noreg,
%R4<def>, %PC<def>, %S0<imp-use,kill>
- operand 6:   %S0<imp-use,kill>
LLVM ERROR: Found 1 machine code errors.


Without assertion, it output incorrect error.

Analysis:

Before Frame lowering:

vpush d8
sub sp, 64
....
...
s16= ....

s0 = ...

add sp, #64
vpop d8
(ret s0 implicitly)

When -Os is used, tryFoldSPUdateIntoPushPop() kicks in and tries to eliminate
"sub sp, 64" and "add sp, 64" by doing 
vpush {d0-d8}, vpop {d0-d8}, which destroys s0. 

The reason it uses  MBB->computeRegisterLiveness() check the liveness D0.
However D0 is clobbered by S0 and assumed to be LQR_Dead.</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>