Page MenuHomePhabricator

Fix frame pointer layout on AArch64 Linux.
AcceptedPublic

Authored by resistor on Aug 21 2020, 4:43 PM.

Details

Summary

When floating point callee-saved registers were used, the frame pointer would incorrectly point to the bottom of the CSR space (containing saved floating-point registers), rather than to the frame record.

While all frame offsets were calculated consistently, resulting in working code, this prevented stack walkers from being about to traverse the frame list.

Diff Detail

Unit TestsFailed

TimeTest
1,310 mslinux > libFuzzer.libFuzzer::fuzzer-custommutator.test
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/mnt/disks/ssd0/agent/llvm-project/compiler-rt/lib/fuzzer -m64 /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/fuzzer/CustomMutatorTest.cpp -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/fuzzer-custommutator.test.tmp-CustomMutatorTest

Event Timeline

resistor created this revision.Aug 21 2020, 4:43 PM
resistor requested review of this revision.Aug 21 2020, 4:43 PM
resistor edited the summary of this revision. (Show Details)
resistor added a reviewer: t.p.northover.
echristo added inline comments.
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
1189

Can you comment what's going on here for posterity? :)

1866

Ditto.

scw added a subscriber: scw.Aug 21 2020, 4:47 PM
MaskRay added inline comments.
llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h
243
llvm/test/CodeGen/AArch64/framelayout-fp-csr.ll
14

Append a colon to make the label unique test1:

15

FileCheck ignores whitespace change by default. It looks better when CHECK and CHECK-NEXT's content is aligned.

resistor updated this revision to Diff 287239.Aug 22 2020, 10:33 PM
resistor marked 5 inline comments as done.

Update for comments.

echristo accepted this revision.Aug 23 2020, 12:35 PM

LGTM from maintainability etc. Haven't really checked more so might want to wait for others.

This revision is now accepted and ready to land.Aug 23 2020, 12:35 PM
resistor reopened this revision.Aug 26 2020, 10:48 AM
This revision is now accepted and ready to land.Aug 26 2020, 10:48 AM

a0aed80b22d1b698b86e0c16109fdfd4d592756f does not include Differential Revision: so the revision was not closed when the commit landed in HEAD.

If you use arc diff 'HEAD^' to create a patch, arc will set up the tag automatically.