[LLVMbugs] [Bug 12113] New: Dead store when handling larger-than-register shfits

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 28 07:37:56 PST 2012


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

             Bug #: 12113
           Summary: Dead store when handling larger-than-register shfits
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: joerg at NetBSD.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Consider:

unsigned int f(unsigned int x)
{
        return 1ULL << ((x % 32));
}

When compiling with -m32, this turns into

f:
    movl    4(%esp), %ecx
    movl    $1, %edx
    shll    %cl, %edx
    xorb    %al, %al
    testb    %al, %al
    movl    $0, %eax
    cmovel    %edx, %eax
    ret

The xorb / testb / cmovel sequence is invariant wrt to the input.

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