summaryrefslogtreecommitdiff
path: root/gcc/alias.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-16 21:43:36 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-16 21:43:36 +0000
commit4e15f806dd1505d3808ece2059cba74318b43b18 (patch)
tree8ac5eca0ff97ad9468c6b97f722656193d796728 /gcc/alias.c
parent17b5ea6f8887fb3cfa2740e1bf2425d57a6118df (diff)
downloadgcc-4e15f806dd1505d3808ece2059cba74318b43b18.tar.gz
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
Diffstat (limited to 'gcc/alias.c')
-rw-r--r--gcc/alias.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/alias.c b/gcc/alias.c
index 6ec51ec2967..a1e12fba44e 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1792,10 +1792,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
@@ -1809,10 +1810,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