[llvm-bugs] [Bug 29037] New: LLC: Frame Pointer Elim. optimization causes a stack crash on Sandybridge.

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 18 07:15:37 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=29037

            Bug ID: 29037
           Summary: LLC: Frame Pointer Elim. optimization causes a stack
                    crash on Sandybridge.
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
          Assignee: unassignedbugs at nondot.org
          Reporter: shishpanov2010 at yandex.ru
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16986
  --> https://llvm.org/bugs/attachment.cgi?id=16986&action=edit
Source IR

Launch commands: 
llc -mcpu=sandybridge input.ll -o output.asm -O1 ;
clang++ test_static.cpp output.asm -o output.run ;
./output.run

If I run LLC with -O0 instead of -O1 or run it with -disable-fp-elim, the
function f_fu() works properly. If I run it with -O1, I have seg. fault. 
As I can see, the problem is in the last VPEXTRD instruction in f_fu(), which
overrides and damages the pointer's value for the final result on the stack. In
addition, if I skip " TFI.orderFrameObjects(Fn, ObjectsToAllocate);" in
lib/CodeGen/PrologEpilogInserter.cpp:calculateFrameObjectOffsets(MachineFunction
&Fn) with -O1 only, then it works.

LLVM rev. 277592.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160818/4d69f128/attachment.html>


More information about the llvm-bugs mailing list