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

[SPIR-V] CStyleCastExpr error when casting to void #7134

Open
noahwhygodwhy opened this issue Feb 10, 2025 · 0 comments
Open

[SPIR-V] CStyleCastExpr error when casting to void #7134

noahwhygodwhy opened this issue Feb 10, 2025 · 0 comments
Labels
bug Bug, regression, crash spirv Work related to SPIR-V

Comments

@noahwhygodwhy
Copy link

noahwhygodwhy commented Feb 10, 2025

Description

I'd like to first acknowledge that this is a bit silly, but when casting a variable to a (void), a much more internal-compiler sort of error is returned when compiled to spir-v. No error occurs when compiling to dxil. This happens with every type I've tried (uint, float, bool, struct, RWByteAddressBuffer)

(The reason for doing this (void) nonsense is selectively silencing unused-variable warnings in a rather large code base in cases where keeping the sometimes-unused variables is unavoidable. Also, it's in a #define so pragmas to silence the warning don't work.)

Steps to Reproduce

https://godbolt.org/z/6bd1jThrx

Actual Behavior

CStyleCastExpr 0x5e206b49aae0 'void' <ToVoid>
`-DeclRefExpr 0x5e206b49aaa8 'bool' lvalue Var 0x5e206b49a450 'x' 'bool'

Compiler returned: 5

Environment

  • DXC version: 1.8.2407 and trunk
  • Host Operating System: Windows 11 22h2 (22621.4751) and also godbolt

This might be related to #5103, as it is the only issue that contains CStyleCastExpr when i searched, but that seemed to be an issue with the dxil side, while this error only happens when outputting spir-v

@noahwhygodwhy noahwhygodwhy added bug Bug, regression, crash needs-triage Awaiting triage spirv Work related to SPIR-V labels Feb 10, 2025
@damyanp damyanp moved this to For Google in HLSL Triage Feb 11, 2025
@s-perron s-perron moved this from For Google to Triaged in HLSL Triage Feb 11, 2025
@s-perron s-perron added this to the Next+1 Release milestone Feb 11, 2025
@s-perron s-perron removed the needs-triage Awaiting triage label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash spirv Work related to SPIR-V
Projects
Status: New
Status: Triaged
Development

No branches or pull requests

2 participants