This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Fix inaccurate offsets in PC relative branch instructions
AbandonedPublic

Authored by benshi001 on Jan 26 2023, 11:12 PM.

Details

Reviewers
aykevl
Summary

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 the destination of rjmp .+offset to address_of_rjmp+offset.

This patch fixes the above issue.

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

Diff Detail

Event Timeline

benshi001 created this revision.Jan 26 2023, 11:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 11:12 PM
benshi001 requested review of this revision.Jan 26 2023, 11:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 11:12 PM
benshi001 added inline comments.Jan 26 2023, 11:35 PM
llvm/test/MC/AVR/relocations.s
9

relative jump to the next instruction.

12

relative jump to current instruction.

benshi001 abandoned this revision.Feb 13 2023, 4:05 AM