From 584812f4690898e2f01119daf3acb7a28010969c Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 16 Apr 2010 21:43:36 +0000 Subject: [PATCH] PR bootstrap/43767 * alias.c (memrefs_conflict_p): Don't crash if CSELIB_VAL_PTR is NULL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158450 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/alias.c | 18 ++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 68664b15ab6..e776c9cce72 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-04-16 Jakub Jelinek + + PR bootstrap/43767 + * alias.c (memrefs_conflict_p): Don't crash if CSELIB_VAL_PTR is NULL. + 2010-04-16 Doug Kwan * tree-ssa-reassoc.c (struct operand_entry): Add new field ID. diff --git a/gcc/alias.c b/gcc/alias.c index 72f8a66ca74..1d69d9da603 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1791,10 +1791,11 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) { if (REG_P (y)) { - struct elt_loc_list *l; - for (l = CSELIB_VAL_PTR (x)->locs; l; l = l->next) - if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, y)) - break; + struct elt_loc_list *l = NULL; + if (CSELIB_VAL_PTR (x)) + for (l = CSELIB_VAL_PTR (x)->locs; l; l = l->next) + if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, y)) + break; if (l) x = y; else @@ -1808,10 +1809,11 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) { if (REG_P (x)) { - struct elt_loc_list *l; - for (l = CSELIB_VAL_PTR (y)->locs; l; l = l->next) - if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, x)) - break; + struct elt_loc_list *l = NULL; + if (CSELIB_VAL_PTR (y)) + for (l = CSELIB_VAL_PTR (y)->locs; l; l = l->next) + if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, x)) + break; if (l) y = x; else -- 2.11.0