[LLVMbugs] [Bug 10987] New: Optimizer reduces well-defined load to undef in some situations

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 22 09:02:45 PDT 2011


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

           Summary: Optimizer reduces well-defined load to undef in some
                    situations
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: marijnh at gmail.com
                CC: llvmbugs at cs.uiuc.edu


See https://gist.github.com/1235034 for reproduction instructions.

In a very specific situation (a store to the same alloca in multiple branches
(which is optimized to a phi) with at least one of those branches doing an
invoke call with a non-trivial unwind sequence, which takes an output pointer
that is subsequently loaded and used for aforementioned store), a load that, as
far as I can see, is perfectly safe, is removed and replaced by an undef value.

I've seen a similar issue where the load is moved above the call in the output,
but still present. That might be what's happening here too -- first the load is
moved to before the call, at which point the alloca being loaded is
uninitialized, which would make replacing it with undef a valid decision.

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