[PATCH] D76848: [CodeGen][ARM] Error when writing to specific reserved registers in inline asm

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 14:07:47 PDT 2020


efriedma added a comment.

It looks like you're overwriting the frame pointer (r7 in Thumb mode), which is not something LLVM supports in general.  (This has never been supported, you just weren't getting a diagnostic before.)  The diagnostic should only be enabled when the function actually has a frame pointer in r7; if you use -fomit-frame-pointer, it should compile successfully.

For that exact function, you probably get lucky on older versions of LLVM because the backend doesn't have any reason to use the frame pointer for anything; it's only getting emitted because of -fno-omit-frame-pointer or something like that.

In theory, we could teach the backend to automatically save/restore the frame pointer around inline asm in cases like this, instead of printing an error.  Not sure what the details would look like.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76848





More information about the llvm-commits mailing list