[PATCH] D121672: [AVR] Reject/Reserve R0~R15 on AVRTiny

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 05:27:03 PST 2022


aykevl added inline comments.


================
Comment at: llvm/lib/Target/AVR/AVRISelLowering.cpp:1157-1158
+  if (Tiny) {
+    RegList8 = makeArrayRef(RegList8Tiny, array_lengthof(RegList8Tiny));
+    RegList16 = makeArrayRef(RegList16Tiny, array_lengthof(RegList16Tiny));
+  } else {
----------------
While updating D131867 I found there is a bug in this code: RegList16 has 6 elements while `RegIdx` below can be up to 7. This results in an array out of bounds error.
I believe the issue here is that return values greater than 4 bytes should be returned via the stack on avrtiny, see: https://godbolt.org/z/GzxGezE81


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121672



More information about the llvm-commits mailing list