[all-commits] [llvm/llvm-project] 697a16: [AVR] Fix inaccurate offsets in PC relative branch...

Ben Shi via All-commits all-commits at lists.llvm.org
Tue Feb 14 00:22:43 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 697a162fa63df328ec9ca334636c5e85390b2bf0
      https://github.com/llvm/llvm-project/commit/697a162fa63df328ec9ca334636c5e85390b2bf0
  Author: Ben Shi <powerman1st at 163.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M llvm/lib/Target/AVR/MCTargetDesc/AVRAsmBackend.cpp
    M llvm/test/MC/AVR/inst-brbc.s
    M llvm/test/MC/AVR/inst-brbs.s
    M llvm/test/MC/AVR/inst-family-cond-branch.s
    M llvm/test/MC/AVR/inst-rcall.s
    M llvm/test/MC/AVR/inst-rjmp.s

  Log Message:
  -----------
  [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




More information about the All-commits mailing list