Empress is correct (while Shareholder's "but that is not often a consideration in upgrading." seems a bit fuzzy)
At the gate, a D fare trumps any E/SE's using upgrade coupons. Of course, the E/SE's may have been able to upgrade in advance, although if you watch inventory like Shareholder suggested, you may be able to get your booking changed in advance as well.