https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117489

--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The problem here (and with the assert Richi nuked in PR 113197) is that the
flags really are:

no_direct_clobber no_indirect_clobber no_direct_escape no_indirect_escape
not_returned_indirectly no_direct_read no_indirect_read

If you do not read memory you can not clobber or escape it indirectly, so there
should always an implication between these flags if things are computed sanely.

Rhe problem here is with thunk alias in combination with pure attribute. Modref
tries to minimize the summaries and sees that pure attributee implies
no_direct_clobber no_indirect_clobber no_direct_escape no_indirect_escape and
takes it away.

However C++ FE when creating thunk alias does not copy pure attribute, so when
function is called using pure alias we do not get the EAF flags implied by it.

I have patch to extend modref to look for aliases and only remove those flags
that are implied by all aliases of the function.  There is other PR with same
issue with ICE in modref.

We also should copy attributes when creating thunks.

Reply via email to