[all-commits] [llvm/llvm-project] 452244: [PowerPC][MC] Diagnose out of range branch fixups ...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Dec 1 22:04:24 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4522448cd16489b84c80ec39ae06960b01fd3b59
      https://github.com/llvm/llvm-project/commit/4522448cd16489b84c80ec39ae06960b01fd3b59
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2025-12-02 (Tue, 02 Dec 2025)

  Changed paths:
    M llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
    A llvm/test/MC/PowerPC/fixup-out-of-range.s

  Log Message:
  -----------
  [PowerPC][MC] Diagnose out of range branch fixups (#165859)

Currently, out-of-range branch fixups will be silently miscompiled. GNU
as will instead print an "operand out of range" error instead.

Check that the branch target fixups fit into the proper range and have
low zero bits. The implementation is inspired by SystemZ:
https://github.com/llvm/llvm-project/blob/0ed8e66f88b689c152245d6b968a06fa8e67b51f/llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCAsmBackend.cpp#L31

(My actual interest here is not actually assembly usage, but LLVM
failing to use the correct branch kind for reasons I've not tracked down
yet. Currently this just silently truncates the branch target instead of
producing an error.)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list