[LLVMbugs] [Bug 15124] New: x86 code emitter ebp and esp conflicts

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 30 12:35:37 PST 2013


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

             Bug #: 15124
           Summary: x86 code emitter ebp and esp conflicts
           Product: new-bugs
           Version: 3.0
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: gm4cheng at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 9950
  --> http://llvm.org/bugs/attachment.cgi?id=9950
assembly code

I recently ran into a case, where x86 fails to run correctly.

Checking into the emitted code, it seems that the local memory anchored at ebp
has conflict with stack memory anchored at esp prepared for function calls.  

For example, let us say:

foo()
{
  ...
  call bar();
}

There is some local data for foo() at ebp-170h.  while preparing the call to
bar, some data is written to esp+17h.  The problem is that esp+17h and ebp-170h
point to the same address, and therefore the data is corrupted.


See the attached llvm ir and assembly code.  The conflict happens at line 292
and 294 in the assembly code.  The address pointed by esp with offsets is the
same as two of them addressed by sbp with offsets.

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