+2016-09-21 Richard Biener <rguenther@suse.de>
+
+ * dwarf2out.c (remove_child_with_prev): Clear child->die_sib.
+ (replace_child): Likewise.
+ (remove_child_TAG): Adjust.
+ (move_marked_base_types): Likewise.
+ (prune_unused_types_prune): Clear die_sib of removed children.
+
2016-09-21 Georg-Johann Lay <avr@gjlay.de>
PR target/77326
prev->die_sib = child->die_sib;
if (child->die_parent->die_child == child)
child->die_parent->die_child = prev;
+ child->die_sib = NULL;
}
/* Replace OLD_CHILD with NEW_CHILD. PREV must have the property that
}
if (old_child->die_parent->die_child == old_child)
old_child->die_parent->die_child = new_child;
+ old_child->die_sib = NULL;
}
/* Move all children from OLD_PARENT to NEW_PARENT. */
remove_child_with_prev (c, prev);
c->die_parent = NULL;
/* Might have removed every child. */
- if (c == c->die_sib)
+ if (die->die_child == NULL)
return;
- c = c->die_sib;
+ c = prev->die_sib;
}
} while (c != die->die_child);
}
c = die->die_child;
do {
- dw_die_ref prev = c;
- for (c = c->die_sib; ! c->die_mark; c = c->die_sib)
+ dw_die_ref prev = c, next;
+ for (c = c->die_sib; ! c->die_mark; c = next)
if (c == die->die_child)
{
/* No marked children between 'prev' and the end of the list. */
prev->die_sib = c->die_sib;
die->die_child = prev;
}
+ c->die_sib = NULL;
return;
}
+ else
+ {
+ next = c->die_sib;
+ c->die_sib = NULL;
+ }
if (c != prev->die_sib)
prev->die_sib = c;
remove_child_with_prev (c, prev);
/* As base types got marked, there must be at least
one node other than DW_TAG_base_type. */
- gcc_assert (c != c->die_sib);
- c = c->die_sib;
+ gcc_assert (die->die_child != NULL);
+ c = prev->die_sib;
}
}
while (c != die->die_child);