This is a first suggestion in an effort to reach a compromise that allows EGO_SUM to be un-depracted.
I have decided to check the size of A, instead of counting the entries in EGO_SUM, because that seemed more sensible given that as A's size caused functional issues in the past (bug #719202 [1]). 1: https://bugs.gentoo.org/719202