[LLVMbugs] [Bug 9387] New: clang/llvm generates __udivdi3 where gcc doesn't

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Mar 3 01:44:35 PST 2011


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

           Summary: clang/llvm generates __udivdi3 where gcc doesn't
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: pageexec at freemail.hu
                CC: llvmbugs at cs.uiuc.edu, pageexec at freemail.hu
            Blocks: 4068


given the following code extracted from boot_delay_setup in linux:

unsigned long long loops_per_msec;
extern unsigned long preset_lpj;
void f(void)
{
  loops_per_msec = (unsigned long long)preset_lpj / 1000 * 250;
}

llvm emits a call to __udivdi3 whereas gcc optimizes it into a mul/shift
sequence (compiling an i386 kernel where long is 4 bytes, long long is 8). the
problem is that linux doesn't implement __udivdi3 on i386 and relies on the gcc
optimization.

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