Compact perturbations of orthogonal polynomials