From ce8fe26dc09eaeacbbcb867c3b8544f765134da0 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Fri, 22 Jun 2012 01:29:28 +0000 Subject: [PATCH] re PR target/53682 (ICE in cselib_lookup (SEGV) on i586-linux-gnu) PR debug/53682 * cselib.c (promote_debug_loc): Don't crash on NULL argument. From-SVN: r188866 --- gcc/ChangeLog | 5 +++++ gcc/cselib.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 76c083c7b09..3b86f2b6323 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-06-21 Alexandre Oliva + + PR debug/53682 + * cselib.c (promote_debug_loc): Don't crash on NULL argument. + 2012-06-21 Meador Inge PR c/53702 diff --git a/gcc/cselib.c b/gcc/cselib.c index 5e6d049b0e3..d338c31be1a 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -322,7 +322,7 @@ new_elt_loc_list (cselib_val *val, rtx loc) static inline void promote_debug_loc (struct elt_loc_list *l) { - if (l->setting_insn && DEBUG_INSN_P (l->setting_insn) + if (l && l->setting_insn && DEBUG_INSN_P (l->setting_insn) && (!cselib_current_insn || !DEBUG_INSN_P (cselib_current_insn))) { n_debug_values--; -- 2.11.4.GIT