This is an archive of the discontinued LLVM Phabricator instance.

[clang][RISCV] Fix ABI mismatch between GCC and Clang (extension of integers on stack)

Authored by asb on Dec 20 2022, 7:26 AM.



See for full details. Essentially, a previous version of the psABI indicated (by my reading) that integer scalars passed on the stack were anyext. A later commit changed this to indicate that they are in fact signext/zeroext just as if they were passed in registers.

This patch adjusts Clang's ABI lowering to match this. A flag wasn't added to retain the old behaviour, as the hope is that it's sufficiently hard to trigger an issue due to this that it isn't worthwhile doing so.

Diff Detail

Event Timeline

asb created this revision.Dec 20 2022, 7:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 20 2022, 7:26 AM
asb requested review of this revision.Dec 20 2022, 7:26 AM
kito-cheng accepted this revision.Dec 20 2022, 5:50 PM

LGTM from the psABI aspect.

This revision is now accepted and ready to land.Dec 20 2022, 5:50 PM
asb updated this revision to Diff 491741.Jan 24 2023, 6:07 AM

Rely on manual test updates in order to avoid reliance on D142373 (and hence get this landed).

This revision was landed with ongoing or failed builds.Jan 24 2023, 6:21 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2023, 6:21 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript