Commit dbaf58e5 authored by yb9976's avatar yb9976
Browse files

Fixed warnings in optimize build.

parent 4ce5894d
......@@ -316,9 +316,9 @@ FIRM_API void ir_free_resources(ir_graph *irg, ir_resources_t resources);
/** Returns currently reserved resources. */
FIRM_API ir_resources_t ir_resources_reserved(const ir_graph *irg);
#else
#define ir_reserve_resources(irg,resources) (void)0
#define ir_free_resources(irg,resources) (void)0
#define ir_resources_reserved(irg) 0
#define ir_reserve_resources(irg,resources) ((void)(irg), (void)(resources), (void)0)
#define ir_free_resources(irg,resources) ((void)(irg), (void)(resources), (void)0)
#define ir_resources_reserved(irg) ((void)(irg), 0)
#endif
/**
......
......@@ -18,7 +18,8 @@
#define ARR_F_MAGIC FOURCC('A','R','R','F')
#ifdef NDEBUG
# define ARR_SET_DBGINF(descr, co)
# define ARR_SET_DBGINF(descr, co) \
((void)(descr), (void)(co), (void)0)
#else
# define ARR_SET_DBGINF(descr, co) \
((descr)->magic = (co))
......
......@@ -688,7 +688,8 @@ static ir_graph *find_tail(const ir_graph *n)
{
bool found = false;
ir_graph *m;
size_t i, res_index;
size_t i;
size_t res_index = 0;
/*
if (!icfg && rm_cyclic_phis && remove_cyclic_phis (n)) return NULL;
......
......@@ -576,7 +576,6 @@ static void cfscc(ir_node *n)
void construct_cf_backedges(ir_graph *irg)
{
ir_loop *head_rem;
ir_node *end = get_irg_end(irg);
struct obstack temp;
int i;
......@@ -588,7 +587,10 @@ void construct_cf_backedges(ir_graph *irg)
current_loop = NULL;
new_loop(); /* sets current_loop */
head_rem = current_loop; /* Just for assertion */
#ifndef NDEBUG
ir_loop *head_rem = current_loop; /* Just for assertion */
#endif
inc_irg_visited(irg);
......
......@@ -653,7 +653,6 @@ static void scc(ir_node *n)
void construct_backedges(ir_graph *irg)
{
ir_graph *rem = current_ir_graph;
ir_loop *head_rem;
struct obstack temp;
current_ir_graph = irg;
......@@ -664,7 +663,10 @@ void construct_backedges(ir_graph *irg)
current_loop = NULL;
new_loop(); /* sets current_loop */
head_rem = current_loop; /* Just for assertion */
#ifndef NDEBUG
ir_loop *head_rem = current_loop; /* Just for assertion */
#endif
inc_irg_visited(irg);
......
......@@ -66,8 +66,10 @@ static ir_node *gen_Eor(ir_node *node)
static ir_node *gen_Div(ir_node *node)
{
#ifndef NDEBUG
ir_mode *mode = get_Div_resmode(node);
assert(mode_is_float(mode));
#endif
return transform_binop(node, new_bd_TEMPLATE_fDiv);
}
......
......@@ -192,10 +192,12 @@ const arm_attr_t *get_arm_attr_const(const ir_node *node)
return (const arm_attr_t*)get_irn_generic_attr_const(node);
}
#ifndef NDEBUG
static bool has_symconst_attr(const ir_node *node)
{
return is_arm_SymConst(node) || is_arm_FrameAddr(node) || is_arm_Bl(node);
}
#endif
arm_SymConst_attr_t *get_arm_SymConst_attr(ir_node *node)
{
......
......@@ -988,14 +988,16 @@ static ir_node *gen_Switch(ir_node *node)
ir_node *selector = get_Switch_selector(node);
dbg_info *dbgi = get_irn_dbg_info(node);
ir_node *new_op = be_transform_node(selector);
ir_mode *mode = get_irn_mode(selector);
const ir_switch_table *table = get_Switch_table(node);
unsigned n_outs = get_Switch_n_outs(node);
table = ir_switch_table_duplicate(irg, table);
#ifndef NDEBUG
/* switch with smaller modes not implemented yet */
ir_mode *mode = get_irn_mode(selector);
assert(get_mode_size_bits(mode) == 32);
#endif
return new_bd_arm_SwitchJmp(dbgi, block, new_op, n_outs, table);
}
......
......@@ -99,11 +99,11 @@ void create_borders(ir_node *block, void *env_ptr)
/* If the node is no phi node we can examine the uses. */
if (!is_Phi(irn)) {
be_foreach_use(irn, env->cls, in_req_, op, op_req_,
char msg = '-';
DEBUG_ONLY(char msg = '-';)
if (ir_nodeset_insert(&live, op)) {
border_use(op, step, 1);
msg = 'X';
DEBUG_ONLY(msg = 'X';)
}
DB((dbg, LEVEL_4, "\t\t%c pos: %d, use: %+F\n", msg, i_, op));
......
......@@ -925,6 +925,7 @@ static void process_cloud(co2_cloud_t *cloud)
obstack_free(&cloud->obst, NULL);
}
#ifdef DEBUG_libfirm
static int cloud_costs(co2_cloud_t *cloud)
{
int i, costs = 0;
......@@ -940,6 +941,7 @@ static int cloud_costs(co2_cloud_t *cloud)
return costs / 2;
}
#endif
static void writeback_colors(co2_t *env)
{
......@@ -956,9 +958,9 @@ static void process(co2_t *env)
co2_cloud_t **clouds;
int n_clouds;
int i;
int init_costs = 0;
int all_costs = 0;
int final_costs = 0;
DEBUG_ONLY(int init_costs = 0;)
DEBUG_ONLY(int all_costs = 0;)
DEBUG_ONLY(int final_costs = 0;)
n_clouds = 0;
co_gs_foreach_aff_node(env->co, a) {
......@@ -977,13 +979,13 @@ static void process(co2_t *env)
qsort(clouds, n_clouds, sizeof(clouds[0]), cmp_clouds_gt);
for (i = 0; i < n_clouds; ++i) {
init_costs += cloud_costs(clouds[i]);
DEBUG_ONLY(init_costs += cloud_costs(clouds[i]);)
/* Process the cloud. */
process_cloud(clouds[i]);
all_costs += clouds[i]->costs;
final_costs += cloud_costs(clouds[i]);
DEBUG_ONLY(all_costs += clouds[i]->costs;)
DEBUG_ONLY(final_costs += cloud_costs(clouds[i]);)
}
DB((env->dbg, LEVEL_1, "all costs: %d, init costs: %d, final costs: %d\n", all_costs, init_costs, final_costs));
......
......@@ -51,8 +51,8 @@ static firm_dbg_module_t *dbg = NULL;
#else
#define DBG_AFF_CHUNK(env, level, chunk)
#define DBG_COL_COST(env, level, cost)
#define DBG_AFF_CHUNK(env, level, chunk) ((void)(env), (void)(chunk), (void)0)
#define DBG_COL_COST(env, level, cost) ((void)(env), (void)(cost), (void)0)
#endif
......
......@@ -20,7 +20,9 @@
static code_fragment_t *first_fragment;
static code_fragment_t *last_fragment;
#ifndef NDEBUG
static const unsigned CODE_FRAGMENT_MAGIC = 0x4643414d; /* "CFMA" */
#endif
struct obstack code_fragment_obst;
......
......@@ -696,7 +696,7 @@ static void assign_reg(ir_node const *const block, ir_node *const node, arch_reg
unsigned num = reg_prefs[r].num;
if (!rbitset_is_set(normal_regs, num))
continue;
const arch_register_t *reg = arch_register_for_index(cls, num);
DEBUG_ONLY(const arch_register_t *reg = arch_register_for_index(cls, num);)
DB((dbg, LEVEL_2, " %s(%f)", reg->name, reg_prefs[r].pref));
}
DB((dbg, LEVEL_2, "\n"));
......@@ -1225,7 +1225,8 @@ static void enforce_constraints(ir_nodeset_t *live_nodes, ir_node *node,
hungarian_prepare_cost_matrix(bp, HUNGARIAN_MODE_MAXIMIZE_UTIL);
unsigned *assignment = ALLOCAN(unsigned, n_regs);
int res = hungarian_solve(bp, assignment, NULL, 0);
int res = hungarian_solve(bp, assignment, NULL, 0);
(void)res;
assert(res == 0);
hungarian_free(bp);
......@@ -1446,6 +1447,7 @@ static void assign_phi_registers(ir_node *block)
unsigned *assignment = ALLOCAN(unsigned, n_regs);
int res = hungarian_solve(bp, assignment, NULL, 0);
(void)res;
assert(res == 0);
/* apply results */
......
......@@ -768,6 +768,7 @@ static void process_block(ir_node *block)
{
ir_node *irn;
workset_foreach(ws, irn, iter) {
(void)irn;
DB((dbg, DBG_WSETS, " %+F (%u)\n", irn, workset_get_time(ws, iter)));
}
}
......@@ -810,8 +811,10 @@ static void process_block(ir_node *block)
DB((dbg, DBG_WSETS, "End workset for %+F:\n", block));
{
ir_node *irn;
workset_foreach(ws, irn, iter)
workset_foreach(ws, irn, iter) {
(void)irn;
DB((dbg, DBG_WSETS, " %+F (%u)\n", irn, workset_get_time(ws, iter)));
}
}
}
......
......@@ -94,6 +94,7 @@ static int cmp_affinity(const void *d1, const void *d2)
static spill_t *get_spill(be_fec_env_t *env, ir_node *node)
{
(void)env;
assert(rbitset_is_set(env->spills_set, get_irn_idx(node)));
return (spill_t*)get_irn_link(node);
}
......
......@@ -1758,6 +1758,7 @@ static void ia32_get_call_abi(ir_type *method_type, be_abi_call_t *abi)
/* In case of 64bit returns, we will have two 32bit values */
if (n == 2) {
#ifndef NDEBUG
ir_type *tp = get_method_res_type(method_type, 0);
ir_mode *mode = get_type_mode(tp);
......@@ -1767,6 +1768,7 @@ static void ia32_get_call_abi(ir_type *method_type, be_abi_call_t *abi)
mode = get_type_mode(tp);
assert(!mode_is_float(mode) && "mixed INT, FP results not supported");
#endif
be_abi_call_res_reg(abi, 0, &ia32_registers[REG_EAX], ABI_CONTEXT_BOTH);
be_abi_call_res_reg(abi, 1, &ia32_registers[REG_EDX], ABI_CONTEXT_BOTH);
......
......@@ -18,7 +18,7 @@
#include "pmap.h"
#ifdef NDEBUG
#define SET_IA32_ORIG_NODE(n, o)
#define SET_IA32_ORIG_NODE(n, o) ((void)(n), (void)(o), (void)0)
#else /* ! NDEBUG */
#define SET_IA32_ORIG_NODE(n, o) set_ia32_orig_node(n, o)
#endif /* NDEBUG */
......
......@@ -763,16 +763,16 @@ static void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags,
const arch_register_req_t **in_reqs,
int n_res)
{
ir_graph *irg = get_irn_irg(node);
struct obstack *obst = get_irg_obstack(irg);
ia32_attr_t *attr = get_ia32_attr(node);
backend_info_t *info;
ir_graph *irg = get_irn_irg(node);
struct obstack *obst = get_irg_obstack(irg);
backend_info_t *info;
arch_set_irn_flags(node, flags);
arch_set_irn_register_reqs_in(node, in_reqs);
#ifndef NDEBUG
attr->attr_type |= IA32_ATTR_ia32_attr_t;
ia32_attr_t *attr = get_ia32_attr(node);
attr->attr_type |= IA32_ATTR_ia32_attr_t;
#endif
info = be_get_info(node);
......
......@@ -3748,7 +3748,8 @@ static ir_node *create_I2I_Conv(ir_mode *src_mode, ir_mode *tgt_mode,
ia32_address_mode_t am;
ia32_address_t *addr = &am.addr;
(void) node;
(void)node;
(void)tgt_mode;
assert(get_mode_size_bits(src_mode) < get_mode_size_bits(tgt_mode));
#ifdef DEBUG_libfirm
......
......@@ -1441,6 +1441,8 @@ static int sim_Return(x87_state *state, ir_node *n)
++n_float_res;
}
assert(x87_get_depth(state) == n_float_res);
#else
(void)n;
#endif
/* pop them virtually */
......
Markdown is supported
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