Commit 6c1a97fd authored by Matthias Braun's avatar Matthias Braun
Browse files

- Several warning fixes

- Fixes for compilation without DEBUG_libfirm
- Fixed for compilation without WITH_LIBCORE (but it's still broken)

[r8432]
parent 288021c1
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "irnode_t.h" #include "irnode_t.h"
#include "irloop.h" #include "irloop.h"
#include "irgwalk.h" #include "irgwalk.h"
#include "irouts.h" #include "iredges.h"
#include "irprintf.h" #include "irprintf.h"
#include "irhooks.h" #include "irhooks.h"
...@@ -174,20 +174,23 @@ solve_lgs(double * A, double * b, size_t size) ...@@ -174,20 +174,23 @@ solve_lgs(double * A, double * b, size_t size)
static double static double
get_cf_probability(ir_node *bb, int pos, double loop_weight) get_cf_probability(ir_node *bb, int pos, double loop_weight)
{ {
double sum = 0.0; double sum = 0.0;
double cur = 0.0; double cur = 0.0;
int i; const ir_node *pred = get_Block_cfgpred_block(bb, pos);
ir_node *pred = get_Block_cfgpred_block(bb, pos); const ir_loop *pred_loop = get_irn_loop(pred);
int pred_depth = get_loop_depth(pred_loop);
cur = get_loop_depth(get_irn_loop(bb)) < get_loop_depth(get_irn_loop(pred)) ? 1.0 : loop_weight; const ir_edge_t *edge;
for(i = get_Block_n_cfg_outs(pred) - 1; i >= 0; --i) { cur = get_loop_depth(get_irn_loop(bb)) < get_loop_depth(get_irn_loop(pred)) ? 1.0 : loop_weight;
ir_node *succ = get_Block_cfg_out(pred, i);
foreach_block_succ(pred, edge) {
sum += get_loop_depth(get_irn_loop(succ)) < get_loop_depth(get_irn_loop(pred)) ? 1.0 : loop_weight; const ir_node *block = get_edge_src_irn(edge);
} const ir_loop *loop = get_irn_loop(block);
int depth = get_loop_depth(loop);
sum += depth < pred_depth ? 1.0 : loop_weight;
}
return cur/sum; return cur/sum;
} }
static void exec_freq_node_info(void *ctx, FILE *f, const ir_node *irn) static void exec_freq_node_info(void *ctx, FILE *f, const ir_node *irn)
...@@ -241,6 +244,7 @@ compute_execfreq(ir_graph * irg, double loop_weight) ...@@ -241,6 +244,7 @@ compute_execfreq(ir_graph * irg, double loop_weight)
freqs = ef->set = new_set(cmp_freq, 32); freqs = ef->set = new_set(cmp_freq, 32);
construct_cf_backedges(irg); construct_cf_backedges(irg);
edges_assure(irg);
wd.idx = 0; wd.idx = 0;
wd.set = freqs; wd.set = freqs;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#ifndef _IREXTBB_T_H_ #ifndef _IREXTBB_T_H_
#define _IREXTBB_T_H_ #define _IREXTBB_T_H_
#include "firm_config.h"
#include "irgraph_t.h" #include "irgraph_t.h"
#include "irextbb.h" #include "irextbb.h"
#include "irtools.h" #include "irtools.h"
......
...@@ -45,14 +45,14 @@ ...@@ -45,14 +45,14 @@
/** Accessing the out datastructures **/ /** Accessing the out datastructures **/
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
#ifdef DEBUG_libfirm
/** Clear the outs of a node */ /** Clear the outs of a node */
static void reset_outs (ir_node *node, void *unused) static void reset_outs (ir_node *node, void *unused)
{ {
node->out = NULL; node->out = NULL;
#ifdef DEBUG_libfirm
node->out_valid = 0; node->out_valid = 0;
#endif /* defined DEBUG_libfirm */
} }
#endif
/* returns the number of successors of the node: */ /* returns the number of successors of the node: */
int get_irn_n_outs (ir_node *node) { int get_irn_n_outs (ir_node *node) {
......
...@@ -391,17 +391,20 @@ static void init_tables (void) ...@@ -391,17 +391,20 @@ static void init_tables (void)
*/ */
void rta_init (int do_verbose) void rta_init (int do_verbose)
{ {
int i, n, n_runs = 0; int n_runs = 0;
int rem_vpi = get_visit_pseudo_irgs(); int rem_vpi = get_visit_pseudo_irgs();
set_visit_pseudo_irgs(1); set_visit_pseudo_irgs(1);
# ifdef DEBUG_libfirm # ifdef DEBUG_libfirm
{
int i, n;
n = get_irp_n_irgs(); n = get_irp_n_irgs();
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
irg_vrfy (get_irp_irg(i)); irg_vrfy (get_irp_irg(i));
} }
tr_vrfy (); tr_vrfy ();
}
# endif /* defined DEBUG_libfirm */ # endif /* defined DEBUG_libfirm */
verbose = do_verbose; verbose = do_verbose;
...@@ -419,10 +422,13 @@ void rta_init (int do_verbose) ...@@ -419,10 +422,13 @@ void rta_init (int do_verbose)
} }
# ifdef DEBUG_libfirm # ifdef DEBUG_libfirm
{
int n, i;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
irg_vrfy (get_irp_irg(i)); irg_vrfy (get_irp_irg(i));
} }
tr_vrfy (); tr_vrfy ();
}
# endif /* defined DEBUG_libfirm */ # endif /* defined DEBUG_libfirm */
set_visit_pseudo_irgs(rem_vpi); set_visit_pseudo_irgs(rem_vpi);
...@@ -555,6 +561,11 @@ void rta_report (void) ...@@ -555,6 +561,11 @@ void rta_report (void)
/* /*
* $Log$ * $Log$
* Revision 1.37 2006/12/11 15:28:48 matze
* - Several warning fixes
* - Fixes for compilation without DEBUG_libfirm
* - Fixed for compilation without WITH_LIBCORE (but it's still broken)
*
* Revision 1.36 2006/06/05 15:58:12 beck * Revision 1.36 2006/06/05 15:58:12 beck
* added support for Thread local storage * added support for Thread local storage
* added more doxygen docu * added more doxygen docu
......
...@@ -129,7 +129,7 @@ init_firm(const firm_parameter_t *param) ...@@ -129,7 +129,7 @@ init_firm(const firm_parameter_t *param)
firm_archops_init(def_params.arch_op_settings); firm_archops_init(def_params.arch_op_settings);
#ifndef NDEBUG #ifdef DEBUG_libfirm
/* integrated debugger extension */ /* integrated debugger extension */
firm_init_debugger(); firm_init_debugger();
#endif #endif
......
...@@ -359,7 +359,7 @@ ir_node *arch_dep_replace_mul_with_shifts(ir_node *irn) ...@@ -359,7 +359,7 @@ ir_node *arch_dep_replace_mul_with_shifts(ir_node *irn)
*/ */
static int tv_ld2(tarval *tv, int bits) static int tv_ld2(tarval *tv, int bits)
{ {
int i, k, num; int i, k = 0, num;
for (num = i = 0; i < bits; ++i) { for (num = i = 0; i < bits; ++i) {
unsigned char v = get_tarval_sub_bits(tv, i); unsigned char v = get_tarval_sub_bits(tv, i);
......
...@@ -271,7 +271,6 @@ static void copy_node(ir_node *n, void *env) { ...@@ -271,7 +271,6 @@ static void copy_node(ir_node *n, void *env) {
ir_node *nn, *block; ir_node *nn, *block;
int new_arity; int new_arity;
ir_op *op = get_irn_op(n); ir_op *op = get_irn_op(n);
int copy_node_nr = env != NULL;
/* The end node looses it's flexible in array. This doesn't matter, /* The end node looses it's flexible in array. This doesn't matter,
as dead node elimination builds End by hand, inlineing doesn't use as dead node elimination builds End by hand, inlineing doesn't use
...@@ -307,10 +306,13 @@ static void copy_node(ir_node *n, void *env) { ...@@ -307,10 +306,13 @@ static void copy_node(ir_node *n, void *env) {
new_backedge_info(nn); new_backedge_info(nn);
#if DEBUG_libfirm #if DEBUG_libfirm
{
int copy_node_nr = env != NULL;
if (copy_node_nr) { if (copy_node_nr) {
/* for easier debugging, we want to copy the node numbers too */ /* for easier debugging, we want to copy the node numbers too */
nn->node_nr = n->node_nr; nn->node_nr = n->node_nr;
} }
}
#endif #endif
set_new_node(n, nn); set_new_node(n, nn);
......
...@@ -513,7 +513,7 @@ static void transform_irg(const lower_params_t *lp, ir_graph *irg) ...@@ -513,7 +513,7 @@ static void transform_irg(const lower_params_t *lp, ir_graph *irg)
{ {
entity *ent = get_irg_entity(irg); entity *ent = get_irg_entity(irg);
ir_type *mtp, *lowered_mtp, *tp, *ft; ir_type *mtp, *lowered_mtp, *tp, *ft;
int i, j, k, n_ress, n_ret_com, n_cr_opt; int i, j, k, n_ress = 0, n_ret_com = 0, n_cr_opt;
ir_node **new_in, *ret, *endbl, *bl, *mem, *copy; ir_node **new_in, *ret, *endbl, *bl, *mem, *copy;
cr_pair *cr_opt; cr_pair *cr_opt;
wlk_env env; wlk_env env;
......
...@@ -679,7 +679,9 @@ static void lower_Mod(ir_node *node, ir_mode *mode, lower_env_t *env) { ...@@ -679,7 +679,9 @@ static void lower_Mod(ir_node *node, ir_mode *mode, lower_env_t *env) {
* Create two intrinsic Calls. * Create two intrinsic Calls.
*/ */
static void lower_DivMod(ir_node *node, ir_mode *mode, lower_env_t *env) { static void lower_DivMod(ir_node *node, ir_mode *mode, lower_env_t *env) {
ir_node *block, *proj, *irn, *mem, *callDiv, *callMod, *resDiv, *resMod; ir_node *block, *proj, *irn, *mem, *callDiv, *callMod;
ir_node *resDiv = NULL;
ir_node *resMod = NULL;
ir_node *in[4]; ir_node *in[4];
ir_mode *opmode; ir_mode *opmode;
dbg_info *dbg; dbg_info *dbg;
......
...@@ -267,6 +267,8 @@ int i_mapper_RuntimeCall(ir_node *node, runtime_rt *rt) { ...@@ -267,6 +267,8 @@ int i_mapper_RuntimeCall(ir_node *node, runtime_rt *rt) {
if (n_res > 0) if (n_res > 0)
res_proj = new_r_Proj(irg, bl, call, mode_T, pn_Call_T_result); res_proj = new_r_Proj(irg, bl, call, mode_T, pn_Call_T_result);
else
res_proj = NULL;
if (n_proj > 0) { if (n_proj > 0) {
n_proj += n_res - 1; n_proj += n_res - 1;
......
...@@ -421,8 +421,6 @@ static unsigned allocate_value_numbers(pset *sels, entity *ent, unsigned vnum, i ...@@ -421,8 +421,6 @@ static unsigned allocate_value_numbers(pset *sels, entity *ent, unsigned vnum, i
if (path) if (path)
SET_VNUM(sel, path->vnum); SET_VNUM(sel, path->vnum);
else { else {
unsigned i;
key->vnum = vnum++; key->vnum = vnum++;
set_insert(pathes, key, PATH_SIZE(key), path_hash(key)); set_insert(pathes, key, PATH_SIZE(key), path_hash(key));
...@@ -437,6 +435,7 @@ static unsigned allocate_value_numbers(pset *sels, entity *ent, unsigned vnum, i ...@@ -437,6 +435,7 @@ static unsigned allocate_value_numbers(pset *sels, entity *ent, unsigned vnum, i
#ifdef DEBUG_libfirm #ifdef DEBUG_libfirm
/* Debug output */ /* Debug output */
if (get_opt_scalar_replacement_verbose() && get_firm_verbosity() > 1) { if (get_opt_scalar_replacement_verbose() && get_firm_verbosity() > 1) {
unsigned i;
printf(" %s", get_entity_name(key->path[0].ent)); printf(" %s", get_entity_name(key->path[0].ent));
for (i = 1; i < key->path_len; ++i) { for (i = 1; i < key->path_len; ++i) {
if (is_entity(key->path[i].ent)) if (is_entity(key->path[i].ent))
......
...@@ -63,8 +63,8 @@ static void do_type_walk(type_or_ent *tore, ...@@ -63,8 +63,8 @@ static void do_type_walk(type_or_ent *tore,
void *env) void *env)
{ {
int i, n_types, n_mem; int i, n_types, n_mem;
entity *ent; entity *ent = NULL;
ir_type *tp; ir_type *tp = NULL;
ir_node *n; ir_node *n;
/* marked? */ /* marked? */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment