New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[avr] Tools won't understand their own assembly code. #58853
Comments
fixed by https://reviews.llvm.org/D140777 |
fixed by 7a45b13 |
Let ma add that the same problem also occurs with int r24 (void);
int x (void);
int main (void)
{
return x() + r24();
}
|
This case is also fixed in the main branch. I have tested your new case with |
Some specific operands in specific instructions should be treated as variables/symbols/labels, other than registers. This patch fixes those ambiguous cases, such as "lds r25, r24", which means loading the value inside symbol 'r24' into register 'r25'. Fixes llvm/llvm-project#58853 Reviewed by: aykevl Differential Revision: https://reviews.llvm.org/D140777
Compile the following C module with
> clang --target=avr -c -save-temps
This will throw 4 errors at you:
The generated assembly code is all fine:
The 2nd operand of
lds
is an absolute address, hence legitimate operands are: symbol, symbol+offset or integer. Hence its obvious thatx
names a symbol, not a register.The 1st operand of
sts
is an absolute address, hence legitimate operands are: symbol, symbol+offset or integer. Hence its obvious thatr25
in the 1st operand names a symbol, not a register.The appropriate RELOCs are of type
R_AVR_16
in all the cases.The text was updated successfully, but these errors were encountered: