The S&P 500 posted a gain of 0.6% on Wednesday ahead of key inflation data and bank earnings due later in the week.