ia32: fix overly conservative upper_bits_clean (by avoiding undefined behaviour)
[libfirm] / ir / stat / stat_dmp.c
index 8595944..f405681 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2011 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
@@ -329,7 +329,7 @@ static void add_distrib_entry(const distrib_entry_t *entry, void *env)
 {
        distrib_tbl_t *sum_tbl = (distrib_tbl_t*)env;
 
-       stat_add_int_distrib_tbl(sum_tbl, PTR_TO_INT(entry->object), &entry->cnt);
+       stat_add_int_distrib_tbl(sum_tbl, (int)PTR_TO_INT(entry->object), &entry->cnt);
 }  /* add_distrib_entry */
 
 /**
@@ -471,7 +471,7 @@ static void simple_dump_edges(dumper_t *dmp, counter_t *cnt)
  */
 static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
 {
-       int i, dump_opts = 1;
+       int dump_opts = 1;
        block_entry_t *b_entry;
        extbb_entry_t *eb_entry;
 
@@ -480,6 +480,7 @@ static void simple_dump_graph(dumper_t *dmp, graph_entry_t *entry)
 
        if (entry->irg) {
                ir_graph *const_irg = get_const_code_irg();
+               int       i;
 
                if (entry->irg == const_irg)
                        fprintf(dmp->f, "\nConst code Irg %p", (void *)entry->irg);
@@ -651,7 +652,8 @@ static void dump_tbl_line(const distrib_entry_t *entry, void *env)
 {
        dumper_t *dmp = (dumper_t*)env;
 
-       fprintf(dmp->f, "%d : %u\n", PTR_TO_INT(entry->object), cnt_to_uint(&entry->cnt));
+       fprintf(dmp->f, "%ld : %u\n", (long int)PTR_TO_INT(entry->object),
+               cnt_to_uint(&entry->cnt));
 }  /* dump_tbl_line */
 
 /**