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

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 05:21:35 PST 2022


benshi001 marked an inline comment as done.
benshi001 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 {
----------------
aykevl wrote:
> 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
Thanks for your information. I have made a patch to fix that. 

https://reviews.llvm.org/D138125

Beside changes in the clang side, some extra work is need on the backend, and I will do that later this week.


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