Fix double usage of the post-inc/dec's temporary pre-inc/dec copy.
authorEric Anholt <eric@anholt.net>
Wed, 23 Jun 2010 21:57:47 +0000 (14:57 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 23 Jun 2010 22:20:29 +0000 (15:20 -0700)
Fixes CorrectSwizzle3.frag.

ast_to_hir.cpp

index 61e0d01a900a6fb86fba70929e5eb61f14ac7633..c70f0f9de9fdacab0544cbb7377b8d4023ca8584 100644 (file)
@@ -555,21 +555,20 @@ static ir_rvalue *
 get_lvalue_copy(exec_list *instructions, ir_rvalue *lvalue)
 {
    ir_variable *var;
-   ir_rvalue *var_deref;
 
    /* FINISHME: Give unique names to the temporaries. */
-   var = new ir_variable(lvalue->type, "_internal_tmp");
+   var = new ir_variable(lvalue->type, "_post_incdec_tmp");
    var->mode = ir_var_auto;
 
-   var_deref = new ir_dereference_variable(var);
-   instructions->push_tail(new ir_assignment(var_deref, lvalue, NULL));
+   instructions->push_tail(new ir_assignment(new ir_dereference_variable(var),
+                                            lvalue, NULL));
 
    /* Once we've created this temporary, mark it read only so it's no
     * longer considered an lvalue.
     */
    var->read_only = true;
 
-   return var_deref;
+   return new ir_dereference_variable(var);
 }