[LLVMbugs] [Bug 2470] New: singlely-initialized value not optimized

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Jun 17 14:05:26 PDT 2008


           Summary: singlely-initialized value not optimized
           Product: libraries
           Version: trunk
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nicholas at mxc.ca
                CC: llvmbugs at cs.uiuc.edu

This is a refinement of PR2436:

  extern char *getPtr();

  char f(int i, int j) {
    char *arr[10];

    arr[i] = getPtr();
    arr[i][42] = 123;

    return arr[j][42];

The values of 'j' and 'i' don't actually matter; if they're not equal, the
result is undefined, if they are equal, the function returns 123. The store of
123 can't be eliminated though, just the load of arr[j].

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