Revert "Replace (f)printf with g_print(err) in method-to-ir.c, mini-arm.c, mini.c"
authorAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 16 May 2013 21:59:09 +0000 (23:59 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Thu, 16 May 2013 21:59:09 +0000 (23:59 +0200)
This reverts commit 26ffc615bf26f18e8dd9dc34889b219cdf3585ec.

mono/mini/method-to-ir.c
mono/mini/mini-arm.c
mono/mini/mini.c

index f0401eea492d5fd0dd791eb426c60364f91ed6da..51b5e52937d2184c2c2cc76757257756d05190ad 100644 (file)
@@ -74,7 +74,7 @@
 #define INLINE_FAILURE(msg) do {                                                                       \
        if ((cfg->method != method) && (method->wrapper_type == MONO_WRAPPER_NONE)) { \
                if (cfg->verbose_level >= 2)                                                                    \
-                       g_print ("inline failed: %s\n", msg);                                           \
+                       printf ("inline failed: %s\n", msg);                                            \
                goto inline_failure;                                                                                    \
        } \
        } while (0)
 #define GENERIC_SHARING_FAILURE(opcode) do {           \
                if (cfg->generic_sharing_context) {     \
             if (cfg->verbose_level > 2) \
-                           g_print ("sharing failed for method %s.%s.%s/%d opcode %s line %d\n", method->klass->name_space, method->klass->name, method->name, method->signature->param_count, mono_opcode_name ((opcode)), __LINE__); \
+                           printf ("sharing failed for method %s.%s.%s/%d opcode %s line %d\n", method->klass->name_space, method->klass->name, method->name, method->signature->param_count, mono_opcode_name ((opcode)), __LINE__); \
                        mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED); \
                        goto exception_exit;    \
                }                       \
        if (cfg->gsharedvt) {                                                                                           \
                cfg->exception_message = g_strdup_printf ("gsharedvt failed for method %s.%s.%s/%d opcode %s %s:%d", method->klass->name_space, method->klass->name, method->name, method->signature->param_count, mono_opcode_name ((opcode)), __FILE__, __LINE__); \
                if (cfg->verbose_level >= 2)                                                                    \
-                       g_print ("%s\n", cfg->exception_message); \
+                       printf ("%s\n", cfg->exception_message); \
                mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED); \
                goto exception_exit;                                                                                    \
        }                                                                                                                                       \
@@ -331,13 +331,13 @@ mono_print_bb (MonoBasicBlock *bb, const char *msg)
        int i;
        MonoInst *tree;
 
-       g_print ("\n%s %d: [IN: ", msg, bb->block_num);
+       printf ("\n%s %d: [IN: ", msg, bb->block_num);
        for (i = 0; i < bb->in_count; ++i)
-               g_print (" BB%d(%d)", bb->in_bb [i]->block_num, bb->in_bb [i]->dfn);
-       g_print (", OUT: ");
+               printf (" BB%d(%d)", bb->in_bb [i]->block_num, bb->in_bb [i]->dfn);
+       printf (", OUT: ");
        for (i = 0; i < bb->out_count; ++i)
-               g_print (" BB%d(%d)", bb->out_bb [i]->block_num, bb->out_bb [i]->dfn);
-       g_print (" ]\n");
+               printf (" BB%d(%d)", bb->out_bb [i]->block_num, bb->out_bb [i]->dfn);
+       printf (" ]\n");
        for (tree = bb->code; tree; tree = tree->next)
                mono_print_ins_index (-1, tree);
 }
@@ -361,7 +361,7 @@ mono_create_helper_signatures (void)
 #define UNVERIFIED do { \
        if (cfg->gsharedvt) { \
                if (cfg->verbose_level > 2)                                                                     \
-                       g_print ("gsharedvt method failed to verify, falling back to instantiation.\n"); \
+                       printf ("gsharedvt method failed to verify, falling back to instantiation.\n"); \
                mono_cfg_set_exception (cfg, MONO_EXCEPTION_GENERIC_SHARING_FAILED); \
                goto exception_exit;                                                                                    \
        }                                                                                                                                       \
@@ -483,14 +483,14 @@ link_bblock (MonoCompile *cfg, MonoBasicBlock *from, MonoBasicBlock* to)
 #if 0
        if (from->cil_code) {
                if (to->cil_code)
-                       g_print ("edge from IL%04x to IL_%04x\n", from->cil_code - cfg->cil_code, to->cil_code - cfg->cil_code);
+                       printf ("edge from IL%04x to IL_%04x\n", from->cil_code - cfg->cil_code, to->cil_code - cfg->cil_code);
                else
-                       g_print ("edge from IL%04x to exit\n", from->cil_code - cfg->cil_code);
+                       printf ("edge from IL%04x to exit\n", from->cil_code - cfg->cil_code);
        } else {
                if (to->cil_code)
-                       g_print ("edge from entry to IL_%04x\n", to->cil_code - cfg->cil_code);
+                       printf ("edge from entry to IL_%04x\n", to->cil_code - cfg->cil_code);
                else
-                       g_print ("edge from entry to exit\n");
+                       printf ("edge from entry to exit\n");
        }
 #endif
 
@@ -1338,24 +1338,24 @@ handle_stack_args (MonoCompile *cfg, MonoInst **sp, int count)
        if (!count)
                return;
        if (cfg->verbose_level > 3)
-               g_print ("%d item(s) on exit from B%d\n", count, bb->block_num);
+               printf ("%d item(s) on exit from B%d\n", count, bb->block_num);
        if (!bb->out_scount) {
                bb->out_scount = count;
-               //g_print ("bblock %d has out:", bb->block_num);
+               //printf ("bblock %d has out:", bb->block_num);
                found = FALSE;
                for (i = 0; i < bb->out_count; ++i) {
                        outb = bb->out_bb [i];
                        /* exception handlers are linked, but they should not be considered for stack args */
                        if (outb->flags & BB_EXCEPTION_HANDLER)
                                continue;
-                       //g_print (" %d", outb->block_num);
+                       //printf (" %d", outb->block_num);
                        if (outb->in_stack) {
                                found = TRUE;
                                bb->out_stack = outb->in_stack;
                                break;
                        }
                }
-               //g_print ("\n");
+               //printf ("\n");
                if (!found) {
                        bb->out_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * count);
                        for (i = 0; i < count; ++i) {
@@ -1402,7 +1402,7 @@ handle_stack_args (MonoCompile *cfg, MonoInst **sp, int count)
                inst->cil_code = sp [i]->cil_code;
                sp [i] = locals [i];
                if (cfg->verbose_level > 3)
-                       g_print ("storing %d to temp %d\n", i, (int)locals [i]->inst_c0);
+                       printf ("storing %d to temp %d\n", i, (int)locals [i]->inst_c0);
        }
 
        /*
@@ -1429,7 +1429,7 @@ handle_stack_args (MonoCompile *cfg, MonoInst **sp, int count)
                                        inst->cil_code = sp [i]->cil_code;
                                        sp [i] = locals [i];
                                        if (cfg->verbose_level > 3)
-                                               g_print ("storing %d to temp %d\n", i, (int)outb->in_stack [i]->inst_c0);
+                                               printf ("storing %d to temp %d\n", i, (int)outb->in_stack [i]->inst_c0);
                                }
                                locals = outb->in_stack;
                                found = TRUE;
@@ -3195,7 +3195,7 @@ save_cast_details (MonoCompile *cfg, MonoClass *klass, int obj_reg)
                MonoInst *tls_get = mono_get_jit_tls_intrinsic (cfg);
 
                if (!tls_get) {
-                       g_printerr ("error: --debug=casts not supported on this platform.\n.");
+                       fprintf (stderr, "error: --debug=casts not supported on this platform.\n.");
                        exit (1);
                }
 
@@ -5322,7 +5322,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
 #endif
 
        if (cfg->verbose_level > 2)
-               g_print ("INLINE START %p %s -> %s\n", cmethod,  mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
+               printf ("INLINE START %p %s -> %s\n", cmethod,  mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
 
        if (!cmethod->inline_info) {
                cfg->stat_inlineable_methods++;
@@ -5408,7 +5408,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
 
        if ((costs >= 0 && costs < 60) || inline_always) {
                if (cfg->verbose_level > 2)
-                       g_print ("INLINE END %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
+                       printf ("INLINE END %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
                
                cfg->stat_inlined_methods++;
 
@@ -5473,7 +5473,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig,
                return costs + 1;
        } else {
                if (cfg->verbose_level > 2)
-                       g_print ("INLINE ABORTED %s (cost %d)\n", mono_method_full_name (cmethod, TRUE), costs);
+                       printf ("INLINE ABORTED %s (cost %d)\n", mono_method_full_name (cmethod, TRUE), costs);
                cfg->exception_type = MONO_EXCEPTION_NONE;
                mono_loader_clear_error ();
 
@@ -6301,7 +6301,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
        cfg->current_method = method;
 
        if (cfg->verbose_level > 2)
-               g_print ("method to IR %s\n", mono_method_full_name (method, TRUE));
+               printf ("method to IR %s\n", mono_method_full_name (method, TRUE));
 
        param_types = mono_mempool_alloc (cfg->mempool, sizeof (MonoType*) * num_args);
        if (sig->hasthis)
@@ -6376,9 +6376,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        }
 
 
-                       /*g_print ("clause try IL_%04x to IL_%04x handler %d at IL_%04x to IL_%04x\n", clause->try_offset, clause->try_offset + clause->try_len, clause->flags, clause->handler_offset, clause->handler_offset + clause->handler_len);
+                       /*printf ("clause try IL_%04x to IL_%04x handler %d at IL_%04x to IL_%04x\n", clause->try_offset, clause->try_offset + clause->try_len, clause->flags, clause->handler_offset, clause->handler_offset + clause->handler_len);
                          while (p < end) {
-                         g_print ("%s", mono_disasm_code_one (NULL, method, p, &p));
+                         printf ("%s", mono_disasm_code_one (NULL, method, p, &p));
                          }*/
                        /* catch and filter blocks get the exception object on the stack */
                        if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE ||
@@ -6386,7 +6386,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                MonoInst *dummy_use;
 
                                /* mostly like handle_stack_args (), but just sets the input args */
-                               /* g_print ("handling clause at IL_%04x\n", clause->handler_offset); */
+                               /* printf ("handling clause at IL_%04x\n", clause->handler_offset); */
                                tblock->in_scount = 1;
                                tblock->in_stack = mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*));
                                tblock->in_stack [0] = mono_create_exvar_for_offset (cfg, clause->handler_offset);
@@ -6651,7 +6651,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        start_new_bblock = 0;
                        for (i = 0; i < bblock->in_scount; ++i) {
                                if (cfg->verbose_level > 3)
-                                       g_print ("loading %d from temp %d\n", i, (int)bblock->in_stack [i]->inst_c0);                                           
+                                       printf ("loading %d from temp %d\n", i, (int)bblock->in_stack [i]->inst_c0);                                            
                                EMIT_NEW_TEMPLOAD (cfg, ins, bblock->in_stack [i]->inst_c0);
                                *sp++ = ins;
                        }
@@ -6671,7 +6671,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                cfg->cbb = bblock;
                                for (i = 0; i < bblock->in_scount; ++i) {
                                        if (cfg->verbose_level > 3)
-                                               g_print ("loading %d from temp %d\n", i, (int)bblock->in_stack [i]->inst_c0);                                           
+                                               printf ("loading %d from temp %d\n", i, (int)bblock->in_stack [i]->inst_c0);                                            
                                        EMIT_NEW_TEMPLOAD (cfg, ins, bblock->in_stack [i]->inst_c0);
                                        *sp++ = ins;
                                }
@@ -6690,7 +6690,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                int op_size = mono_opcode_size (ip, end);
                                g_assert (op_size > 0); /*The BB formation pass must catch all bad ops*/
 
-                               if (cfg->verbose_level > 3) g_print ("SKIPPING DEAD OP at %x\n", ip_offset);
+                               if (cfg->verbose_level > 3) printf ("SKIPPING DEAD OP at %x\n", ip_offset);
 
                                if (ip_offset + op_size == bb->end) {
                                        MONO_INST_NEW (cfg, ins, OP_NOP);
@@ -6747,7 +6747,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                }
 
                if (cfg->verbose_level > 3)
-                       g_print ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
+                       printf ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
 
                switch (*ip) {
                case CEE_NOP:
@@ -7155,7 +7155,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                if (constrained_call) {
                                        if (method->wrapper_type != MONO_WRAPPER_NONE) {
                                                if (cfg->verbose_level > 2)
-                                                       g_print ("DM Constrained call to %s\n", mono_type_get_full_name (constrained_call));
+                                                       printf ("DM Constrained call to %s\n", mono_type_get_full_name (constrained_call));
                                                if (!((constrained_call->byval_arg.type == MONO_TYPE_VAR ||
                                                           constrained_call->byval_arg.type == MONO_TYPE_MVAR) &&
                                                          cfg->generic_sharing_context)) {
@@ -7163,7 +7163,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                }
                                        } else {
                                                if (cfg->verbose_level > 2)
-                                                       g_print ("Constrained call to %s\n", mono_type_get_full_name (constrained_call));
+                                                       printf ("Constrained call to %s\n", mono_type_get_full_name (constrained_call));
 
                                                if ((constrained_call->byval_arg.type == MONO_TYPE_VAR || constrained_call->byval_arg.type == MONO_TYPE_MVAR) && cfg->generic_sharing_context) {
                                                        /* 
@@ -7857,7 +7857,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                /* Prevent inlining of methods with tail calls (the call stack would be altered) */
                                INLINE_FAILURE ("tail call");
 
-                               //g_print ("HIT: %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
+                               //printf ("HIT: %s -> %s\n", mono_method_full_name (cfg->method, TRUE), mono_method_full_name (cmethod, TRUE));
 
 #ifdef MONO_ARCH_USE_OP_TAIL_CALL
                                /* Handle tail calls similarly to calls */
@@ -8872,7 +8872,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                        if (mini_field_access_needs_cctor_run (cfg, method, vtable) && !(g_slist_find (class_inits, vtable))) {
                                                mono_emit_abs_call (cfg, MONO_PATCH_INFO_CLASS_INIT, vtable->klass, helper_sig_class_init_trampoline, NULL);
                                                if (cfg->verbose_level > 2)
-                                                       g_print ("class %s.%s needs init call for ctor\n", cmethod->klass->name_space, cmethod->klass->name);
+                                                       printf ("class %s.%s needs init call for ctor\n", cmethod->klass->name_space, cmethod->klass->name);
                                                class_inits = g_slist_prepend (class_inits, vtable);
                                        }
 
@@ -9258,8 +9258,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                ip += 5;
 
                                if (cfg->verbose_level > 3) {
-                                       g_print ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
-                                       g_print ("<box+brtrue opt>\n");
+                                       printf ("converting (in B%d: stack: %d) %s", bblock->block_num, (int)(sp - stack_start), mono_disasm_code_one (NULL, method, ip, NULL));
+                                       printf ("<box+brtrue opt>\n");
                                }
 
                                switch (*ip) {
@@ -9758,7 +9758,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                                                if (!(g_slist_find (class_inits, vtable))) {
                                                        mono_emit_abs_call (cfg, MONO_PATCH_INFO_CLASS_INIT, vtable->klass, helper_sig_class_init_trampoline, NULL);
                                                        if (cfg->verbose_level > 2)
-                                                               g_print ("class %s.%s needs init call for %s\n", klass->name_space, klass->name, mono_field_get_name (field));
+                                                               printf ("class %s.%s needs init call for %s\n", klass->name_space, klass->name, mono_field_get_name (field));
                                                        class_inits = g_slist_prepend (class_inits, vtable);
                                                }
                                        } else {
@@ -9820,7 +9820,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
 
                                        GSHAREDVT_FAILURE (op);
 
-                                       /* g_print ("RO-FIELD %s.%s:%s\n", klass->name_space, klass->name, mono_field_get_name (field));*/
+                                       /* printf ("RO-FIELD %s.%s:%s\n", klass->name_space, klass->name, mono_field_get_name (field));*/
                                        is_const = TRUE;
                                        switch (ro_type) {
                                        case MONO_TYPE_BOOLEAN:
@@ -11504,7 +11504,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
                        if (cfg->spvars)
                                mono_create_spvar_for_region (cfg, bb->region);
                        if (cfg->verbose_level > 2)
-                               g_print ("REGION BB%d IL_%04x ID_%08X\n", bb->block_num, bb->real_offset, bb->region);
+                               printf ("REGION BB%d IL_%04x ID_%08X\n", bb->block_num, bb->real_offset, bb->region);
                }
        }
 
@@ -12056,7 +12056,7 @@ mono_handle_global_vregs (MonoCompile *cfg)
                int block_num = bb->block_num;
 
                if (cfg->verbose_level > 2)
-                       g_print ("\nHANDLE-GLOBAL-VREGS BLOCK %d:\n", bb->block_num);
+                       printf ("\nHANDLE-GLOBAL-VREGS BLOCK %d:\n", bb->block_num);
 
                cfg->cbb = bb;
                for (; ins; ins = ins->next) {
@@ -12106,7 +12106,7 @@ mono_handle_global_vregs (MonoCompile *cfg)
                                                mono_compile_create_var_for_vreg (cfg, &mono_defaults.int64_class->byval_arg, OP_LOCAL, vreg);
 
                                                if (cfg->verbose_level > 2)
-                                                       g_print ("LONG VREG R%d made global.\n", vreg);
+                                                       printf ("LONG VREG R%d made global.\n", vreg);
                                        }
 
                                        /*
@@ -12130,7 +12130,7 @@ mono_handle_global_vregs (MonoCompile *cfg)
 
                                        if (!get_vreg_to_inst (cfg, vreg)) {
                                                if (G_UNLIKELY (cfg->verbose_level > 2))
-                                                       g_print ("VREG R%d used in BB%d and BB%d made global.\n", vreg, vreg_to_bb [vreg], block_num);
+                                                       printf ("VREG R%d used in BB%d and BB%d made global.\n", vreg, vreg_to_bb [vreg], block_num);
 
                                                switch (regtype) {
                                                case 'i':
@@ -12222,7 +12222,7 @@ mono_handle_global_vregs (MonoCompile *cfg)
 #endif
 
                                if (G_UNLIKELY (cfg->verbose_level > 2))
-                                       g_print ("CONVERTED R%d(%d) TO VREG.\n", var->dreg, vmv->idx);
+                                       printf ("CONVERTED R%d(%d) TO VREG.\n", var->dreg, vmv->idx);
                                var->flags |= MONO_INST_IS_DEAD;
                                cfg->vreg_to_inst [var->dreg] = NULL;
                        }
@@ -12379,7 +12379,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts)
                MonoInst *ins;
 
                if (cfg->verbose_level > 2)
-                       g_print ("\nSPILL BLOCK %d:\n", bb->block_num);
+                       printf ("\nSPILL BLOCK %d:\n", bb->block_num);
 
                /* Clear vreg_to_lvreg array */
                for (i = 0; i < lvregs_len; i++)
@@ -12459,11 +12459,11 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts)
                        no_lvreg = FALSE;
 
                        if (G_UNLIKELY (cfg->verbose_level > 2)) {
-                               g_print ("\t %.3s %d", spec, ins->dreg);
+                               printf ("\t %.3s %d", spec, ins->dreg);
                                num_sregs = mono_inst_get_src_registers (ins, sregs);
                                for (srcindex = 0; srcindex < num_sregs; ++srcindex)
-                                       g_print (" %d", sregs [srcindex]);
-                               g_print ("\n");
+                                       printf (" %d", sregs [srcindex]);
+                               printf ("\n");
                        }
 
                        /***************/
@@ -12564,7 +12564,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts)
                                                        ins->inst_offset = var->inst_offset;
                                                        spec = INS_INFO (ins->opcode);
                                                } else {
-                                                       /* g_print ("INS: "); mono_print_ins (ins); */
+                                                       /* printf ("INS: "); mono_print_ins (ins); */
                                                        /* Create a store instruction */
                                                        NEW_STORE_MEMBASE (cfg, store_ins, store_opcode, var->inst_basereg, var->inst_offset, ins->dreg);
 
@@ -12642,7 +12642,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts)
 
                                                /* The variable is already loaded to an lvreg */
                                                if (G_UNLIKELY (cfg->verbose_level > 2))
-                                                       g_print ("\t\tUse lvreg R%d for R%d.\n", vreg_to_lvreg [sreg], sreg);
+                                                       printf ("\t\tUse lvreg R%d for R%d.\n", vreg_to_lvreg [sreg], sreg);
                                                sregs [srcindex] = vreg_to_lvreg [sreg];
                                                //mono_inst_set_src_registers (ins, sregs);
                                                continue;
@@ -12664,7 +12664,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts)
                                                        ins->opcode = OP_NOP;
                                                        sreg = ins->dreg;
                                                } else {
-                                                       //g_print ("%d ", srcindex); mono_print_ins (ins);
+                                                       //printf ("%d ", srcindex); mono_print_ins (ins);
 
                                                        sreg = alloc_dreg (cfg, stacktypes [regtype]);
 
index d1af3039234ac35deb96a73ccd4c851a959ee50f..c52a814945f51a3792ae763c781a34ffabb6d5e7 100644 (file)
@@ -862,7 +862,7 @@ mono_arch_cpu_optimizations (guint32 *exclude_mask)
                        }
                }
                fclose (file);
-               /*g_print ("features: v5: %d, thumb: %d\n", v5_supported, thumb_supported);*/
+               /*printf ("features: v5: %d, thumb: %d\n", v5_supported, thumb_supported);*/
        }
 #endif
        }
@@ -1210,7 +1210,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign
                        add_general (&gr, &stack_size, &cinfo->ret, TRUE);
        }
 
-       DEBUG(g_print("params: %d\n", sig->param_count));
+       DEBUG(printf("params: %d\n", sig->param_count));
        for (i = pstart; i < sig->param_count; ++i) {
                if ((sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) {
                        /* Prevent implicit arguments and sig_cookie from
@@ -1219,9 +1219,9 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign
                        /* Emit the signature cookie just before the implicit arguments */
                        add_general (&gr, &stack_size, &cinfo->sig_cookie, TRUE);
                }
-               DEBUG(g_print("param %d: ", i));
+               DEBUG(printf("param %d: ", i));
                if (sig->params [i]->byref) {
-                        DEBUG(g_print("byref\n"));
+                        DEBUG(printf("byref\n"));
                        add_general (&gr, &stack_size, cinfo->args + n, TRUE);
                        n++;
                        continue;
@@ -1287,7 +1287,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign
                                else
                                        size = mini_type_stack_size_full (gsctx, simpletype, &align, FALSE);
                        }
-                       DEBUG(g_print ("load %d bytes struct\n", size));
+                       DEBUG(printf ("load %d bytes struct\n", size));
                        align_size = size;
                        nwords = 0;
                        align_size += (sizeof (gpointer) - 1);
@@ -1395,7 +1395,7 @@ get_call_info (MonoGenericSharingContext *gsctx, MonoMemPool *mp, MonoMethodSign
        }
 
        /* align stack size to 8 */
-       DEBUG (g_print ("      stack size: %d (%d)\n", (stack_size + 15) & ~15, stack_size));
+       DEBUG (printf ("      stack size: %d (%d)\n", (stack_size + 15) & ~15, stack_size));
        stack_size = (stack_size + 7) & ~7;
 
        cinfo->stack_usage = stack_size;
@@ -1575,7 +1575,7 @@ mono_arch_allocate_vars (MonoCompile *cfg)
                ins->opcode = OP_REGOFFSET;
                ins->inst_basereg = cfg->frame_reg;
                if (G_UNLIKELY (cfg->verbose_level > 1)) {
-                       g_print ("vret_addr =");
+                       printf ("vret_addr =");
                        mono_print_ins (cfg->vret_addr);
                }
                offset += sizeof(gpointer);
@@ -1762,7 +1762,7 @@ mono_arch_create_vars (MonoCompile *cfg)
        if (cinfo->vtype_retaddr) {
                cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_ARG);
                if (G_UNLIKELY (cfg->verbose_level > 1)) {
-                       g_print ("vret_addr = ");
+                       printf ("vret_addr = ");
                        mono_print_ins (cfg->vret_addr);
                }
        }
@@ -2682,7 +2682,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb)
                                        MONO_DELETE_INS (bb, ins);
                                        continue;
                                } else {
-                                       //static int c = 0; g_print ("MATCHX %s %d\n", cfg->method->name,c++);
+                                       //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
                                        ins->opcode = OP_MOVE;
                                        ins->sreg1 = last_ins->sreg1;
                                }
@@ -2723,7 +2723,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb)
                                                || last_ins->opcode == OP_STORE_MEMBASE_IMM) &&
                                   ins->inst_basereg == last_ins->inst_destbasereg &&
                                   ins->inst_offset == last_ins->inst_offset) {
-                               //static int c = 0; g_print ("MATCHX %s %d\n", cfg->method->name,c++);
+                               //static int c = 0; printf ("MATCHX %s %d\n", cfg->method->name,c++);
                                ins->opcode = OP_ICONST;
                                ins->inst_c0 = last_ins->inst_imm;
                                g_assert_not_reached (); // check this rule
@@ -5974,10 +5974,10 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI
        start = code;
 
 #if DEBUG_IMT
-       g_print ("building IMT thunk for class %s %s entries %d code size %d code at %p end %p vtable %p\n", vtable->klass->name_space, vtable->klass->name, count, size, start, ((guint8*)start) + size, vtable);
+       printf ("building IMT thunk for class %s %s entries %d code size %d code at %p end %p vtable %p\n", vtable->klass->name_space, vtable->klass->name, count, size, start, ((guint8*)start) + size, vtable);
        for (i = 0; i < count; ++i) {
                MonoIMTCheckItem *item = imt_entries [i];
-               g_print ("method %d (%p) %s vtable slot %p is_equals %d chunk size %d\n", i, item->key, item->key->name, &vtable->vtable [item->value.vtable_slot], item->is_equals, item->chunk_size);
+               printf ("method %d (%p) %s vtable slot %p is_equals %d chunk size %d\n", i, item->key, item->key->name, &vtable->vtable [item->value.vtable_slot], item->is_equals, item->chunk_size);
        }
 #endif
 
index af152b287227fbc11532c39f06e7e91fb1d624e5..18d16021c6480f77281a34f260a78634819f3469 100644 (file)
@@ -380,7 +380,7 @@ mono_print_method_from_ip (void *ip)
                mono_domain_unlock (domain);
                if (user_data.method) {
                        char *mname = mono_method_full_name (user_data.method, TRUE);
-                       g_print ("IP %p is a JIT trampoline for %s\n", ip, mname);
+                       printf ("IP %p is a JIT trampoline for %s\n", ip, mname);
                        g_free (mname);
                }
                else
@@ -1088,7 +1088,7 @@ mono_op_imm_to_op (int opcode)
        case OP_LOCALLOC_IMM:
                return OP_LOCALLOC;
        default:
-               g_print ("%s\n", mono_inst_name (opcode));
+               printf ("%s\n", mono_inst_name (opcode));
                g_assert_not_reached ();
                return -1;
        }
@@ -1220,7 +1220,7 @@ mono_compile_create_var_for_vreg (MonoCompile *cfg, MonoType *type, int opcode,
                 */
 
                if (cfg->verbose_level >= 4) {
-                       g_print ("  Create LVAR R%d (R%d, R%d)\n", inst->dreg, inst->dreg + 1, inst->dreg + 2);
+                       printf ("  Create LVAR R%d (R%d, R%d)\n", inst->dreg, inst->dreg + 1, inst->dreg + 2);
                }
 
 #ifdef MONO_ARCH_SOFT_FLOAT
@@ -1727,7 +1727,7 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_
        int nvtypes;
        gboolean reuse_slot;
 
-       LSCAN_DEBUG (g_print ("Allocate Stack Slots 2 for %s:\n", mono_method_full_name (cfg->method, TRUE)));
+       LSCAN_DEBUG (printf ("Allocate Stack Slots 2 for %s:\n", mono_method_full_name (cfg->method, TRUE)));
 
        scalar_stack_slots = mono_mempool_alloc0 (cfg->mempool, sizeof (StackSlotInfo) * MONO_TYPE_PINNED);
        vtype_stack_slots = NULL;
@@ -1852,7 +1852,7 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_
                        int pos;
                        gboolean changed;
 
-                       //g_print ("START  %2d %08x %08x\n",  vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos);
+                       //printf ("START  %2d %08x %08x\n",  vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos);
 
                        if (!current->interval->range) {
                                if (inst->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT))
@@ -1866,10 +1866,10 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_
                        else
                                pos = current->interval->range->from;
 
-                       LSCAN_DEBUG (g_print ("process R%d ", inst->dreg));
+                       LSCAN_DEBUG (printf ("process R%d ", inst->dreg));
                        if (current->interval->range)
                                LSCAN_DEBUG (mono_linterval_print (current->interval));
-                       LSCAN_DEBUG (g_print ("\n"));
+                       LSCAN_DEBUG (printf ("\n"));
 
                        /* Check for intervals in active which expired or inactive */
                        changed = TRUE;
@@ -1882,14 +1882,14 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_
                                        if (v->interval->last_range->to < pos) {
                                                slot_info->active = g_list_delete_link (slot_info->active, l);
                                                slot_info->slots = g_slist_prepend_mempool (cfg->mempool, slot_info->slots, GINT_TO_POINTER (offsets [v->idx]));
-                                               LSCAN_DEBUG (g_print ("Interval R%d has expired, adding 0x%x to slots\n", cfg->varinfo [v->idx]->dreg, offsets [v->idx]));
+                                               LSCAN_DEBUG (printf ("Interval R%d has expired, adding 0x%x to slots\n", cfg->varinfo [v->idx]->dreg, offsets [v->idx]));
                                                changed = TRUE;
                                                break;
                                        }
                                        else if (!mono_linterval_covers (v->interval, pos)) {
                                                slot_info->inactive = g_list_append (slot_info->inactive, v);
                                                slot_info->active = g_list_delete_link (slot_info->active, l);
-                                               LSCAN_DEBUG (g_print ("Interval R%d became inactive\n", cfg->varinfo [v->idx]->dreg));
+                                               LSCAN_DEBUG (printf ("Interval R%d became inactive\n", cfg->varinfo [v->idx]->dreg));
                                                changed = TRUE;
                                                break;
                                        }
@@ -1908,14 +1908,14 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_
                                                slot_info->inactive = g_list_delete_link (slot_info->inactive, l);
                                                // FIXME: Enabling this seems to cause impossible to debug crashes
                                                //slot_info->slots = g_slist_prepend_mempool (cfg->mempool, slot_info->slots, GINT_TO_POINTER (offsets [v->idx]));
-                                               LSCAN_DEBUG (g_print ("Interval R%d has expired, adding 0x%x to slots\n", cfg->varinfo [v->idx]->dreg, offsets [v->idx]));
+                                               LSCAN_DEBUG (printf ("Interval R%d has expired, adding 0x%x to slots\n", cfg->varinfo [v->idx]->dreg, offsets [v->idx]));
                                                changed = TRUE;
                                                break;
                                        }
                                        else if (mono_linterval_covers (v->interval, pos)) {
                                                slot_info->active = g_list_append (slot_info->active, v);
                                                slot_info->inactive = g_list_delete_link (slot_info->inactive, l);
-                                               LSCAN_DEBUG (g_print ("\tInterval R%d became active\n", cfg->varinfo [v->idx]->dreg));
+                                               LSCAN_DEBUG (printf ("\tInterval R%d became active\n", cfg->varinfo [v->idx]->dreg));
                                                changed = TRUE;
                                                break;
                                        }
@@ -1949,7 +1949,7 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_
                        count ++;
 
                        if (count == atoi (getenv ("COUNT3")))
-                               g_print ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
+                               printf ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
                        if (count > atoi (getenv ("COUNT3")))
                                slot = 0xffffff;
                        else {
@@ -1958,7 +1958,7 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_
                }
 #endif
 
-               LSCAN_DEBUG (g_print ("R%d %s -> 0x%x\n", inst->dreg, mono_type_full_name (t), slot));
+               LSCAN_DEBUG (printf ("R%d %s -> 0x%x\n", inst->dreg, mono_type_full_name (t), slot));
 
                if (inst->flags & MONO_INST_LMF) {
                        size = sizeof (MonoLMF);
@@ -2155,7 +2155,7 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s
 
                slot = 0xffffff;
                if (cfg->comp_done & MONO_COMP_LIVENESS) {
-                       //g_print ("START  %2d %08x %08x\n",  vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos);
+                       //printf ("START  %2d %08x %08x\n",  vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos);
                        
                        /* expire old intervals in active */
                        while (slot_info->active) {
@@ -2164,7 +2164,7 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s
                                if (amv->range.last_use.abs_pos > vmv->range.first_use.abs_pos)
                                        break;
 
-                               //g_print ("EXPIR  %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos, amv->range.last_use.abs_pos, amv->spill_costs, amv->reg);
+                               //printf ("EXPIR  %2d %08x %08x C%d R%d\n", amv->idx, amv->range.first_use.abs_pos, amv->range.last_use.abs_pos, amv->spill_costs, amv->reg);
 
                                slot_info->active = g_list_delete_link (slot_info->active, slot_info->active);
                                slot_info->slots = g_slist_prepend_mempool (cfg->mempool, slot_info->slots, GINT_TO_POINTER (offsets [amv->idx]));
@@ -2195,7 +2195,7 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s
 
                        /*
                        if (count == atoi (getenv ("COUNT")))
-                               g_print ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
+                               printf ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
                        if (count > atoi (getenv ("COUNT")))
                                slot = 0xffffff;
                        else {
@@ -3020,8 +3020,8 @@ mono_patch_info_hash (gconstpointer data)
        case MONO_PATCH_INFO_SWITCH:
                return (ji->type << 8) | ji->data.table->table_size;
        default:
-               g_print ("info type: %d\n", ji->type);
-               mono_print_ji (ji); g_print ("\n");
+               printf ("info type: %d\n", ji->type);
+               mono_print_ji (ji); printf ("\n");
                g_assert_not_reached ();
                return 0;
        }
@@ -3472,17 +3472,17 @@ mono_compile_create_vars (MonoCompile *cfg)
 
        if (cfg->verbose_level > 2) {
                if (cfg->ret) {
-                       g_print ("\treturn : ");
+                       printf ("\treturn : ");
                        mono_print_ins (cfg->ret);
                }
 
                if (sig->hasthis) {
-                       g_print ("\tthis: ");
+                       printf ("\tthis: ");
                        mono_print_ins (cfg->args [0]);
                }
 
                for (i = 0; i < sig->param_count; ++i) {
-                       g_print ("\targ [%d]: ", i);
+                       printf ("\targ [%d]: ", i);
                        mono_print_ins (cfg->args [i + sig->hasthis]);
                }
        }
@@ -3527,7 +3527,7 @@ mono_postprocess_patches (MonoCompile *cfg)
                         * absolute address.
                         */
                        if (info) {
-                               //g_print ("TEST %s %p\n", info->name, patch_info->data.target);
+                               //printf ("TEST %s %p\n", info->name, patch_info->data.target);
                                /* for these array methods we currently register the same function pointer
                                 * since it's a vararg function. But this means that mono_find_jit_icall_by_addr ()
                                 * will return the incorrect one depending on the order they are registered.
@@ -3714,7 +3714,7 @@ mono_save_seq_point_info (MonoCompile *cfg)
        }
 
        if (cfg->verbose_level > 2) {
-               g_print ("\nSEQ POINT MAP: \n");
+               printf ("\nSEQ POINT MAP: \n");
        }
 
        for (i = 0; i < cfg->seq_points->len; ++i) {
@@ -3726,12 +3726,12 @@ mono_save_seq_point_info (MonoCompile *cfg)
                sp->next = g_new (int, sp->next_len);
                j = 0;
                if (cfg->verbose_level > 2 && next [i]) {
-                       g_print ("\tIL0x%x ->", sp->il_offset);
+                       printf ("\tIL0x%x ->", sp->il_offset);
                        for (l = next [i]; l; l = l->next) {
                                next_index = GPOINTER_TO_UINT (l->data);
-                               g_print (" IL0x%x", info->seq_points [next_index].il_offset);
+                               printf (" IL0x%x", info->seq_points [next_index].il_offset);
                        }
-                       g_print ("\n");
+                       printf ("\n");
                }
                for (l = next [i]; l; l = l->next) {
                        next_index = GPOINTER_TO_UINT (l->data);
@@ -4066,7 +4066,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile)
                if (num_holes)
                        holes_size = sizeof (MonoTryBlockHoleTableJitInfo) + num_holes * sizeof (MonoTryBlockHoleJitInfo);
                if (G_UNLIKELY (cfg->verbose_level >= 4))
-                       g_print ("Number of try block holes %d\n", num_holes);
+                       printf ("Number of try block holes %d\n", num_holes);
        }
 
        if (mono_security_method_has_declsec (cfg->method_to_register)) {
@@ -4201,7 +4201,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile)
                        hole->length = (guint16)(hole_data->basic_block->native_length - start_bb_offset);
 
                        if (G_UNLIKELY (cfg->verbose_level >= 4))
-                               g_print ("\tTry block hole at eh clause %d offset %x length %x\n", hole->clause, hole->offset, hole->length);
+                               printf ("\tTry block hole at eh clause %d offset %x length %x\n", hole->clause, hole->offset, hole->length);
                }
                g_assert (i == num_holes);
        }
@@ -4278,7 +4278,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile)
                                gpointer hole_end = cfg->native_code + (hole->basic_block->native_offset + hole->basic_block->native_length);
                                if (hole->clause == ec && hole_end == ei->try_end) {
                                        if (G_UNLIKELY (cfg->verbose_level >= 4))
-                                               g_print ("\tShortening try block %d from %x to %x\n", i, (int)((guint8*)ei->try_end - cfg->native_code), hole->start_offset);
+                                               printf ("\tShortening try block %d from %x to %x\n", i, (int)((guint8*)ei->try_end - cfg->native_code), hole->start_offset);
 
                                        ei->try_end = cfg->native_code + hole->start_offset;
                                        break;
@@ -4307,7 +4307,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile)
                        int end = (guint8*)ei->try_end - cfg->native_code;
                        int handler = (guint8*)ei->handler_start - cfg->native_code;
 
-                       g_print ("JitInfo EH clause %d flags %x try %x-%x handler %x\n", i, ei->flags, start, end, handler);
+                       printf ("JitInfo EH clause %d flags %x try %x-%x handler %x\n", i, ei->flags, start, end, handler);
                }
        }
 
@@ -4743,7 +4743,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
                        if (cfg->disable_llvm) {
                                if (cfg->verbose_level >= 1) {
                                        //nm = mono_method_full_name (cfg->method, TRUE);
-                                       g_print ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
+                                       printf ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
                                        //g_free (nm);
                                }
                                mono_destroy_compile (cfg);
@@ -4868,7 +4868,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
                if (getenv ("COUNT2")) {
                        cfg->globalra = TRUE;
                        if (count == atoi (getenv ("COUNT2")))
-                               g_print ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
+                               printf ("LAST: %s\n", mono_method_full_name (cfg->method, TRUE));
                        if (count > atoi (getenv ("COUNT2")))
                                cfg->globalra = FALSE;
                }
@@ -5333,7 +5333,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
                if (cfg->disable_llvm) {
                        if (cfg->verbose_level >= 1) {
                                //nm = mono_method_full_name (cfg->method, TRUE);
-                               g_print ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
+                               printf ("LLVM failed for '%s': %s\n", method->name, cfg->exception_message);
                                //g_free (nm);
                        }
                        mono_destroy_compile (cfg);
@@ -5392,7 +5392,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, gbool
 
 #if 0
        if (cfg->gsharedvt)
-               g_print ("GSHAREDVT: %s\n", mono_method_full_name (cfg->method, TRUE));
+               printf ("GSHAREDVT: %s\n", mono_method_full_name (cfg->method, TRUE));
 #endif
 
        /* collect statistics */
@@ -5776,7 +5776,7 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in
                /* We can't use a domain specific method in another domain */
                if ((target_domain == mono_domain_get ()) || info->domain_neutral) {
                        code = info->code_start;
-//                     g_print("Discarding code for method %s\n", method->name);
+//                     printf("Discarding code for method %s\n", method->name);
                }
        }
        
@@ -6310,7 +6310,7 @@ mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObjec
                        }
                }
 
-               //g_print ("M: %s\n", mono_method_full_name (method, TRUE));
+               //printf ("M: %s\n", mono_method_full_name (method, TRUE));
 
                mono_arch_start_dyn_call (info->dyn_call_info, (gpointer**)args, retval, buf, sizeof (buf));
 
@@ -6589,8 +6589,8 @@ mini_parse_debug_options (void)
                else if (!strcmp (arg, "soft-breakpoints"))
                        debug_options.soft_breakpoints = TRUE;
                else {
-                       g_printerr ("Invalid option for the MONO_DEBUG env variable: %s\n", arg);
-                       g_printerr ("Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'dont-free-domains', 'suspend-on-sigsegv', 'suspend-on-unhandled', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'init-stacks'\n");
+                       fprintf (stderr, "Invalid option for the MONO_DEBUG env variable: %s\n", arg);
+                       fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'dont-free-domains', 'suspend-on-sigsegv', 'suspend-on-unhandled', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'init-stacks'\n");
                        exit (1);
                }
        }
@@ -6851,7 +6851,7 @@ mini_init (const char *filename, const char *runtime_version)
        if (mono_use_llvm) {
                if (!mono_llvm_load (NULL)) {
                        mono_use_llvm = FALSE;
-                       g_printerr ("Mono Warning: llvm support could not be loaded.\n");
+                       fprintf (stderr, "Mono Warning: llvm support could not be loaded.\n");
                }
        }
        if (mono_use_llvm)
@@ -6882,7 +6882,7 @@ mini_init (const char *filename, const char *runtime_version)
 #ifdef MONO_ARCH_HAVE_NOTIFY_PENDING_EXC
        // This is experimental code so provide an env var to switch it off
        if (getenv ("MONO_DISABLE_PENDING_EXCEPTIONS")) {
-               g_print ("MONO_DISABLE_PENDING_EXCEPTIONS env var set.\n");
+               printf ("MONO_DISABLE_PENDING_EXCEPTIONS env var set.\n");
        } else {
                check_for_pending_exc = FALSE;
                mono_threads_install_notify_pending_exc (mono_arch_notify_pending_exc);
@@ -7398,7 +7398,7 @@ mono_precompile_assembly (MonoAssembly *ass, void *user_data)
        g_hash_table_insert (assemblies, ass, ass);
 
        if (mini_verbose > 0)
-               g_print ("PRECOMPILE: %s.\n", mono_image_get_filename (image));
+               printf ("PRECOMPILE: %s.\n", mono_image_get_filename (image));
 
        for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
                method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i + 1), NULL);