I have attached the patch below as obvious and simple (it is a
one-liner). The problem was a latent bug exposed by my recent
commit for PR 78865, where the check for subroutine entries
was done on the main symbol instead of the entry. Provision
for doing this for the entry master were already in place,
I simply added the condition for the entry itself.
I will wait a week or so before committing to gcc-8, the only
other affected branch.