<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - LLC: Frame Pointer Elim. optimization causes a stack crash on Sandybridge."
   href="https://llvm.org/bugs/show_bug.cgi?id=29037">29037</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLC: Frame Pointer Elim. optimization causes a stack crash on Sandybridge.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>llc
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>shishpanov2010@yandex.ru
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=16986" name="attach_16986" title="Source IR">attachment 16986</a> <a href="attachment.cgi?id=16986&action=edit" title="Source IR">[details]</a></span>
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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>