US stocks climb on cooler inflation data as the S&P 500 heads for a winning quarter