[PATCH] D153800: [ARM] Adjust strd/ldrd codegen alignment requirements

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 10:58:15 PDT 2023


efriedma added a comment.

> It seems that the calling convention snprintf expects is all values in registers, so r0, r1, r2, r3. Meaning it expects the Value to be in r3.

A "long long" can't fit into r3.

The normal calling convention rules (https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#parameter-passing) require skipping r3 and storing the "long long" value on the stack.  So snprintf should ignore the value in r3 unless we're passing in a bad format string.  (Which is possible, I guess... it looks like the "llvm::format" function isn't marked with a format attribute, so the format string isn't checked anywhere.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153800/new/

https://reviews.llvm.org/D153800



More information about the llvm-commits mailing list