aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-04-20 18:19:03 +0000
committerJim Meyering <meyering@redhat.com>2011-04-20 18:19:03 +0000
commit3c60829e38e9b1dc91f9571fa48ca2b8ca3717e0 (patch)
treee56a024bf4863c42aaa3f941f466a849bb9d3b82 /gcc/calls.c
parent0c8d183576840343a76e631e2db66e6625a967bc (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@172785 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c15
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;