Skip to content

full debug: llc -O0 emits .b8 4294967295 that ptxas rejects (repr_u32_enum_stride, set_discriminant) #1220

Closed

Description

@nihalpasham

With CUDA_OXIDE_DEBUG=full two examples produce PTX that ptxas rejects:

ptxas repr_u32_enum_stride.ptx, line 4956; error : Value out of range for type .b8 4294967295
ptxas set_discriminant.ptx,     line 2259; error : Value out of range for type .b8 4294967291
ptxas fatal : Ptx assembly aborted due to errors
  • Both are .b8 initializers carrying a 32-bit value: 4294967295 is -1 as u32, 4294967291 is -5. Something emits an i8 constant through a 32-bit path when llc runs at -O0 (release builds of the same examples assemble fine).
  • Independent of the MIR level (fails at 0 and at 2), so it is on the LLVM/llc side or in how the exporter spells the constant.
  • Both examples exercise enum discriminants; likely one root cause.

Repro:

CUDA_OXIDE_DEBUG=full cargo oxide build repr_u32_enum_stride --arch=sm_80
ptxas -arch=sm_80 crates/rustc-codegen-cuda/examples/repr_u32_enum_stride/repr_u32_enum_stride.ptx -o /dev/null

Found by the 2026-09-02 forced full-debug sweep; CI never builds these two with full debug.

Activity

  1. added
    bug
    debug info
    codegen
    llvm-export
    on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcodegendebug infollvm-export

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions