Don't forget to add the declaration of our temporary variable for assigns.
authorEric Anholt <eric@anholt.net>
Thu, 24 Jun 2010 16:06:12 +0000 (09:06 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 24 Jun 2010 20:32:35 +0000 (13:32 -0700)
Otherwise, dead code elimination gets confused since it relies on
seeing decls.

ast_to_hir.cpp

index c70f0f9de9fdacab0544cbb7377b8d4023ca8584..25bbe2f2defa9c1ea143168b9788b43cc98be13a 100644 (file)
@@ -520,6 +520,7 @@ do_assignment(exec_list *instructions, struct _mesa_glsl_parse_state *state,
     * ends up not being used, the temp will get copy-propagated out.
     */
    ir_variable *var = new ir_variable(rhs->type, "assignment_tmp");
+   instructions->push_tail(var);
    instructions->push_tail(new ir_assignment(new ir_dereference_variable(var),
                                             rhs,
                                             NULL));