diff options
author | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-02-21 21:10:46 +0100 |
---|---|---|
committer | Erick Ochoa <erick.ochoa@theobroma-systems.com> | 2020-04-28 23:35:44 +0200 |
commit | 61724d672b09a60ae16510c8eb7dba188bfb59f9 (patch) | |
tree | 29aaa276210a318250f5f59df68646b9c23028d4 /gcc | |
parent | 2528d39d822792004ca2028a30b8ca5ccadedc36 (diff) |
Fix warnings
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ipa-str-reorg-dead-field-eliminate.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/gcc/ipa-str-reorg-dead-field-eliminate.c b/gcc/ipa-str-reorg-dead-field-eliminate.c index cdf87535738..b1508f09fee 100644 --- a/gcc/ipa-str-reorg-dead-field-eliminate.c +++ b/gcc/ipa-str-reorg-dead-field-eliminate.c @@ -1063,7 +1063,6 @@ collect_pointer_plus (tree lhs, tree rhs1, tree rhs2, static void collect_assign_rhs (gimple *stmt, hash_set<const_tree> &decl_map) { - bool is_stmt_rewritten = false; enum tree_code code = gimple_expr_code (stmt); switch (code) { @@ -1090,7 +1089,6 @@ static void collect_assign (gimple *stmt, hash_set<const_tree> &decl_map) { gcc_assert (stmt); - tree lhs = gimple_assign_lhs (stmt); collect_assign_rhs (stmt, decl_map); } @@ -1179,7 +1177,6 @@ collect_global_declaration (varpool_node *vnode, for (i = 0; vnode->iterate_referring (i, ref); i++) { symtab_node *f_node = ref->referring; - cgraph_node *f_cnode = dyn_cast<cgraph_node *> (f_node); bool filter_out = (*filter) (vnode->decl, decl_map); if (filter_out) @@ -1510,7 +1507,7 @@ rewrite_constructor_def (tree expr, hash_map<const_tree, const_tree> &type_map, static bool rewrite_field_decl_def (tree expr, hash_map<const_tree, const_tree> &type_map, - const int indent) + __attribute__((unused)) const int indent) { tree old_rhs_type = TREE_TYPE (expr); const_tree *new_rhs_type_ptr = type_map.get (old_rhs_type); @@ -1525,7 +1522,7 @@ rewrite_field_decl_def (tree expr, hash_map<const_tree, const_tree> &type_map, static bool rewrite_integer_cst_def (tree expr, hash_map<const_tree, const_tree> &type_map, - const int indent) + __attribute__((unused)) const int indent) { tree old_rhs_type = TREE_TYPE (expr); const_tree *new_rhs_type_ptr = type_map.get (old_rhs_type); @@ -1580,7 +1577,7 @@ rewrite_component_ref_def (tree expr, tree field_decl = TREE_OPERAND (expr, 1); const char *field_name = get_field_name (field_decl); if (strcmp (field_name, "anonymous") == 0) - return false; + return retval; const_tree new_field = get_field_with_name (new_type, field_name); // INFO: We need to rewrite the whole operand @@ -1618,10 +1615,9 @@ rewrite_addr_expr_def (tree expr, hash_map<const_tree, const_tree> &type_map, } static bool -rewrite_var_decl_def (tree expr, hash_map<const_tree, const_tree> &type_map, - const int indent) +rewrite_var_decl_def (tree expr, __attribute__((unused)) hash_map<const_tree, const_tree> &type_map, + __attribute__((unused)) const int indent) { - tree type = TREE_TYPE (expr); gcc_assert (TREE_CODE (expr) == VAR_DECL); return false; } @@ -1640,7 +1636,6 @@ rewrite_mem_ref_def (tree expr, hash_map<const_tree, const_tree> &type_map, if (new_type_ptr) TREE_TYPE (expr) = (tree) *new_type_ptr; - const char *old_expr = print_generic_expr_to_str (expr); tree op0 = TREE_OPERAND (expr, 0); // The first operand is the pointer being dereferenced bool retval = rewrite_expr (op0, type_map, indent); @@ -1656,11 +1651,11 @@ rewrite_mem_ref_def (tree expr, hash_map<const_tree, const_tree> &type_map, tree old_struct_size = TYPE_SIZE_UNIT (type); int old_type_size_int = tree_to_shwi (old_struct_size); test_log ("old_type = %s", 0, get_type_name (type)); - test_log ("old_type_size = %d", 0, tree_to_shwi (old_struct_size)); + test_log ("old_type_size = %ld", 0, tree_to_shwi (old_struct_size)); tree new_struct_size = TYPE_SIZE_UNIT ((tree) *new_type_ptr); int new_type_size_int = tree_to_shwi (new_struct_size); test_log ("new_type = %s", 0, get_type_name ((tree) *new_type_ptr)); - test_log ("new_type_size = %d", 0, tree_to_shwi (new_struct_size)); + test_log ("new_type_size = %ld", 0, tree_to_shwi (new_struct_size)); int multiple = old_offset / old_type_size_int; int offset = multiple * new_type_size_int; int remainder = old_offset % old_type_size_int; @@ -2093,11 +2088,11 @@ rewrite_assign_rhs (gimple *stmt, gimple_stmt_iterator &gsi, hash_map<const_tree, const_tree> &type_map, hash_map<const_tree, const_tree> &inverse) { - bool is_stmt_rewritten = false; // WONTFIX, It looks like there is no way to obtain // the expression for the rhs. So instead, we have to do // this hack. // Which expressions can be toplevel? + bool is_stmt_rewritten = false; enum tree_code code = gimple_expr_code (stmt); switch (code) { |