and being in anguish and despair he cast himself into a gaping chasm filled with fire , and so ended ; and the silmaril that he bore was taken into the bosom of the earth , and it is told of maglor that he could not endure the pain with which the silmaril tormented him ; and he cast it at last into the sea , and thereafter he wandered ever upon the shores , singing in pain and regret beside the waves .