-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
riscv codegen oddity: emits (hopefully no-op) signext for a u32 param. #98151
Copy link
Copy link
Closed
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationO-riscvTarget: RISC-V architectureTarget: RISC-V architectureT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-FFIArea: Foreign function interface (FFI)Area: Foreign function interface (FFI)A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationArea: Code generationO-riscvTarget: RISC-V architectureTarget: RISC-V architectureT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I tried this code:
Note the compile flags; thus I invoked the compiler like so:
I expected to see this happen:
Semi-uniform handling of unsigned and signed extension of the arguments/return values. Namely, I would expect
uNtypes to be (at most) zero-extended, andiNtypes to be (at most) signed-extended.Instead, this happened: The u32 handling emits a signext attribute, like so:
I think this ends up acting as having no effect, but its weird nonetheless to have it there.