Commit c79fe4ad authored by Matthias Braun's avatar Matthias Braun
Browse files

fix various warnings reported by cparser

[r27300]
parent 975ab11f
......@@ -150,7 +150,8 @@ void bipartite_matching(const bipartite_t *gr, int *matching)
bitset_t *matched_right = bitset_alloca(gr->n_right);
memset(matching, -1, gr->n_left * sizeof(int));
while (apply_alternating_path(gr, matching, matched_left, matched_right));
while (apply_alternating_path(gr, matching, matched_left, matched_right)) {
}
}
void bipartite_dump_f(FILE *f, const bipartite_t *gr)
......
......@@ -35,7 +35,7 @@
*/
#define COMPILETIME_ASSERT(x, name) \
static __attribute__((unused)) void compiletime_assert_##name (int h) { \
switch(h) { case 0: case (x): ; } \
switch(h) { case 0: case (x): {} } \
}
#ifdef __GNUC__
......
......@@ -226,7 +226,8 @@ double gs_matrix_get(const gs_matrix_t *m, int row, int col)
return the_row->diag != 0.0 ? 1.0 / the_row->diag : 0.0;
// Search for correct column
for (c = 0; c < the_row->n_cols && the_row->cols[c].col_idx < col; ++c);
for (c = 0; c < the_row->n_cols && the_row->cols[c].col_idx < col; ++c) {
}
if (c >= the_row->n_cols || the_row->cols[c].col_idx > col)
return 0.0;
......
......@@ -84,7 +84,7 @@
#ifdef DO_REHASH
#define HashSetEntry ValueType
#define EntrySetHash(entry,new_hash)
#define EntrySetHash(entry,new_hash) (void)0
#define EntryGetHash(self,entry) Hash(self, GetKey(entry))
#define EntryGetValue(entry) (entry)
#else /* ! DO_REHASH */
......
......@@ -136,7 +136,7 @@ static inline void stat_chain_len(SET *table, int chain_len)
#else /* !STATS */
# define stat_chain_len(table, chain_len) ((void)0)
# define stat_chain_len(table, chain_len) ((void)chain_len)
# define stat_access(table) ((void)0)
# define stat_dup(table) ((void)0)
......@@ -187,7 +187,8 @@ SET *(PMANGLE(new)) (MANGLEP(cmp_fun) cmp, int nslots)
else {
assert (nslots >= 0);
/* Adjust nslots up to next power of 2, minimum SEGMENT_SIZE */
for (i = SEGMENT_SIZE; i < nslots; i <<= 1);
for (i = SEGMENT_SIZE; i < nslots; i <<= 1) {
}
nslots = i >> SEGMENT_SIZE_SHIFT;
}
......
......@@ -49,7 +49,6 @@
static ir_visited_t master_cg_visited = 0;
static inline int cg_irg_visited (ir_graph *n);
static inline void mark_cg_irg_visited(ir_graph *n);
static inline void set_cg_irg_visited (ir_graph *n, ir_visited_t i);
/** Returns the callgraph state of the program representation. */
irp_callgraph_state get_irp_callgraph_state(void)
......
......@@ -61,7 +61,6 @@ static unsigned *mere_get_backarray(ir_node *n)
case iro_Phi:
assert(n->attr.phi.u.backedge && "backedge array not allocated!");
return n->attr.phi.u.backedge;
break;
case iro_Filter:
#ifdef INTERPROCEDURAL_VIEW
if (get_interprocedural_view()) {
......
......@@ -135,7 +135,7 @@ static void handle_case(ir_node *block, ir_node *irn, long nr, env_t *env)
*/
static void handle_modeb(ir_node *block, ir_node *selector, pn_Cond pnc, env_t *env)
{
ir_node *cond, *old, *cond_block = NULL, *other_blk = NULL, *con = NULL;
ir_node *cond, *old, *other_blk = NULL, *con = NULL;
ir_node *c_b = NULL, *c_o = NULL;
const ir_edge_t *edge, *next;
......@@ -168,7 +168,6 @@ static void handle_modeb(ir_node *block, ir_node *selector, pn_Cond pnc, env_t *
if (other_blk == NULL) {
/* we have already tested, that block has only ONE Cond predecessor */
cond = get_Proj_pred(get_Block_cfgpred(block, 0));
cond_block = get_nodes_block(cond);
foreach_out_edge(cond, edge) {
ir_node *proj = get_edge_src_irn(edge);
if (get_Proj_proj(proj) == (long)pnc)
......
......@@ -128,8 +128,6 @@ static void pick_successor(ir_node *block, ir_extblk *extblk, env_t *env)
basic block, so create a new one here.
*/
if (get_block_n_succs(block) > 2) {
const ir_edge_t *edge;
foreach_block_succ(block, edge) {
ir_node *succ = get_edge_src_irn(edge);
create_extblk(succ, env);
......
......@@ -112,7 +112,8 @@ static inline int is_liveness_node(const ir_node *irn)
case iro_End:
case iro_Anchor:
return 0;
default:;
default:
break;
}
return 1;
......
......@@ -255,7 +255,6 @@ static inline ir_node *pop(void)
static inline void pop_scc_to_loop(ir_node *n)
{
ir_node *m;
int i = 0;
do {
m = pop();
......@@ -264,13 +263,7 @@ static inline void pop_scc_to_loop(ir_node *n)
set_irn_dfn(m, loop_node_cnt);
add_loop_node(current_loop, m);
set_irn_loop(m, current_loop);
++i;
} while (m != n);
/* i might be bigger than 1 for dead (and that's why bad) loops */
/* if (i > 1)
printf("Mehr als eine Iteration!!!!!!!!!!!!!!!!!!!!!!!!!!!!11111\n");
*/
}
/* GL ??? my last son is my grandson??? Removes loops with no
......
......@@ -390,7 +390,6 @@ default_code:
}
panic(" not implemented: %+F", n);
break;
} /* end switch */
return tp;
......
......@@ -592,9 +592,9 @@ static ir_region *new_NaturalLoop(struct obstack *obst, ir_region *head)
/* count number of succs */
n_succ = 0;
for (j = 0; j < len; ++j) {
ir_region *c = reg->parts[j].region;
for (i = get_region_n_succs(c) - 1; i >= 0; --i) {
ir_region *succ = get_region_succ(c, i);
ir_region *pc = reg->parts[j].region;
for (i = get_region_n_succs(pc) - 1; i >= 0; --i) {
ir_region *succ = get_region_succ(pc, i);
if (succ->parent != reg)
++n_succ;
}
......@@ -602,9 +602,9 @@ static ir_region *new_NaturalLoop(struct obstack *obst, ir_region *head)
reg->succ = NEW_ARR_D(ir_region *, obst, n_succ);
k = 0;
for (j = 0; j < len; ++j) {
ir_region *c = reg->parts[j].region;
for (i = get_region_n_succs(c) - 1; i >= 0; --i) {
ir_region *succ = get_region_succ(c, i);
ir_region *pc = reg->parts[j].region;
for (i = get_region_n_succs(pc) - 1; i >= 0; --i) {
ir_region *succ = get_region_succ(pc, i);
if (succ->parent != reg)
reg->succ[k++] = succ;
}
......@@ -843,7 +843,7 @@ static ir_region *acyclic_region_type(struct obstack *obst, ir_region *node)
}
/* check for Switch, case */
if (k > 0) {
ir_region *exit = NULL;
ir_region *rexit = NULL;
nset = NULL; nset_len = 0;
p = 0;
for (i = k - 1; i >= 0; --i) {
......@@ -851,7 +851,7 @@ static ir_region *acyclic_region_type(struct obstack *obst, ir_region *node)
ADD_LIST(nset, n);
if (get_region_n_succs(n) != 1) {
/* must be the exit */
exit = n;
rexit = n;
++p;
if (p > 1)
break;
......@@ -866,22 +866,22 @@ static ir_region *acyclic_region_type(struct obstack *obst, ir_region *node)
for (m = nset; m != NULL; m = m->link) {
if (get_region_n_succs(m) != 1) {
/* must be the exit block */
if (exit == NULL) {
exit = m;
} else if (exit != m) {
if (rexit == NULL) {
rexit = m;
} else if (rexit != m) {
/* two exits */
exit = NULL;
rexit = NULL;
break;
}
} else {
ir_region *succ = get_region_succ(m, 0);
if (succ->link == NULL) {
if (exit == NULL) {
if (rexit == NULL) {
if (succ == pos_exit_1)
exit = succ;
rexit = succ;
else if (succ == pos_exit_2)
exit = succ;
rexit = succ;
else if (pos_exit_1 == NULL)
pos_exit_1 = succ;
else if (pos_exit_2 == NULL)
......@@ -890,24 +890,24 @@ static ir_region *acyclic_region_type(struct obstack *obst, ir_region *node)
/* more than two possible exits */
break;
}
} else if (exit != succ) {
} else if (rexit != succ) {
/* two exits */
exit = NULL;
rexit = NULL;
break;
}
}
}
}
if (exit != NULL) {
if (rexit != NULL) {
/* do the checks */
for (n = nset; n != NULL; n = n->link) {
ir_region *succ;
if (n == exit) {
if (n == rexit) {
/* good, default fall through */
continue;
}
succ = get_region_succ(n, 0);
if (succ == exit) {
if (succ == rexit) {
/* good, switch to exit */
continue;
}
......@@ -922,7 +922,7 @@ static ir_region *acyclic_region_type(struct obstack *obst, ir_region *node)
if (n == NULL) {
/* detected */
return new_SwitchCase(obst, kind, node, exit, nset, nset_len);
return new_SwitchCase(obst, kind, node, rexit, nset, nset_len);
}
}
}
......
......@@ -675,8 +675,9 @@ void free_trouts(void)
ir_node **accs;
for (accs = (ir_node **)pmap_first(entity_access_map);
accs;
accs = (ir_node **)pmap_next(entity_access_map))
; //DEL_ARR_F(accs);
accs = (ir_node **)pmap_next(entity_access_map)) {
/* DEL_ARR_F(accs); */
}
pmap_destroy(entity_access_map);
entity_access_map = NULL;
}
......@@ -685,8 +686,9 @@ void free_trouts(void)
ir_node **refs;
for (refs = (ir_node **)pmap_first(entity_reference_map);
refs;
refs = (ir_node **)pmap_next(entity_reference_map))
; //DEL_ARR_F(refs);
refs = (ir_node **)pmap_next(entity_reference_map)) {
/* DEL_ARR_F(refs); */
}
pmap_destroy(entity_reference_map);
entity_reference_map = NULL;
}
......@@ -695,8 +697,9 @@ void free_trouts(void)
ir_node **alls;
for (alls = (ir_node **)pmap_first(type_alloc_map);
alls;
alls = (ir_node **)pmap_next(type_alloc_map))
; //DEL_ARR_F(alls);
alls = (ir_node **)pmap_next(type_alloc_map)) {
/* DEL_ARR_F(alls); */
}
pmap_destroy(type_alloc_map);
type_alloc_map = NULL;
}
......@@ -705,8 +708,9 @@ void free_trouts(void)
ir_node **casts;
for (casts = (ir_node **)pmap_first(type_cast_map);
casts;
casts = (ir_node **)pmap_next(type_cast_map))
; //DEL_ARR_F(alls);
casts = (ir_node **)pmap_next(type_cast_map)) {
/* DEL_ARR_F(alls); */
}
pmap_destroy(type_cast_map);
type_cast_map = NULL;
}
......@@ -715,8 +719,9 @@ void free_trouts(void)
ir_node **pts;
for (pts = (ir_node **)pmap_first(type_pointertype_map);
pts;
pts = (ir_node **)pmap_next(type_pointertype_map))
; //DEL_ARR_F(pts);
pts = (ir_node **)pmap_next(type_pointertype_map)) {
/* DEL_ARR_F(pts); */
}
pmap_destroy(type_pointertype_map);
type_pointertype_map = NULL;
}
......@@ -725,8 +730,9 @@ void free_trouts(void)
ir_node **pts;
for (pts = (ir_node **)pmap_first(type_arraytype_map);
pts;
pts = (ir_node **)pmap_next(type_arraytype_map))
; //DEL_ARR_F(pts);
pts = (ir_node **)pmap_next(type_arraytype_map)) {
/* DEL_ARR_F(pts); */
}
pmap_destroy(type_arraytype_map);
type_arraytype_map = NULL;
}
......
......@@ -159,10 +159,6 @@ static int vrp_update_node(ir_node *node)
case iro_Or: {
vrp_attr *vrp_left, *vrp_right;
ir_node *left, *right;
left = get_Or_left(node);
right = get_Or_right(node);
vrp_left = get_vrp_attr(get_Or_left(node));
vrp_right = get_vrp_attr(get_Or_right(node));
......
......@@ -153,11 +153,6 @@ static void TEMPLATE_emit_cfop_target(const ir_node *node)
*/
static void emit_Jmp(const ir_node *node)
{
ir_node *block;
/* for now, the code works for scheduled and non-schedules blocks */
block = get_nodes_block(node);
be_emit_cstring("\tjmp ");
TEMPLATE_emit_cfop_target(node);
be_emit_finish_line_gas(node);
......
......@@ -288,7 +288,6 @@ void arm_emit_shifter_operand(const ir_node *node)
case ARM_SHF_RRX:
arm_emit_source_register(node, get_irn_arity(node) - 1);
panic("RRX shifter emitter TODO");
return;
case ARM_SHF_INVALID:
break;
......
......@@ -353,10 +353,6 @@ static ir_node *convert_sng_to_int(ir_node *bl, ir_node *arg)
v = (v << 8) | get_tarval_sub_bits(tv, 1);
v = (v << 8) | get_tarval_sub_bits(tv, 0);
return new_Const_long(mode_Is, v);
} else if (is_Load(skip_Proj(arg))) {
ir_node *load;
load = skip_Proj(arg);
}
panic("Unimplemented convert_sng_to_int() case");
}
......
......@@ -892,7 +892,6 @@ static ir_node *adjust_alloc(be_abi_irg_t *env, ir_node *alloc, ir_node *curr_sp
ir_node *new_alloc;
ir_node *count;
ir_node *size;
ir_node *addr;
ir_node *ins[2];
unsigned stack_alignment;
......@@ -971,7 +970,6 @@ static ir_node *adjust_alloc(be_abi_irg_t *env, ir_node *alloc, ir_node *curr_sp
/* fix projnum of alloca res */
set_Proj_proj(alloc_res, pn_be_AddSP_res);
addr = alloc_res;
curr_sp = new_r_Proj(new_alloc, get_irn_mode(curr_sp), pn_be_AddSP_sp);
return curr_sp;
......@@ -1163,7 +1161,6 @@ static void process_ops_in_block(ir_node *bl, void *data)
break;
default:
panic("invalid call");
break;
}
}
......@@ -1598,7 +1595,7 @@ static void fix_address_of_parameter_access(be_abi_irg_t *env, ent_pos_pair *val
/* ok, change the graph */
ir_node *start_bl = get_irg_start_block(irg);
ir_node *first_bl = get_first_block_succ(start_bl);
ir_node *frame, *imem, *nmem, *store, *mem, *args, *args_bl;
ir_node *frame, *imem, *nmem, *store, *mem, *args;
optimization_state_t state;
unsigned offset;
......@@ -1622,7 +1619,6 @@ static void fix_address_of_parameter_access(be_abi_irg_t *env, ent_pos_pair *val
store = NULL;
mem = imem;
args = get_irg_args(irg);
args_bl = get_nodes_block(args);
for (entry = new_list; entry != NULL; entry = entry->next) {
int i = entry->pos;
ir_type *tp = get_entity_type(entry->ent);
......
......@@ -53,6 +53,7 @@
#include "debug.h"
#include "execfreq.h"
#include "iredges_t.h"
#include "error.h"
#include "bechordal_t.h"
#include "beabi.h"
......@@ -143,10 +144,13 @@ static lc_opt_enum_int_var_t be_ch_vrfy_var = {
&options.vrfy_option, be_ch_vrfy_items
};
static char minir_file[256] = "";
static const lc_opt_table_entry_t be_chordal_options[] = {
LC_OPT_ENT_ENUM_PTR ("perm", "perm lowering options", &lower_perm_var),
LC_OPT_ENT_ENUM_MASK("dump", "select dump phases", &dump_var),
LC_OPT_ENT_ENUM_PTR ("verify", "verify options", &be_ch_vrfy_var),
LC_OPT_ENT_STR ("minirout", "dump MinIR to file", minir_file, sizeof(minir_file)),
LC_OPT_LAST
};
......@@ -336,6 +340,24 @@ static void post_spill(post_spill_env_t *pse, int iteration)
}
be_timer_push(T_RA_COPYMIN);
if (minir_file[0] != '\0') {
extern void be_export_minir(const arch_env_t *arch_env, FILE *out,
ir_graph *irg);
FILE *out;
if (strcmp(minir_file, "-") == 0) {
out = stdout;
} else {
out = fopen(minir_file, "w");
if (out == NULL) {
panic("Cound't open minir output '%s'", minir_file);
}
}
be_export_minir(chordal_env->birg->main_env->arch_env, out, irg);
if (out != stdout)
fclose(out);
}
co_driver(chordal_env);
be_timer_pop(T_RA_COPYMIN);
......
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