[LLVMbugs] [Bug 12385] New: Missed constant propagation in loops

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 28 08:24:20 PDT 2012


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

             Bug #: 12385
           Summary: Missed constant propagation in loops
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: benny.kra at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


>From GCC PR29738: 

---8<---

int i;

void foo (void);
void bar (void)
{
  int j;
  i = 0;
  for (j = 0; j < 10000; j++)
    if (i)
      foo ();
}

--->8---

The loop is a nop and should be optimized away, yet clang -O3 doesn't realize
that "i" cannot become non-null.

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