[LLVMbugs] [Bug 4919] New: llvm-gcc doesn't optimize simple factorial into a loop

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Sep 7 12:58:40 PDT 2009


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

           Summary: llvm-gcc doesn't optimize simple factorial into a loop
           Product: libraries
           Version: trunk
          Platform: PC
               URL: http://codepad.org/2K5gNj3e
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Interprocedural Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rjmccall at apple.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3469)
 --> (http://llvm.org/bugs/attachment.cgi?id=3469)
Original pastebin

This is a forwarded complaint by "bearophile" on LLVM IRC, who unfortunately
never files bugs.

The following naive factorial function does not get optimized into a loop, even
at -O3.

long fact(long x) {
    if (x <= 0)
        return 1;
    else
        return x * fact(x - 1);
}

gcc-4.3.3 apparently can do this.


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