Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JonPsson1 opened this issue Sep 23, 2024 · 8 comments
Labels
backend:SystemZ crash Prefer [crash-on-valid] or [crash-on-invalid]

Comments

@JonPsson1
Copy link
Contributor

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.

@JonPsson1
Copy link
Contributor Author

@nikic

@nikic
Copy link
Contributor

nikic commented Sep 23, 2024

@JonPsson1 It would be good if the error also printed the function name and signature. That would probably make the cause a lot more obvious.

@JonPsson1
Copy link
Contributor Author

With #109699, I get:


ERROR: Missing extension attribute of passed value in call to function:
Callee:  void @_Block_object_assign(ptr, ptr, i32)
Caller:  void @__copy_helper_block_8_32o(ptr, ptr)

UNREACHABLE executed

@JonPsson1
Copy link
Contributor Author

@JonPsson1
Copy link
Contributor Author

The improvement to dump the function signature for cases of missing extension attributes has now been committed.

(f9fbfc5)

@JonPsson1
Copy link
Contributor Author

ping...

@efriedma-quic
Copy link
Collaborator

I think _Block_object_assign is supposed to take a signed integer.

@JonPsson1
Copy link
Contributor Author

Patch proposed: #111740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:SystemZ crash Prefer [crash-on-valid] or [crash-on-invalid]
Projects
None yet
Development

No branches or pull requests

4 participants