+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ Remove useless if-before-free tests.
+ * calls.c (expand_call, save_area): Likewise.
+ * cfgcleanup.c (try_forward_edges): Likewise.
+ * collect2.c (collect_execute): Likewise.
+ * config/i386/i386.c (ix86_valid_target_attribute_tree): Likewise.
+ * config/mcore/mcore.c (mcore_expand_prolog): Likewise.
+ * coverage.c (coverage_checksum_string): Likewise.
+ * cse.c (init_cse_reg_info, delete_trivially_dead_insns): Likewise.
+ * cselib.c (cselib_init): Likewise.
+ * df-core.c (rest_of_handle_df_finish, df_analyze): Likewise.
+ (df_set_clean_cfg): Likewise.
+ * function.c (free_after_compilation): Likewise.
+ * gcc.c (do_spec_1, main): Likewise.
+ * gcov.c (create_file_names): Likewise.
+ * gensupport.c (identify_predicable_attribute): Likewise.
+ * graphite-clast-to-gimple.c (save_clast_name_index): Likewise.
+ * graphite-sese-to-poly.c (free_data_refs_aux): Likewise.
+ * haifa-sched.c (haifa_finish_h_i_d): Likewise.
+ * ipa-prop.c (ipa_free_node_params_substructures): Likewise.
+ * ipa-pure-const.c (local_pure_const): Likewise.
+ * ipa-reference.c (propagate): Likewise.
+ * ira-costs.c (free_ira_costs): Likewise.
+ * ira.c (free_register_move_costs, build_insn_chain): Likewise.
+ * matrix-reorg.c (mat_free): Likewise.
+ * prefix.c (get_key_value): Likewise.
+ * profile.c (compute_value_histograms): Likewise.
+ * reload1.c (free_reg_equiv): Likewise.
+ * sched-deps.c (free_deps): Likewise.
+ * sel-sched-ir.c (fence_clear): Likewise.
+ * sese.c (set_rename, if_region_set_false_region): Likewise.
+ * tree-data-ref.c (free_rdg): Likewise.
+ * tree-eh.c (lower_try_finally): Likewise.
+ * tree-ssa-coalesce.c (delete_coalesce_list): Likewise.
+ * tree-ssa-live.c (delete_var_map): Likewise.
+ * tree-ssa-loop-ivopts.c (free_loop_data): Likewise.
+ * tree-ssa-pre.c (phi_trans_add): Likewise.
+
2011-04-20 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/48611
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * initialize.c (__gnat_initialize): Remove useless if-before-free.
+
2011-04-17 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/Make-lang.in (gnatbind): Replace $(ALL_CFLAGS) with
FindClose (hDir);
- if (dir != NULL)
- free (dir);
+ free (dir);
}
}
else
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * c-format.c (init_dollar_format_checking): Remove useless
+ if-before-free.
+
2011-04-15 Nicola Pero <nicola.pero@meta-innovation.com>
* c-objc.h (objc_get_interface_ivars): Removed.
* c-common.c: Include gt-c-family-c-common.h.
* c-pragma.c: Include gt-c-family-c-pragma.h.
\f
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
}
if (dollar_arguments_alloc < dollar_arguments_count)
{
- if (dollar_arguments_used)
- free (dollar_arguments_used);
- if (dollar_arguments_pointer_p)
- free (dollar_arguments_pointer_p);
+ free (dollar_arguments_used);
+ free (dollar_arguments_pointer_p);
dollar_arguments_alloc = dollar_arguments_count;
dollar_arguments_used = XNEWVEC (char, dollar_arguments_alloc);
dollar_arguments_pointer_p = XNEWVEC (char, dollar_arguments_alloc);
highest_outgoing_arg_in_use = MAX (initial_highest_arg_in_use,
needed);
#endif
- if (stack_usage_map_buf)
- free (stack_usage_map_buf);
+ free (stack_usage_map_buf);
stack_usage_map_buf = XNEWVEC (char, highest_outgoing_arg_in_use);
stack_usage_map = stack_usage_map_buf;
= stack_arg_under_construction;
stack_arg_under_construction = 0;
/* Make a new map for the new argument list. */
- if (stack_usage_map_buf)
- free (stack_usage_map_buf);
+ free (stack_usage_map_buf);
stack_usage_map_buf = XCNEWVEC (char, highest_outgoing_arg_in_use);
stack_usage_map = stack_usage_map_buf;
highest_outgoing_arg_in_use = 0;
/* Free up storage we no longer need. */
for (i = 0; i < num_actuals; ++i)
- if (args[i].aligned_regs)
- free (args[i].aligned_regs);
+ free (args[i].aligned_regs);
insns = get_insns ();
end_sequence ();
currently_expanding_call--;
- if (stack_usage_map_buf)
- free (stack_usage_map_buf);
+ free (stack_usage_map_buf);
return target;
}
stack_usage_map = initial_stack_usage_map;
}
- if (stack_usage_map_buf)
- free (stack_usage_map_buf);
+ free (stack_usage_map_buf);
return value;
ei_next (&ei);
}
- if (threaded_edges)
- free (threaded_edges);
+ free (threaded_edges);
return changed;
}
\f
fatal (errmsg);
}
- if (response_arg)
- free (response_arg);
+ free (response_arg);
return pex;
}
/* Free up memory allocated to hold the strings */
for (i = 0; i < IX86_FUNCTION_SPECIFIC_MAX; i++)
- if (option_strings[i])
- free (option_strings[i]);
+ free (option_strings[i]);
}
return t;
gcc_assert (GET_CODE (x) == SYMBOL_REF);
- if (mcore_current_function_name)
- free (mcore_current_function_name);
+ free (mcore_current_function_name);
mcore_current_function_name = xstrdup (XSTR (x, 0));
}
chksum = crc32_string (chksum, string);
- if (dup)
- free (dup);
+ free (dup);
return chksum;
}
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * tree.c (cxx_printable_name_internal): Remove useless if-before-free.
+
2011-04-19 Jason Merrill <jason@redhat.com>
PR c++/46304
gcc_assert (uid_ring[ring_counter] != DECL_UID (current_function_decl));
}
- if (print_ring[ring_counter])
- free (print_ring[ring_counter]);
+ free (print_ring[ring_counter]);
print_ring[ring_counter] = xstrdup (lang_decl_name (decl, v, translate));
uid_ring[ring_counter] = DECL_UID (decl);
}
/* Reallocate the table with NEW_SIZE entries. */
- if (cse_reg_info_table)
- free (cse_reg_info_table);
+ free (cse_reg_info_table);
cse_reg_info_table = XNEWVEC (struct cse_reg_info, new_size);
cse_reg_info_table_size = new_size;
cse_reg_info_table_first_uninitialized = 0;
df_insn_rescan (insn);
}
}
- if (replacements)
- free (replacements);
+ free (replacements);
}
if (dump_file && ndead)
if (!reg_values || reg_values_size < cselib_nregs
|| (reg_values_size > 10 && reg_values_size > cselib_nregs * 4))
{
- if (reg_values)
- free (reg_values);
+ free (reg_values);
/* Some space for newly emit instructions so we don't end up
reallocating in between passes. */
reg_values_size = cselib_nregs + (63 + cselib_nregs) / 16;
dflow->problem->free_fun ();
}
- if (df->postorder)
- free (df->postorder);
- if (df->postorder_inverted)
- free (df->postorder_inverted);
+ free (df->postorder);
+ free (df->postorder_inverted);
free (df->hard_regs_live_count);
free (df);
df = NULL;
bool everything;
int i;
- if (df->postorder)
- free (df->postorder);
- if (df->postorder_inverted)
- free (df->postorder_inverted);
+ free (df->postorder);
+ free (df->postorder_inverted);
df->postorder = XNEWVEC (int, last_basic_block);
df->postorder_inverted = XNEWVEC (int, last_basic_block);
df->n_blocks = post_order_compute (df->postorder, true, true);
static void
df_set_clean_cfg (void)
{
- if (saved_cfg)
- free (saved_cfg);
+ free (saved_cfg);
saved_cfg = df_compute_cfg_image ();
}
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * expr.c (free_expr0): Remove useless if-before-free.
+ * gfortranspec.c (lang_specific_pre_link): Likewise.
+ * interface.c (gfc_extend_expr): Likewise.
+ * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise.
+
2011-04-19 Tobias Burnus <burnus@net-b.de>
PR fortran/48588
}
/* Free the representation. */
- if (e->representation.string)
- free (e->representation.string);
+ free (e->representation.string);
break;
int
lang_specific_pre_link (void)
{
- if (spec_file)
- free (spec_file);
- else if (library)
+ free (spec_file);
+ if (spec_file == NULL && library)
do_spec ("%:include(libgfortran.spec)");
return 0;
}
/* Don't use gfc_free_actual_arglist(). */
- if (actual->next != NULL)
- free (actual->next);
+ free (actual->next);
free (actual);
return FAILURE;
free (symtree1);
free (symtree2);
free (symtree3);
- if (symtree4)
- free (symtree4);
+ free (symtree4);
gfc_free_array_spec (outer_sym.as);
}
prologue_insn_hash = NULL;
epilogue_insn_hash = NULL;
- if (crtl->emit.regno_pointer_align)
- free (crtl->emit.regno_pointer_align);
+ free (crtl->emit.regno_pointer_align);
memset (crtl, 0, sizeof (struct rtl_data));
f->eh = NULL;
t->filename_length = temp_filename_length;
}
- if (saved_suffix)
- free (saved_suffix);
+ free (saved_suffix);
obstack_grow (&obstack, t->filename, t->filename_length);
delete_this_arg = 1;
{
if (compare_debug)
{
- if (debug_check_temp_file[0])
- free (debug_check_temp_file[0]);
+ free (debug_check_temp_file[0]);
debug_check_temp_file[0] = NULL;
- if (debug_check_temp_file[1])
- free (debug_check_temp_file[1]);
+ free (debug_check_temp_file[1]);
debug_check_temp_file[1] = NULL;
}
if (compare_debug)
{
- if (debug_check_temp_file[0])
- free (debug_check_temp_file[0]);
+ free (debug_check_temp_file[0]);
debug_check_temp_file[0] = NULL;
- if (debug_check_temp_file[1])
- free (debug_check_temp_file[1]);
+ free (debug_check_temp_file[1]);
debug_check_temp_file[1] = NULL;
}
}
int base;
/* Free previous file names. */
- if (bbg_file_name)
- free (bbg_file_name);
- if (da_file_name)
- free (da_file_name);
+ free (bbg_file_name);
+ free (da_file_name);
da_file_name = bbg_file_name = NULL;
bbg_file_time = 0;
bbg_stamp = 0;
if (p_true == NULL || strchr (++p_true, ',') != NULL)
{
error_with_line (elem->lineno, "attribute `predicable' is not a boolean");
- if (p_false)
- free (p_false);
+ free (p_false);
return;
}
p_true[-1] = '\0';
case CONST:
error_with_line (elem->lineno, "attribute `predicable' cannot be const");
- if (p_false)
- free (p_false);
+ free (p_false);
return;
default:
error_with_line (elem->lineno,
"attribute `predicable' must have a constant default");
- if (p_false)
- free (p_false);
+ free (p_false);
return;
}
{
error_with_line (elem->lineno,
"unknown value `%s' for `predicable' attribute", value);
- if (p_false)
- free (p_false);
+ free (p_false);
}
}
if (slot)
{
- if (*slot)
- free (*slot);
+ free (*slot);
*slot = new_clast_name_index (name, index);
}
{
base_alias_pair *bap = (base_alias_pair *)(dr->aux);
- if (bap->alias_set)
- free (bap->alias_set);
+ free (bap->alias_set);
free (bap);
dr->aux = NULL;
FOR_EACH_VEC_ELT (haifa_insn_data_def, h_i_d, i, data)
{
- if (data->reg_pressure != NULL)
- free (data->reg_pressure);
+ free (data->reg_pressure);
for (use = data->reg_use_list; use != NULL; use = next)
{
next = use->next_insn_use;
void
ipa_free_node_params_substructures (struct ipa_node_params *info)
{
- if (info->params)
- free (info->params);
+ free (info->params);
memset (info, 0, sizeof (*info));
}
lang_hooks.decl_printable_name (current_function_decl,
2));
}
- if (l)
- free (l);
+ free (l);
if (changed)
return execute_fixup_cfg ();
else
node_g->statics_written);
}
}
- if (node_info)
- free (node_info);
+ free (node_info);
if (node->aux)
{
free (node->aux);
{
int i;
- if (init_cost != NULL)
- free (init_cost);
+ free (init_cost);
init_cost = NULL;
for (i = 0; i < MAX_RECOG_OPERANDS; i++)
{
- if (op_costs[i] != NULL)
- free (op_costs[i]);
- if (this_op_costs[i] != NULL)
- free (this_op_costs[i]);
+ free (op_costs[i]);
+ free (this_op_costs[i]);
op_costs[i] = this_op_costs[i] = NULL;
}
- if (temp_costs != NULL)
- free (temp_costs);
+ free (temp_costs);
temp_costs = NULL;
}
for (mode = 0; mode < MAX_MACHINE_MODE; mode++)
{
- if (ira_max_register_move_cost[mode] != NULL)
- free (ira_max_register_move_cost[mode]);
- if (ira_may_move_in_cost[mode] != NULL)
- free (ira_may_move_in_cost[mode]);
- if (ira_may_move_out_cost[mode] != NULL)
- free (ira_may_move_out_cost[mode]);
- if (ira_max_may_move_in_cost[mode] != NULL)
- free (ira_max_may_move_in_cost[mode]);
- if (ira_max_may_move_out_cost[mode] != NULL)
- free (ira_max_may_move_out_cost[mode]);
+ free (ira_max_register_move_cost[mode]);
+ free (ira_may_move_in_cost[mode]);
+ free (ira_may_move_out_cost[mode]);
+ free (ira_max_may_move_in_cost[mode]);
+ free (ira_max_may_move_out_cost[mode]);
ira_register_move_cost[mode] = NULL;
ira_max_register_move_cost[mode] = NULL;
ira_may_move_in_cost[mode] = NULL;
}
for (i = 0; i < (unsigned int) max_regno; i++)
- if (live_subregs[i])
- free (live_subregs[i]);
+ free (live_subregs[i]);
reload_insn_chain = c;
*p = NULL;
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * jcf-parse.c (java_parse_file): Remove useless if-before-free.
+
2011-04-18 Jim Meyering <meyering@redhat.com>
* jcf-parse.c: Fix typo in comment.
\f
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+2006, 2007, 2008, 2009, 2011 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
list = next;
}
- if (file_list != NULL)
- free (file_list);
+ free (file_list);
if (filename_count == 0)
warning (0, "no input file specified");
if (!mat)
return;
- if (mat->free_stmts)
- free (mat->free_stmts);
- if (mat->dim_hot_level)
- free (mat->dim_hot_level);
- if (mat->malloc_for_level)
- free (mat->malloc_for_level);
+ free (mat->free_stmts);
+ free (mat->dim_hot_level);
+ free (mat->malloc_for_level);
}
/* Find all potential matrices.
if (prefix == 0)
prefix = std_prefix;
- if (temp)
- free (temp);
+ free (temp);
return prefix;
}
}
for (t = 0; t < GCOV_N_VALUE_COUNTERS; t++)
- if (histogram_counts[t])
- free (histogram_counts[t]);
+ free (histogram_counts[t]);
}
/* The entry basic block will be moved around so that it has index=1,
int i;
- if (offsets_known_at)
- free (offsets_known_at);
- if (offsets_at)
- free (offsets_at);
+ free (offsets_known_at);
+ free (offsets_at);
offsets_at = 0;
offsets_known_at = 0;
/* As we initialize reg_last lazily, it is possible that we didn't allocate
it at all. */
- if (deps->reg_last)
- free (deps->reg_last);
+ free (deps->reg_last);
deps->reg_last = NULL;
deps = NULL;
gcc_assert ((s != NULL && dc != NULL && tc != NULL)
|| (s == NULL && dc == NULL && tc == NULL));
- if (s != NULL)
- free (s);
+ free (s);
if (dc != NULL)
delete_deps_context (dc);
if (!slot)
return;
- if (*slot)
- free (*slot);
+ free (*slot);
*slot = new_rename_map_elt (old_name, expr);
}
SESE_EXIT (region) = false_edge;
- if (if_region->false_region)
- free (if_region->false_region);
+ free (if_region->false_region);
if_region->false_region = region;
if (slot)
struct graph_edge *e;
for (e = v->succ; e; e = e->succ_next)
- if (e->data)
- free (e->data);
+ free (e->data);
- if (v->data)
- free (v->data);
+ free (v->data);
}
htab_delete (rdg->indices);
}
VEC_free (tree, heap, this_tf.dest_array);
- if (this_tf.goto_queue)
- free (this_tf.goto_queue);
+ free (this_tf.goto_queue);
if (this_tf.goto_queue_map)
pointer_map_destroy (this_tf.goto_queue_map);
{
gcc_assert (cl->cost_one_list == NULL);
htab_delete (cl->list);
- if (cl->sorted)
- free (cl->sorted);
+ free (cl->sorted);
gcc_assert (cl->num_sorted == 0);
free (cl);
}
{
var_map_base_fini (map);
partition_delete (map->var_partition);
- if (map->partition_to_view)
- free (map->partition_to_view);
- if (map->view_to_partition)
- free (map->view_to_partition);
+ free (map->partition_to_view);
+ free (map->view_to_partition);
free (map);
}
struct version_info *info;
info = ver_info (data, i);
- if (info->iv)
- free (info->iv);
+ free (info->iv);
info->iv = NULL;
info->has_nonlin_use = false;
info->preserve_biv = false;
{
struct iv_cand *cand = iv_cand (data, i);
- if (cand->iv)
- free (cand->iv);
+ free (cand->iv);
if (cand->depends_on)
BITMAP_FREE (cand->depends_on);
free (cand);
slot = htab_find_slot_with_hash (phi_translate_table, new_pair,
new_pair->hashcode, INSERT);
- if (*slot)
- free (*slot);
+ free (*slot);
*slot = (void *) new_pair;
}
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * files.c (destroy_cpp_file): Remove useless if-before-free.
+ * init.c (cpp_destroy): Likewise.
+ * macro.c (replace_args): Likewise.
+ * pch.c (cpp_valid_state): Likewise.
+
2011-03-25 Kai Tietz <ktietz@redhat.com>
* files.c (file_hash_eq): Use filename_cmp
static void
destroy_cpp_file (_cpp_file *file)
{
- if (file->buffer_start)
- free ((void *) file->buffer_start);
+ free ((void *) file->buffer_start);
free ((void *) file->name);
free (file);
}
while (CPP_BUFFER (pfile) != NULL)
_cpp_pop_buffer (pfile);
- if (pfile->out.base)
- free (pfile->out.base);
+ free (pfile->out.base);
if (pfile->macro_buffer)
{
/* Free the expanded arguments. */
for (i = 0; i < macro->paramc; i++)
- if (args[i].expanded)
- free (args[i].expanded);
+ free (args[i].expanded);
push_ptoken_context (pfile, node, buff, first, dest - first);
}
return -1;
fail:
- if (namebuf != NULL)
- free (namebuf);
- if (undeftab != NULL)
- free (undeftab);
- if (nl.defs != NULL)
- free (nl.defs);
+ free (namebuf);
+ free (undeftab);
+ free (nl.defs);
return 1;
}
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * decNumber.c (decNumberFromString): Remove useless
+ if-before-free test.
+ (decNumberCompareTotalMag, decNumberExp, decNumberFMA): Likewise.
+ (decNumberLn, decNumberLog10, decNumberPower): Likewise.
+ (decNumberReduce, decNumberSquareRoot, decAddOp): Likewise.
+ (decDivideOp, NEEDTWO, decExpOp, LN2): Likewise.
+
2011-03-28 Mike Frysinger <vapier@gentoo.org>
* .gitignore: New file.
/* decNumberShow(dn); */
} while(0); /* [for break] */
- if (allocres!=NULL) free(allocres); /* drop any storage used */
+ free(allocres); /* drop any storage used */
if (status!=0) decStatus(dn, status, set);
return dn;
} /* decNumberFromString */
decCompareOp(res, lhs, rhs, set, COMPTOTAL, &status);
} while(0); /* end protected */
- if (allocbufa!=NULL) free(allocbufa); /* drop any storage used */
- if (allocbufb!=NULL) free(allocbufb); /* .. */
+ free(allocbufa); /* drop any storage used */
+ free(allocbufb); /* .. */
if (status!=0) decStatus(res, status, set);
return res;
} /* decNumberCompareTotalMag */
} while(0); /* end protected */
#if DECSUBSET
- if (allocrhs !=NULL) free(allocrhs); /* drop any storage used */
+ free(allocrhs); /* drop any storage used */
#endif
/* apply significant status */
if (status!=0) decStatus(res, status, set);
decAddOp(res, acc, fhs, set, 0, &status);
} while(0); /* end protected */
- if (allocbufa!=NULL) free(allocbufa); /* drop any storage used */
+ free(allocbufa); /* drop any storage used */
if (status!=0) decStatus(res, status, set);
#if DECCHECK
decCheckInexact(res, set);
} while(0); /* end protected */
#if DECSUBSET
- if (allocrhs !=NULL) free(allocrhs); /* drop any storage used */
+ free(allocrhs); /* drop any storage used */
#endif
/* apply significant status */
if (status!=0) decStatus(res, status, set);
decDivideOp(res, a, b, &aset, DIVIDE, &status); /* into result */
} while(0); /* [for break] */
- if (allocbufa!=NULL) free(allocbufa); /* drop any storage used */
- if (allocbufb!=NULL) free(allocbufb); /* .. */
+ free(allocbufa); /* drop any storage used */
+ free(allocbufb); /* .. */
#if DECSUBSET
- if (allocrhs !=NULL) free(allocrhs); /* .. */
+ free(allocrhs); /* .. */
#endif
/* apply significant status */
if (status!=0) decStatus(res, status, set);
#endif
} while(0); /* end protected */
- if (allocdac!=NULL) free(allocdac); /* drop any storage used */
- if (allocinv!=NULL) free(allocinv); /* .. */
+ free(allocdac); /* drop any storage used */
+ free(allocinv); /* .. */
#if DECSUBSET
- if (alloclhs!=NULL) free(alloclhs); /* .. */
- if (allocrhs!=NULL) free(allocrhs); /* .. */
+ free(alloclhs); /* .. */
+ free(allocrhs); /* .. */
#endif
if (status!=0) decStatus(res, status, set);
#if DECCHECK
} while(0); /* end protected */
#if DECSUBSET
- if (allocrhs !=NULL) free(allocrhs); /* .. */
+ free(allocrhs); /* .. */
#endif
if (status!=0) decStatus(res, status, set);/* then report status */
return res;
decNumberCopy(res, a); /* a is now the result */
} while(0); /* end protected */
- if (allocbuff!=NULL) free(allocbuff); /* drop any storage used */
- if (allocbufa!=NULL) free(allocbufa); /* .. */
- if (allocbufb!=NULL) free(allocbufb); /* .. */
+ free(allocbuff); /* drop any storage used */
+ free(allocbufa); /* .. */
+ free(allocbufb); /* .. */
#if DECSUBSET
- if (allocrhs !=NULL) free(allocrhs); /* .. */
+ free(allocrhs); /* .. */
#endif
if (status!=0) decStatus(res, status, set);/* then report status */
#if DECCHECK
}
} while(0); /* end protected */
- if (allocacc!=NULL) free(allocacc); /* drop any storage used */
+ free(allocacc); /* drop any storage used */
#if DECSUBSET
- if (allocrhs!=NULL) free(allocrhs); /* .. */
- if (alloclhs!=NULL) free(alloclhs); /* .. */
+ free(allocrhs); /* .. */
+ free(alloclhs); /* .. */
#endif
return res;
} /* decAddOp */
#endif
} while(0); /* end protected */
- if (varalloc!=NULL) free(varalloc); /* drop any storage used */
- if (allocacc!=NULL) free(allocacc); /* .. */
+ free(varalloc); /* drop any storage used */
+ free(allocacc); /* .. */
#if DECSUBSET
- if (allocrhs!=NULL) free(allocrhs); /* .. */
- if (alloclhs!=NULL) free(alloclhs); /* .. */
+ free(allocrhs); /* .. */
+ free(alloclhs); /* .. */
#endif
return res;
} /* decDivideOp */
decFinish(res, set, &residue, status); /* final cleanup */
} while(0); /* end protected */
- if (allocacc!=NULL) free(allocacc); /* drop any storage used */
+ free(allocacc); /* drop any storage used */
#if DECSUBSET
- if (allocrhs!=NULL) free(allocrhs); /* .. */
- if (alloclhs!=NULL) free(alloclhs); /* .. */
+ free(allocrhs); /* .. */
+ free(alloclhs); /* .. */
#endif
#if FASTMUL
- if (allocrhi!=NULL) free(allocrhi); /* .. */
- if (alloclhi!=NULL) free(alloclhi); /* .. */
+ free(allocrhi); /* .. */
+ free(alloclhi); /* .. */
#endif
return res;
} /* decMultiplyOp */
decFinish(res, set, &residue, status); /* cleanup/set flags */
} while(0); /* end protected */
- if (allocrhs !=NULL) free(allocrhs); /* drop any storage used */
- if (allocbufa!=NULL) free(allocbufa); /* .. */
- if (allocbuft!=NULL) free(allocbuft); /* .. */
+ free(allocrhs); /* drop any storage used */
+ free(allocbufa); /* .. */
+ free(allocbuft); /* .. */
/* [status is handled by caller] */
return res;
} /* decExpOp */
decFinish(res, set, &residue, status); /* cleanup/set flags */
} while(0); /* end protected */
- if (allocbufa!=NULL) free(allocbufa); /* drop any storage used */
- if (allocbufb!=NULL) free(allocbufb); /* .. */
+ free(allocbufa); /* drop any storage used */
+ free(allocbufb); /* .. */
/* [status is handled by caller] */
return res;
} /* decLnOp */
} while(0); /* end protected */
#if DECSUBSET
- if (allocrhs!=NULL) free(allocrhs); /* drop any storage used */
- if (alloclhs!=NULL) free(alloclhs); /* .. */
+ free(allocrhs); /* drop any storage used */
+ free(alloclhs); /* .. */
#endif
return res;
} /* decQuantizeOp */
}
}
#if DECSUBSET
- if (allocrhs!=NULL) free(allocrhs); /* free any storage used */
- if (alloclhs!=NULL) free(alloclhs); /* .. */
+ free(allocrhs); /* free any storage used */
+ free(alloclhs); /* .. */
#endif
return res;
} /* decCompareOp */
result=(*u==0 ? 0 : +1);
}
/* clean up and return the result */
- if (allocacc!=NULL) free(allocacc); /* drop any storage used */
+ free(allocacc); /* drop any storage used */
return result;
} /* decUnitCompare */
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * intrinsics/move_alloc.c (move_alloc): Remove useless
+ if-before-free test.
+ * io/fbuf.c (fbuf_destroy): Likewise.
+ * io/format.c (save_parsed_format): Likewise.
+ * io/open.c (already_open): Likewise.
+ * io/unit.c (free_internal_unit, close_unit_1): Likewise.
+ * io/unix.c (mem_close): Likewise.
+
2011-04-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/48602
{
int i;
- if (to->data)
- free (to->data);
+ free (to->data);
for (i = 0; i < GFC_DESCRIPTOR_RANK (from); i++)
{
{
if (u->fbuf == NULL)
return;
- if (u->fbuf->buf)
- free (u->fbuf->buf);
+ free (u->fbuf->buf);
free (u->fbuf);
u->fbuf = NULL;
}
free_format_data (u->format_hash_table[hash].hashed_fmt);
u->format_hash_table[hash].hashed_fmt = NULL;
- if (u->format_hash_table[hash].key != NULL)
- free (u->format_hash_table[hash].key);
+ free (u->format_hash_table[hash].key);
u->format_hash_table[hash].key = get_mem (dtp->format_len);
memcpy (u->format_hash_table[hash].key, dtp->format, dtp->format_len);
}
u->s = NULL;
- if (u->file)
- free (u->file);
+ free (u->file);
u->file = NULL;
u->file_len = 0;
if (dtp->u.p.current_unit != NULL)
{
- if (dtp->u.p.current_unit->ls != NULL)
- free (dtp->u.p.current_unit->ls);
+ free (dtp->u.p.current_unit->ls);
- if (dtp->u.p.current_unit->s)
- free (dtp->u.p.current_unit->s);
+ free (dtp->u.p.current_unit->s);
destroy_unit_mutex (dtp->u.p.current_unit);
}
delete_unit (u);
- if (u->file)
- free (u->file);
+ free (u->file);
u->file = NULL;
u->file_len = 0;
static int
mem_close (unix_stream * s)
{
- if (s != NULL)
- free (s);
+ free (s);
return 0;
}
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * cp-demint.c (cplus_demangle_v3_components): Remove useless
+ if-before-free.
+ * cplus-dem.c (squangle_mop_up): Likewise.
+ (delete_non_B_K_work_stuff): Likewise.
+ * pex-common.c (pex_free): Likewise.
+ * pex-msdos.c (pex_msdos_cleanup): Likewise.
+ * pex-win32.c (mingw_rootify, msys_rootify): Likewise.
+ (win32_spawn): Likewise.
+ * regex.c (FREE_VAR, weak_alias): Likewise.
+ * spaces.c (spaces): Likewise.
+
2011-04-10 Jim Meyering <meyering@redhat.com>
Avoid memory overrun in a test leading to potential double-free.
malloc (di.num_subs * sizeof (struct demangle_component *)));
if (di.comps == NULL || di.subs == NULL)
{
- if (di.comps != NULL)
- free (di.comps);
- if (di.subs != NULL)
- free (di.subs);
+ free (di.comps);
+ free (di.subs);
return NULL;
}
int i;
for (i = 0; i < work->ntmpl_args; i++)
- if (work->tmpl_argvec[i])
- free ((char*) work->tmpl_argvec[i]);
+ free ((char*) work->tmpl_argvec[i]);
free ((char*) work->tmpl_argvec);
work->tmpl_argvec = NULL;
if (obj->next_input_name_allocated)
free (obj->next_input_name);
- if (obj->children != NULL)
- free (obj->children);
- if (obj->status != NULL)
- free (obj->status);
- if (obj->time != NULL)
- free (obj->time);
+ free (obj->children);
+ free (obj->status);
+ free (obj->time);
if (obj->remove_count > 0)
{
ms = (struct pex_msdos *) obj->sysdep;
for (i = 0; i < PEX_MSDOS_FILE_COUNT; ++i)
- if (msdos->files[i] != NULL)
- free (msdos->files[i]);
- if (msdos->statuses != NULL)
- free (msdos->statuses);
+ free (msdos->files[i]);
+ free (msdos->statuses);
free (msdos);
obj->sysdep = NULL;
}
if (!namebuf || !foundbuf)
{
RegCloseKey (hKey);
- if (namebuf)
- free (namebuf);
- if (foundbuf)
- free (foundbuf);
+ free (namebuf);
+ free (foundbuf);
return executable;
}
return tack_on_executable (buf, executable);
/* failed */
- if (buf)
- free (buf);
+ free (buf);
return executable;
}
#endif
si,
pi))
{
- if (env_block)
- free (env_block);
+ free (env_block);
free (full_executable);
/* Clean up. */
CloseHandle (pi->hThread);
free (full_executable);
- if (env_block)
- free (env_block);
+ free (env_block);
return (pid_t) pi->hProcess;
error:
- if (env_block)
- free (env_block);
- if (cmdline)
- free (cmdline);
- if (full_executable)
- free (full_executable);
+ free (env_block);
+ free (cmdline);
+ free (full_executable);
return (pid_t) -1;
}
#ifdef MATCH_MAY_ALLOCATE
# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
#else
-# define FREE_VAR(var) if (var) free (var); var = NULL
+# define FREE_VAR(var) free (var); var = NULL
#endif
#ifdef WCHAR
void
regfree (regex_t *preg)
{
- if (preg->buffer != NULL)
- free (preg->buffer);
+ free (preg->buffer);
preg->buffer = NULL;
preg->allocated = 0;
preg->used = 0;
- if (preg->fastmap != NULL)
- free (preg->fastmap);
+ free (preg->fastmap);
preg->fastmap = NULL;
preg->fastmap_accurate = 0;
- if (preg->translate != NULL)
- free (preg->translate);
+ free (preg->translate);
preg->translate = NULL;
}
#ifdef _LIBC
if (count > maxsize)
{
- if (buf)
- {
- free (buf);
- }
+ free (buf);
buf = (char *) malloc (count + 1);
if (buf == (char *) 0)
return 0;
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * libsupc++/del_opnt.cc (operator delete): Remove useless
+ if-before-free.
+
2011-04-19 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/48521
_GLIBCXX_WEAK_DEFINITION void
operator delete (void *ptr, const std::nothrow_t&) throw ()
{
- if (ptr)
- free (ptr);
+ free (ptr);
}
+2011-04-20 Jim Meyering <meyering@redhat.com>
+
+ * lto-plugin.c (free_1, free_2): Remove useless if-before-free.
+
2011-04-05 Richard Guenther <rguenther@suse.de>
PR bootstrap/48431
{
struct ld_plugin_symbol *s = &symtab->syms[j];
free (s->name);
- if (s->comdat_key)
- free (s->comdat_key);
+ free (s->comdat_key);
}
free (symtab->syms);
symtab->syms = NULL;
claimed_files = NULL;
num_claimed_files = 0;
- if (arguments_file_name)
- free (arguments_file_name);
+ free (arguments_file_name);
arguments_file_name = NULL;
}