[LLVMbugs] [Bug 16717] New: SelectDAGISel::SelectAllBasicBlocks fails to legalize instructions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 26 20:42:55 PDT 2013


            Bug ID: 16717
           Summary: SelectDAGISel::SelectAllBasicBlocks fails to legalize
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: manjian2006 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10938
  --> http://llvm.org/bugs/attachment.cgi?id=10938&action=edit
source that llvm generates wrong code

compiling option:
-O0 -fPIC -target armv5te-linux-androideabi -S 1.cpp

That generates code which does pic incorrectly:
    push    {r11, lr}
    mov    r11, sp
    sub    sp, sp, #8
    ldr    r0, .LCPI0_1
=>    ldr    r1, .LCPI0_0
    ldr    r0, [r1, r0]
    bl    _ZN1HC1Ev
    .long    g_h(GOT)
    .long    _GLOBAL_OFFSET_TABLE_

The marked code apparently missing add r0,pc

And I have found -O2 generates code correctly.After examining the code 
SelectDAGISel::SelectAllBasicBlocks,I can see FastIS is activated in O0 but not
in O2,and that consume all the changes to do SelectBasicBlock.That will leave
no meaningful data to legalize the code(SDB is empty).

I guess FastIS->SelectInstruction may not do its job well.

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/20130727/56f07357/attachment.html>

More information about the llvm-bugs mailing list