[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


           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;

      g = r+ 3;


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

// Gcc -O2 produces:

    xorl    %eax, %eax
    cmpl    %esi, %edi
    setle    %al
    leal    1(%rax,%rax,4), %eax
    movl    %eax, g(%rip)

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