From f28468203d0067182fb93773233af6c1ab07a15a Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 7 Jun 2002 12:00:44 -0600 Subject: [PATCH] sched-deps.c (free_deps): Avoid calling free_INSN_LIST_list on empty lists. * sched-deps.c (free_deps): Avoid calling free_INSN_LIST_list on empty lists. From-SVN: r54347 --- gcc/ChangeLog | 5 +++++ gcc/sched-deps.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 72a1a180c77..40e955426d5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-06-07 Jeffrey Law + + * sched-deps.c (free_deps): Avoid calling free_INSN_LIST_list + on empty lists. + 2002-06-07 H.J. Lu (hjl@gnu.org) * configure.in: Add --enable-__cxa_atexit. diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index ec18f9d1973..644f1bdbd1f 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -1508,9 +1508,12 @@ free_deps (deps) EXECUTE_IF_SET_IN_REG_SET (&deps->reg_last_in_use, 0, i, { struct deps_reg *reg_last = &deps->reg_last[i]; - free_INSN_LIST_list (®_last->uses); - free_INSN_LIST_list (®_last->sets); - free_INSN_LIST_list (®_last->clobbers); + if (reg_last->uses) + free_INSN_LIST_list (®_last->uses); + if (reg_last->sets) + free_INSN_LIST_list (®_last->sets); + if (reg_last->clobbers) + free_INSN_LIST_list (®_last->clobbers); }); CLEAR_REG_SET (&deps->reg_last_in_use); -- 2.30.2