Turbulence was again on display in the US stock market, with the S&P 500 Index swinging wildly between gains and losses.