[LLVMbugs] [Bug 5625] New: Loop is not eliminated

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Nov 27 04:42:44 PST 2009


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

           Summary: Loop is not eliminated
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: asl at math.spbu.ru
                CC: clattner at apple.com, dpatel at apple.com, gohman at apple.com,
                    llvmbugs at cs.uiuc.edu


Consider the following simple C code:

int* a;
int b;

void foo(unsigned N, int c) {
 unsigned i;

 a = &b;

 for (i=0; i< N; ++i) {
   *a = c;
   a = &b;
 }
}

Obviously the assignments in the loop are redundant. running llvm-gcc -O3 does
not eliminate the loop, however "llvm-gcc t.c -S -o - -emit-llvm -O3 | opt
-std-compile-opts -S" does. 

Chris suggested there might be a pass ordering problem


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