This is an archive of the discontinued LLVM Phabricator instance.

[AIX] unset bit "IsBackChainStored" of traceback table for leaf functions with no stack frame
ClosedPublic

Authored by DiggerLin on Mar 14 2023, 10:50 AM.

Details

Summary

in function PPCAIXAsmPrinter::emitTracebackTable() ,the bit "IsBackChainStored" of traceback table always set true, it will cause aix debug tools "dbx" emit an error info "libdebug assertion "(framep->getGpr(STKP, &addr) == DB_SUCCESS && *nextStkpp == addr)" when debug a leaf functions with no stack frame.

If a a leaf functions with no stack frame , the bit IsBackChainStored should be unset.

Diff Detail

Event Timeline

DiggerLin created this revision.Mar 14 2023, 10:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2023, 10:50 AM
DiggerLin requested review of this revision.Mar 14 2023, 10:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2023, 10:50 AM

Are there still tests where IsBackChainStored is true?

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
2098–2099

Comment no longer applies

We should already have case for leaf/non-leaf functions. Can we also add cases on the boundary conditions for redzone with below MIR?

---
name:            test
tracksRegLiveness: true
stack:
  - { id: 0, size: 288, alignment: 16 }
body: |
  bb.0:
    BLR8 implicit $lr8, implicit $rm
...

288 is redzone size for 64-bit PPC.

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
2100

Are you using the wrong diff baseline? Seems like the left side is a local commit of your working branch? In the main trunk, I see

// Always store back chain.
SecondHalfOfMandatoryField |= TracebackTable::IsBackChainStoredMask;
DiggerLin updated this revision to Diff 505473.Mar 15 2023, 6:41 AM
DiggerLin marked 2 inline comments as done.

fixed part of comment.

DiggerLin added a comment.EditedMar 15 2023, 6:43 AM

Are there still tests where IsBackChainStored is true?

yes, for example ,in the test llvm/test/CodeGen/PowerPC/aix-emit-tracebacktable.ll , line 177

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
2098–2099

thanks

2100

yes, left side is working. thanks

DiggerLin added inline comments.Mar 15 2023, 10:01 AM
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
2100

I git diff again my local branch, it correct now.

DiggerLin updated this revision to Diff 505626.Mar 15 2023, 2:28 PM

add a redzone boundary test case

shchenz accepted this revision.Mar 15 2023, 5:47 PM
shchenz edited reviewers, added: shchenz; removed: cezheng.

LGTM. Thanks for improving this.

This revision is now accepted and ready to land.Mar 15 2023, 5:47 PM