summaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
authormeyering <meyering@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-20 18:19:03 +0000
committermeyering <meyering@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-20 18:19:03 +0000
commitdd045aeeddc65c15840ac25e90f729e2805dfc17 (patch)
treee56a024bf4863c42aaa3f941f466a849bb9d3b82 /gcc/cselib.c
parentff3aed6233b16f02b26f82b3dac7d604aac42641 (diff)
downloadgcc-dd045aeeddc65c15840ac25e90f729e2805dfc17.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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172785 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index dff096752f5..56e6d178576 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -2462,8 +2462,7 @@ cselib_init (int record_what)
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;