Files
clang-p2996/llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
Ben Shi 697a162fa6 [AVR] Fix inaccurate offsets in PC relative branch instructions
In avr-gcc, the destination of "rjmp label + offset" is address
'label + offset', while destination of "rjmp . + offset" is
'address_of_rjmp + offset + 2'.

Clang is in accordance with avr-gcc for "rjmp label + offset", but
emits incorrect destination of "rjmp . + offset" to
'address_of_rjmp + offset', in which the expected offset 2 is missing.

This patch fixes the above issue.

Fixes https://github.com/llvm/llvm-project/issues/60019

Reviewed By: jacquesguan, aykevl

Differential Revision: https://reviews.llvm.org/D143901
2023-02-14 16:22:14 +08:00

16 KiB