Skip to content

[Objective-C] Assertion "Narrow integer argument must have a valid extension type." failed. #109654

@JonPsson1

Description

@JonPsson1

With the recent strengthening of the handling of extensions of narrow integer arguments (commit 1412022), it is now possible to detect cases of missing argument extensions, although there are still some issues that keeps this disabled by default. One of these test failures is

clang/test/CodeGenObjC/blocks-ivar-debug.m -v

What this means is that there is a narrow (<=32 bit) integer argument that is neither sign or zero extended, and is also not marked as noext, which should be done for "struct-in-reg". So this may or may not be a "bug" (missing sign/zero extension), or it could be an argument that should be marked as noext. See https://llvm.org/docs/LangRef.html#parameter-attributes.

This can be reproduced with:

clang -cc1 -internal-isystem ~/llvm-project/build/lib/clang/20/include ~/llvm-project/clang/test/CodeGenObjC/blocks-ivar-debug.m -fblocks -S -o /dev/null -triple s390x--linux-gnu -mllvm -argext-abi-check

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp:9861: void llvm::SystemZTargetLowering::verifyNarrowIntegerArgs(const llvm::SmallVectorImplllvm::ISD::OutputArg&, bool) const: Assertion `(VT != MVT::i32 || (Flags.isSExt() || Flags.isZExt() || Flags.isNoExt())) && "Narrow integer argument must have a valid extension type."' failed.

CC:ing some people that seem to be familiar with ObjC: @kazutakahirata @danix800 , thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.crashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions