U.S. stocks ended sharply higher Wednesday after a day of whipsaw trading as President Donald Trump backed off his threat to impose tariffs on NATO allies over his bid for U.S. control of Greenland.