[LLVMbugs] [Bug 8575] New: missing code cleanup after jump threading

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Nov 9 13:49:58 PST 2010


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

           Summary: missing code cleanup after jump threading
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: quality-of-implementation
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: xinliangli at gmail.com
                CC: llvmbugs at cs.uiuc.edu, xinliangli at gmail.com


// Test case

int g;
void foo(int n, int m)
{

    int r = 0;
    if (n  > m)
    {
       r = 1;
    }
    else {
       r = 3;
    }

    if (r < 2)
    {
       g = r;

    }
    else
      g = r+ 3;

}

// Clang -O2 -fomit-frame-pointer produces:
.Leh_func_begin0:
    cmpl    %esi, %edi
    setle    %al
    movzbl    %al, %eax
    leal    1(%rax,%rax), %eax
    jle    .LBB0_2
    movl    %eax, g(%rip)
    ret
.LBB0_2:
    addl    $3, %eax
    movl    %eax, g(%rip)
    ret
.Ltmp0:


// Gcc -O2 produces:

.LFB0:
    .cfi_startproc
    xorl    %eax, %eax
    cmpl    %esi, %edi
    setle    %al
    leal    1(%rax,%rax,4), %eax
    movl    %eax, g(%rip)
    ret

-- 
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