On operators whose spectrum lies on a circle or a line