Dirac mass induced by optical gain and loss.