aboutsummaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-01-03 21:57:29 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2012-01-03 21:57:29 +0100
commite30afafbbf5b4cf462c68c3e9e172c5989c7d85d (patch)
treed967239510b2c4cc283c3acfced9687d6cd9c178 /gcc/cselib.c
parent346afd846bbed003f8b35d927a319d7f29f87138 (diff)
downloadgcc-e30afafbbf5b4cf462c68c3e9e172c5989c7d85d.zip
gcc-e30afafbbf5b4cf462c68c3e9e172c5989c7d85d.tar.gz
gcc-e30afafbbf5b4cf462c68c3e9e172c5989c7d85d.tar.bz2
re PR bootstrap/51725 (segfault in stage 3 when compiling gcc/opts.c for sparc64-linux)
PR bootstrap/51725 * cselib.c (new_elt_loc_list): When moving locs from one cselib_val to its new canonical_cselib_val and the cselib_val was in first_containing_mem chain, but the canonical_cselib_val was not, add the latter into the chain. (cselib_invalidate_mem): Compare canonical_cselib_val of addr_list chain elt with v. From-SVN: r182858
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index fc86ef1..9934abb 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -277,6 +277,12 @@ new_elt_loc_list (cselib_val *val, rtx loc)
}
el->next = val->locs;
next = val->locs = CSELIB_VAL_PTR (loc)->locs;
+ if (CSELIB_VAL_PTR (loc)->next_containing_mem != NULL
+ && val->next_containing_mem == NULL)
+ {
+ val->next_containing_mem = first_containing_mem;
+ first_containing_mem = val;
+ }
}
/* Chain LOC back to VAL. */
@@ -2211,7 +2217,7 @@ cselib_invalidate_mem (rtx mem_rtx)
mem_chain = &addr->addr_list;
for (;;)
{
- if ((*mem_chain)->elt == v)
+ if (canonical_cselib_val ((*mem_chain)->elt) == v)
{
unchain_one_elt_list (mem_chain);
break;