[llvm] [AVR] Fix a crash in AVRInstrInfo::insertIndirectBranch (PR #67324)

Ben Shi via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 20:38:28 PDT 2023


benshi001 wrote:

This patch just fixes the crash, but incorrect code is still generated, and the assembler or the linker will report "out of range".

A full solution would be introducing "code model", like riscv did 
https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/RISCV/jumptable.ll#L4

when `--model-mode=medium` is specified, we use indirect branch `ijmp` instead of short direct `rjmp`, for AVR devices without long direct jump.
and use indirect jump instead of direct jump in cmodel==medium.

https://github.com/llvm/llvm-project/pull/67324


More information about the llvm-commits mailing list