diff options
author | Jim Meyering <meyering@gcc.gnu.org> | 2011-04-20 18:19:03 +0000 |
---|---|---|
committer | Jim Meyering <meyering@gcc.gnu.org> | 2011-04-20 18:19:03 +0000 |
commit | 046957830e176ad16fdef39bc7f1cd44d8fbc3b7 (patch) | |
tree | e56a024bf4863c42aaa3f941f466a849bb9d3b82 /gcc/calls.c | |
parent | 53eebfbf949c9cfe6a060a91a09242cb7204f6d8 (diff) | |
download | gcc-046957830e176ad16fdef39bc7f1cd44d8fbc3b7.tar.gz |
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
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index 2e7977720e1..bb95852bf84 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; |