https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87881
--- Comment #12 from Paul Thomas <pault at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #11) > Created attachment 45257 [details] > gcc9-pr87881.patch > > Untested fix. simplify_const_ref is similar, but actually iterates p->ref > and thus properly stops immediately after handling the REF_INQUIRY, > returning true, > because it has no further refs. simplify_ref_chain is weird in that it is > passed two arguments, one ref and one p, where in all callers do pass p->ref > and &p to those arguments, so if for REF_INQUIRY we replace *p with > something different, all the references are freed and we need to stop > iterating. Hi Jakub, That's absolutely right - thanks! I have modified find_inquiry_ref to allow for the possibility of there being two inquiry part references and return true in simplify ref_chain. It's just now regtesting. Cheers Paul