https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124974

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Vineet Gupta <[email protected]>:

https://gcc.gnu.org/g:94a2913f9189f2ceaad6bbec99e61084bc93fb0a

commit r17-6855-g94a2913f9189f2ceaad6bbec99e61084bc93fb0a
Author: Vineet Gupta <[email protected]>
Date:   Mon Nov 30 10:49:33 2026 -0800

    bpf: require assembler support for the arena address space [PR124974]

    The arena needs the addr_space_cast instruction, which no released
    binutils supports.  With an older assembler, the compiler accepted
    __arena and then emitted assembly that the assembler rejected.

    Check for the instruction at configure time.  If it is missing,
    __BPF_FEATURE_ARENA is not defined, and a use of __arena is an error,
    through TARGET_ADDR_SPACE_DIAGNOSE_USAGE.  The keyword stays
    registered, so the error names the address space and not an unknown
    type name.  Configure does not fail, because no binutils release has
    the instruction yet.

    Gate the arena tests on a new effective target, bpf_arena.

            PR target/124974

    gcc/ChangeLog:

            * configure.ac: Check whether the assembler supports the
            addr_space_cast instruction.
            * configure: Regenerate.
            * config.in: Regenerate.
            * config/bpf/bpf.cc (bpf_has_arena_p): New function.
            (bpf_addr_space_diagnose_usage): New function.
            (TARGET_ADDR_SPACE_DIAGNOSE_USAGE): Define.
            * config/bpf/bpf-c.cc (bpf_target_macros): Only define
            __BPF_FEATURE_ARENA when the assembler supports the
            instruction.
            * config/bpf/bpf-protos.h (bpf_has_arena_p): Declare.

    gcc/testsuite/ChangeLog:

            * lib/target-supports.exp
            (check_effective_target_bpf_arena): New.
            * gcc.target/bpf/arena-1.c: Require it.
            * gcc.target/bpf/arena-2.c: Likewise.
            * gcc.target/bpf/arena-3.c: Likewise.
            * gcc.target/bpf/arena-btf-1.c: Likewise.
            * gcc.target/bpf/arena-arg-1.c: Likewise.
            * gcc.dg/debug/dwarf2/dwarf-addr-space-typedef-bpf.c: Likewise.

    Signed-off-by: Vineet Gupta <[email protected]>
  • [Bug target/124974] bpf: suppor... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to