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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected], [email protected],
                    [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to