Fwd: patch to Bug 17545 - X86FrameLowering::getFrameIndexOffset generates wrong offsets

林作健 manjian2006 at gmail.com
Fri Oct 11 00:54:15 PDT 2013


---------- Forwarded message ----------
From: 林作健 <manjian2006 at gmail.com>
Date: 2013/10/11
Subject: Re: patch to Bug 17545 - X86FrameLowering::getFrameIndexOffset
generates wrong offsets
To: Anton Korobeynikov <anton at korobeynikov.info>


Sorry.I see the problem I cause now.Here's the test case.


2013/10/11 Anton Korobeynikov <anton at korobeynikov.info>

> The patch is definitely wrong, however, please provide the testcase
> where the current code yields the wrong offsets.
>
> On Fri, Oct 11, 2013 at 11:20 AM, 林作健 <manjian2006 at gmail.com> wrote:
> > Index: lib/Target/X86/X86FrameLowering.cpp
> > ===================================================================
> > --- lib/Target/X86/X86FrameLowering.cpp (revision 192411)
> > +++ lib/Target/X86/X86FrameLowering.cpp (working copy)
> > @@ -905,7 +905,7 @@
> >    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);
> >    uint64_t StackSize = MFI->getStackSize();
> >
> >    if (RegInfo->hasBasePointer(MF)) {
> > Index: lib/CodeGen/MachineFunction.cpp
> > ===================================================================
> > --- lib/CodeGen/MachineFunction.cpp (revision 192411)
> > +++ lib/CodeGen/MachineFunction.cpp (working copy)
> > @@ -644,9 +644,6 @@
> >  void MachineFrameInfo::print(const MachineFunction &MF, raw_ostream &OS)
> > const{
> >    if (Objects.empty()) return;
> >
> > -  const TargetFrameLowering *FI = MF.getTarget().getFrameLowering();
> > -  int ValOffset = (FI ? FI->getOffsetOfLocalArea() : 0);
> > -
> >    OS << "Frame Objects:\n";
> >
> >    for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
> > @@ -665,7 +662,7 @@
> >      if (i < NumFixedObjects)
> >        OS << ", fixed";
> >      if (i < NumFixedObjects || SO.SPOffset != -1) {
> > -      int64_t Off = SO.SPOffset - ValOffset;
> > +      int64_t Off = SO.SPOffset;
> >        OS << ", at location [SP";
> >        if (Off > 0)
> >          OS << "+" << Off;
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> >
>
>
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131011/962de009/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crashx86.ll
Type: application/octet-stream
Size: 23399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131011/962de009/attachment.obj>


More information about the llvm-commits mailing list