[LLVMbugs] [Bug 19136] New: [ARM] crash while folding SP-update into vpush/vpop

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 13 15:57:55 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19136

            Bug ID: 19136
           Summary: [ARM] crash while folding SP-update into vpush/vpop
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: weimingz at codeaurora.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12230
  --> http://llvm.org/bugs/attachment.cgi?id=12230&action=edit
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140313/e852e6cf/attachment.html>


More information about the llvm-bugs mailing list