LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 41 - llc -disable-fp-elim miscompiles functions with allocas
Summary: llc -disable-fp-elim miscompiles functions with allocas
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: X86 (show other bugs)
Version: 1.0
Hardware: PC Linux
: P normal
Assignee: Chris Lattner
URL:
Keywords:
Depends on:
Blocks: 4
  Show dependency tree
 
Reported: 2003-10-13 23:48 PDT by Brian R. Gaeke
Modified: 2010-03-06 13:59 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian R. Gaeke 2003-10-13 23:48:18 PDT
When I compile this LLVM code with "llc -disable-fp-elim" then assemble the
result with "gcc", and run it, it crashes almost every time. When I
remove "-disable-fp-elim", the result works fine every time.

target endian = little
target pointersize = 32
implementation
int %main() {
entry:
        %Array = alloca [36 x [36 x int]]
        ret int 0
}
Comment 1 Chris Lattner 2003-10-14 13:40:13 PDT
This is a bug in the linux kernel:

arch/i386/mm/fault.c:
                /*
                 * accessing the stack below %esp is always a bug.
                 * The "+ 32" is there due to some instructions (like
                 * pusha) doing post-decrement on the stack and that
                 * doesn't show up until later..
                 */
                if (address + 32 < regs->esp)
                        goto bad_area;

Fixing this is going to unfortunately require some fairly substantial work.