radeonsi: compile warnings
gcc11 release build
In function ‘si_compute_clear_12bytes_buffer’,
inlined from ‘si_clear_buffer’ at ../src/gallium/drivers/radeonsi/si_compute_blit.c:330:7,
inlined from ‘si_screen_clear_buffer’ at ../src/gallium/drivers/radeonsi/si_compute_blit.c:382:4:
../src/gallium/drivers/radeonsi/si_compute_blit.c:220:4: warning: ‘memcpy’ forming offset [4, 11] is out of the bounds [0, 4] [-Warray-bounds]
220 | memcpy(sctx->cs_user_data, clear_value, 12);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[710/908] Compiling C object src/gallium/drivers/radeonsi/libradeonsi.a.p/si_buffer.c.o
../src/gallium/drivers/radeonsi/si_buffer.c: In function ‘si_resource_create’:
../src/gallium/drivers/radeonsi/si_buffer.c:106:43: warning: array subscript ‘struct si_texture[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds]
106 | if ((res->b.b.target != PIPE_BUFFER && !tex->surface.is_linear) ||
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/util/os_memory.h:70,
from ../src/util/u_memory.h:38,
from ../src/gallium/drivers/radeonsi/si_buffer.c:26:
../src/util/os_memory_stdc.h:41:27: note: referencing an object of size 140 allocated by ‘malloc’
41 | #define os_malloc(_size) malloc(_size)
| ^~~~~~~~~~~~~
../src/util/u_memory.h:46:24: note: in expansion of macro ‘os_malloc’
46 | #define MALLOC(_size) os_malloc(_size)
| ^~~~~~~~~
../src/util/u_memory.h:54:41: note: in expansion of macro ‘MALLOC’
54 | #define MALLOC_STRUCT(T) (struct T *) MALLOC(sizeof(struct T))
| ^~~~~~
../src/gallium/drivers/radeonsi/si_buffer.c:581:10: note: in expansion of macro ‘MALLOC_STRUCT’
581 | buf = MALLOC_STRUCT(si_resource);
| ^~~~~~~~~~~~~
../src/gallium/drivers/radeonsi/si_buffer.c: In function ‘pipe_aligned_buffer_create’:
../src/gallium/drivers/radeonsi/si_buffer.c:106:43: warning: array subscript ‘struct si_texture[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds]
106 | if ((res->b.b.target != PIPE_BUFFER && !tex->surface.is_linear) ||
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/util/os_memory.h:70,
from ../src/util/u_memory.h:38,
from ../src/gallium/drivers/radeonsi/si_buffer.c:26:
../src/util/os_memory_stdc.h:41:27: note: referencing an object of size 140 allocated by ‘malloc’
41 | #define os_malloc(_size) malloc(_size)
| ^~~~~~~~~~~~~
../src/util/u_memory.h:46:24: note: in expansion of macro ‘os_malloc’
46 | #define MALLOC(_size) os_malloc(_size)
| ^~~~~~~~~
../src/util/u_memory.h:54:41: note: in expansion of macro ‘MALLOC’
54 | #define MALLOC_STRUCT(T) (struct T *) MALLOC(sizeof(struct T))
| ^~~~~~
../src/gallium/drivers/radeonsi/si_buffer.c:581:10: note: in expansion of macro ‘MALLOC_STRUCT’
581 | buf = MALLOC_STRUCT(si_resource);
| ^~~~~~~~~~~~~
../src/gallium/drivers/radeonsi/si_buffer.c: In function ‘si_aligned_buffer_create’:
../src/gallium/drivers/radeonsi/si_buffer.c:106:43: warning: array subscript ‘struct si_texture[0]’ is partly outside array bounds of ‘unsigned char[140]’ [-Warray-bounds]
106 | if ((res->b.b.target != PIPE_BUFFER && !tex->surface.is_linear) ||
| ^~~~~~~~~~~~~~~~~~~~~~~
In file included from ../src/util/os_memory.h:70,
from ../src/util/u_memory.h:38,
from ../src/gallium/drivers/radeonsi/si_buffer.c:26:
../src/util/os_memory_stdc.h:41:27: note: referencing an object of size 140 allocated by ‘malloc’
41 | #define os_malloc(_size) malloc(_size)
| ^~~~~~~~~~~~~
../src/util/u_memory.h:46:24: note: in expansion of macro ‘os_malloc’
46 | #define MALLOC(_size) os_malloc(_size)
| ^~~~~~~~~
../src/util/u_memory.h:54:41: note: in expansion of macro ‘MALLOC’
54 | #define MALLOC_STRUCT(T) (struct T *) MALLOC(sizeof(struct T))
| ^~~~~~
../src/gallium/drivers/radeonsi/si_buffer.c:581:10: note: in expansion of macro ‘MALLOC_STRUCT’
581 | buf = MALLOC_STRUCT(si_resource);
| ^~~~~~~~~~~~~