compiler: avoid 'unused variable' warnings
authorAndrii Simiklit <andrii.simiklit@globallogic.com>
Tue, 13 Nov 2018 12:19:29 +0000 (14:19 +0200)
committerEric Engestrom <eric.engestrom@intel.com>
Wed, 14 Nov 2018 13:35:38 +0000 (13:35 +0000)
1. nir/nir_lower_vars_to_ssa.c:691:21: warning:
       unused variable ‘var’
       nir_variable *var = path->path[0]->var;

v2: Changes for some part of 'may be used uninitialized'
    warnings were removed, seems like it is a compiler issue.
        ( Eric Engestrom <eric.engestrom@intel.com> )
    Possible like this one:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46684
    This issue is flagged as duplicate but an
    original one is not closed yet.

Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/compiler/nir/nir_lower_vars_to_ssa.c

index 8e517a78957aed2551690ef4a87d1995382f28d4..646efd9ad8978605d0d0701f57d77202be49c61b 100644 (file)
@@ -683,10 +683,9 @@ nir_lower_vars_to_ssa_impl(nir_function_impl *impl)
       nir_deref_path *path = &node->path;
 
       assert(path->path[0]->deref_type == nir_deref_type_var);
-      nir_variable *var = path->path[0]->var;
 
       /* We don't build deref nodes for non-local variables */
-      assert(var->data.mode == nir_var_local);
+      assert(path->path[0]->var->data.mode == nir_var_local);
 
       if (path_may_be_aliased(path, &state)) {
          exec_node_remove(&node->direct_derefs_link);