-
Notifications
You must be signed in to change notification settings - Fork 803
Open
Labels
Description
Description
When you have a col_major (the default) matrix in a cbuffer with a higher number of rows than columns, the compiler produces invalid DXIL that writes to an out-of-bounds index of an alloca.
Steps to Reproduce
See: https://godbolt.org/z/6v877foo5
Actual Behavior
Compiled with validation disabled (-Vd) Produces:
%1 = alloca [2 x float], align 4
%9 = getelementptr inbounds [2 x float], [2 x float]* %1, i32 0, i32 2
store float %6, float* %9, align 4
; And, where %2 should be in range 0-2:
%10 = getelementptr inbounds [2 x float], [2 x float]* %1, i32 0, i32 %2With validation enabled (without -Vd):
<source>:14:15: error: Access to out-of-bounds memory is disallowed.
note: at '%11 = getelementptr inbounds [2 x float], [2 x float]* %3, i32 0, i32 2' in block '#0' of function 'main'.
Validation failed.
Environment
- DXC version: all
- Host Operating System: all
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status