<html>
    <head>
      <base href="http://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 --- - X86FrameLowering::getFrameIndexOffset generates wrong offsets"
   href="http://llvm.org/bugs/show_bug.cgi?id=17545">17545</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>X86FrameLowering::getFrameIndexOffset generates wrong offsets
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>manjian2006@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=11360" name="attach_11360" title="Source Of The Crash And Patch">attachment 11360</a> <a href="attachment.cgi?id=11360&action=edit" title="Source Of The Crash And Patch">[details]</a></span>
Source Of The Crash And Patch

int X86FrameLowering::getFrameIndexOffset(const MachineFunction &MF, int FI)
const {
  const X86RegisterInfo *RegInfo =
    static_cast<const X86RegisterInfo*>(MF.getTarget().getRegisterInfo());
  const MachineFrameInfo *MFI = MF.getFrameInfo();
-  int Offset = MFI->getObjectOffset(FI) - getOffsetOfLocalArea();
+  int Offset = MFI->getObjectOffset(FI);
The Offset have already been considered OffsetOfLocalArea once,in
PEI::calculateFrameObjectOffsets.So subtract it back here make the offset
smaller than expected.

The file uploaded is the ll source cause a crash and a patch fixing this bug.
Crash cause:
The SkMatrix object is in [SP-60],but [SP-64] is what we expecting.This stack
object is align to 16 bytes.

  %mat = alloca %class.SkMatrix, align 16

So the vmovaps inst will cause a gp exception when accessing unaligned stack
address.

the compile command is 
llc -O2 -o crashx86.s crashx86.ll</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>