gallivm: Silence a warning at -Og

../src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c: In function ‘lp_build_sample_image_linear’:
   ../src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c:1412:24: warning: ‘have_corners’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    1412 |          have_corner = LLVMBuildLoad(builder, have_corners, "");

I don't think you can get here and really not have it initialized, but
if you _could_ then it would clearly be wrong to do anything, so do
nothing instead.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8724>
This commit is contained in:
Adam Jackson 2021-01-26 14:20:30 -05:00 committed by Marge Bot
parent 109f9f3910
commit ba4b9cc0c7

View file

@ -1030,7 +1030,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
LLVMValueRef flt_width_vec;
LLVMValueRef flt_height_vec;
LLVMValueRef flt_depth_vec;
LLVMValueRef fall_off[4], have_corners;
LLVMValueRef fall_off[4] = { 0 }, have_corners = NULL;
LLVMValueRef z1 = NULL;
LLVMValueRef z00 = NULL, z01 = NULL, z10 = NULL, z11 = NULL;
LLVMValueRef x00 = NULL, x01 = NULL, x10 = NULL, x11 = NULL;
@ -1400,7 +1400,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
* another branch (with corner condition though edge would work
* as well) here.
*/
if (accurate_cube_corners) {
if (have_corners && accurate_cube_corners) {
LLVMValueRef c00, c01, c10, c11, c00f, c01f, c10f, c11f;
LLVMValueRef have_corner, one_third;
@ -1655,7 +1655,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld,
}
}
if (accurate_cube_corners) {
if (have_corners && accurate_cube_corners) {
LLVMBuildStore(builder, colors0[0], colorss[0]);
LLVMBuildStore(builder, colors0[1], colorss[1]);
LLVMBuildStore(builder, colors0[2], colorss[2]);