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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to