[LLVMbugs] [Bug 3522] New: Missing register save when only used in landing pad ( llc -fast ok)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Feb 9 13:17:02 PST 2009


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

           Summary: Missing register save when only used in landing pad (llc
                    -fast ok)
           Product: new-bugs
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=2517)
 --> (http://llvm.org/bugs/attachment.cgi?id=2517)
testcase .ll

Attached IR is reduced from Ada test c34018a which started failing
very recently.  If compiled with "llc -fast", all is ok, but with
"llc" the test fails.  The reason seems clear: in the good "fast"
code the value of %al is saved for later use in a landing pad.  In
the bad code it is not saved and some random value is used in the
landing pad.  Here's the start of the good code:

_ada_c34018a:
.Leh_func_begin1:
.Llabel24:
        pushl   %ebp
        pushl   %ebx
        pushl   %edi
        pushl   %esi
        subl    $12, %esp
        movl    $90, (%esp)
        call    report__ident_int   <= returns 90
        movl    %eax, %esi
        leal    -51(%esi), %eax
        cmpl    $39, %eax
        jbe     .LBB1_2 # bb3       <= jumps to bb3
.LBB1_1:        # bb
        leal    .str, %esi
        movl    %esi, (%esp)
        movl    $24, 4(%esp)
        call    __gnat_rcheck_12
.LBB1_2:        # bb3
        movl    %esi, %eax
        movb    %al, %bl            <= value saved to %bl, missing in bad code
.Llabel1:
        movl    $.str, (%esp)
        movl    $32, 4(%esp)
        call    __gnat_rcheck_12    <= raises an exception
...control eventually gets to:
.LBB1_9:        # bb17
        movb    %bl, %al            <= saved value restored here
        addb    $255, %al
        cmpb    $99, %al
        jbe     .LBB1_12        # bb20



While in the bad code:

_ada_c34018a:
.Leh_func_begin1:
.Llabel24:
        pushl   %ebx
        pushl   %edi
        pushl   %esi
        subl    $8, %esp
        movl    $90, (%esp)
        call    report__ident_int        <= returns 90
        movl    %eax, %esi
        leal    -51(%esi), %eax
        cmpl    $40, %eax
        jae     .LBB1_25        # bb     <= falls through
.LBB1_1:        # bb3
.Llabel1:
        movl    $32, 4(%esp)             <= value %al not saved
        movl    $.str, (%esp)
        call    __gnat_rcheck_12         <= raises an exception
...control eventually gets to:
.LBB1_6:        # bb17
        movb    %bl, %al                 <= value restored but was never saved!
        decb    %al
        cmpb    $100, %al
        jb      .LBB1_8 # bb20


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list