From 046957830e176ad16fdef39bc7f1cd44d8fbc3b7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 20 Apr 2011 18:19:03 +0000 Subject: remove useless if-before-free tests Change "if (E) free (E);" to "free (E);" everywhere except in the libgo/, intl/, zlib/ and classpath/ directories. Also transform equivalent variants like "if (E != NULL) free (E);" and allow an extra cast on the argument to free. Otherwise, the tested and freed "E" expressions must be identical, modulo white space. From-SVN: r172785 --- gcc/calls.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'gcc/calls.c') diff --git a/gcc/calls.c b/gcc/calls.c index 2e79777..bb95852 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2555,8 +2555,7 @@ expand_call (tree exp, rtx target, int ignore) 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; @@ -2661,8 +2660,7 @@ expand_call (tree exp, rtx target, int ignore) = 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; @@ -3152,8 +3150,7 @@ expand_call (tree exp, rtx target, int ignore) /* 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 (); @@ -3208,8 +3205,7 @@ expand_call (tree exp, rtx target, int ignore) currently_expanding_call--; - if (stack_usage_map_buf) - free (stack_usage_map_buf); + free (stack_usage_map_buf); return target; } @@ -3966,8 +3962,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, stack_usage_map = initial_stack_usage_map; } - if (stack_usage_map_buf) - free (stack_usage_map_buf); + free (stack_usage_map_buf); return value; -- cgit v1.1