]> git.eshelyaron.com Git - emacs.git/commitdiff
better emit_cast
authorAndrea Corallo <andrea_corallo@yahoo.it>
Mon, 24 Jun 2019 10:25:15 +0000 (12:25 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:45 +0000 (11:33 +0100)
src/comp.c

index 38183a64e20a3b58e6e6098a2dbec19d4f6f5c8c..c24017ce68bbdda22d623082f2a68264418d3353 100644 (file)
@@ -443,6 +443,8 @@ emit_comparison_jump (enum gcc_jit_comparison op, /* TODO add basick block as pa
 static gcc_jit_rvalue *
 emit_cast (gcc_jit_type *new_type, gcc_jit_rvalue *obj)
 {
+  static unsigned i;
+
   gcc_jit_field *orig_field =
     type_to_cast_field (gcc_jit_rvalue_get_type (obj));
   gcc_jit_field *dest_field = type_to_cast_field (new_type);
@@ -451,7 +453,7 @@ emit_cast (gcc_jit_type *new_type, gcc_jit_rvalue *obj)
     gcc_jit_function_new_local (comp.func,
                                NULL,
                                comp.cast_union_type,
-                               "union_cast");
+                               format_string ("union_cast_%u", i++));
   gcc_jit_block_add_assignment (comp.block->gcc_bb,
                                NULL,
                                gcc_jit_lvalue_access_field (tmp_u,