[Mesa-dev] [PATCH 7/9] nir: Report progress from nir_lower_system_values().
Chris Wilson
chris at chris-wilson.co.uk
Fri Oct 2 04:49:09 PDT 2015
On Fri, Sep 18, 2015 at 08:37:13AM -0700, Kenneth Graunke wrote:
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Causes
==823== Conditional jump or move depends on uninitialised value(s)
==823== at 0xB09020C: convert_block (nir_lower_system_values.c:68)
==823== by 0xB079FB8: foreach_cf_node (nir.c:1310)
==823== by 0xB07A0AF: nir_foreach_block (nir.c:1336)
==823== by 0xB09026B: convert_impl (nir_lower_system_values.c:79)
==823== by 0xB0902CE: nir_lower_system_values (nir_lower_system_values.c:92)
==823== by 0xB15C174: brw_create_nir (brw_nir.c:155)
==823== by 0xB16E27B: brw_link_shader (brw_shader.cpp:395)
==823== by 0xAF5380E: _mesa_glsl_link_shader (ir_to_mesa.cpp:2983)
==823== by 0xAD04535: create_new_program(gl_context*, state_key*) (ff_fragment_shader.cpp:1268)
==823== by 0xAD04605: _mesa_get_fixed_func_fragment_program (ff_fragment_shader.cpp:1298)
==823== by 0xADF8080: update_program (state.c:157)
==823== by 0xADF89DC: _mesa_update_state_locked (state.c:469)
==823== Uninitialised value was created by a stack allocation
==823== at 0xB090249: convert_impl (nir_lower_system_values.c:76)
==823==
Trivially fixed by
@@ -74,7 +74,7 @@ convert_block(nir_block *block, void *state)
static bool
convert_impl(nir_function_impl *impl)
{
- bool progress;
+ bool progress = false;
nir_foreach_block(impl, convert_block, &progress);
nir_metadata_preserve(impl, nir_metadata_block_index |
Though you may want to also convert
diff --git a/src/glsl/nir/nir_lower_system_values.c b/src/glsl/nir/nir_lower_sys
tem_values.c
index d77bb2f..07371e4 100644
--- a/src/glsl/nir/nir_lower_system_values.c
+++ b/src/glsl/nir/nir_lower_system_values.c
@@ -65,7 +65,7 @@ convert_block(nir_block *block, void *state)
nir_foreach_instr_safe(block, instr) {
if (instr->type == nir_instr_type_intrinsic)
- *progress = convert_instr(nir_instr_as_intrinsic(instr)) || *progress;
+ *progress |= convert_instr(nir_instr_as_intrinsic(instr));
}
return true;
throughout as well.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the mesa-dev
mailing list