Ben Shi
Ben Shi
`rjmp` seems can not be decoded correctly, for the following assembly program `avr5.S`, ``` .text .globl main .p2align 1 main: ldi r24, lo8(def) ; Load lower byte of variable def...
Removed in https://github.com/wa-lang/wa/commit/2e552692a477bf870e1480fcc5681cb09b017226
> apparently avr-gcc doesn't do this optimization > > Link with `-mrelax`, which performs other optimizations, too. Notice there are cases / sections that must not be optimized like `.vectors`...
I am not familiar with rust, and I am now taking the responsibility of maintaining the llvm-avr backend (though it is my spare time work). I am glad if you...
Update: The [custom calling convention](https://gcc.gnu.org/wiki/avr-gcc#Exceptions_to_the_Calling_Convention) does not break the [standard version](https://gcc.gnu.org/wiki/avr-gcc#Calling_Convention), which is llvm's current implementation. So current AVR assembly generated by llvm should work, though a little less efficient....
I think the `llvm-avr` backend should be more stable than `lld`, and I really appreciate if you can try `lld` and feedback me issues !
It seems impossible to do this `call` -> `rcall` transform with clang + gnu-avr-ld.
> What's the problem? All that has to be done is to pass `-mrelax` to `ld`. Sure. It is my mistake. clang's AVR driver does not handle `-mrelax`/`-mno-relax` properly.
fixed by: https://reviews.llvm.org/D144617 https://reviews.llvm.org/D144620
fixed by https://github.com/llvm/llvm-project/commit/4fa9dc948226e374372537250d046924d348307e https://github.com/llvm/llvm-project/commit/2a6e39dbf84af4b3f8b31930fed786b3c56287f5 https://github.com/llvm/llvm-project/commit/acb4d143bdb75930eae8dc700e16e4950b8cc2c8