patch to Bug 17545 - X86FrameLowering::getFrameIndexOffset generates wrong offsets
Anton Korobeynikov
anton at korobeynikov.info
Fri Oct 11 00:28:37 PDT 2013
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
More information about the llvm-commits
mailing list