Stocks pared gains on Wednesday as shares of General Electric fell to session lows, offsetting a boost to energy and natural resource stocks from a rise in the price of oil and other commodities.

The Dow Jones industrial average <.DJI> gained 42.21 points, or 0.63 percent, to 6,768.23. The Standard & Poor's 500 Index <.SPX> added 4.99 points, or 0.72 percent, to 701.32. The Nasdaq Composite Index <.IXIC> rose 14.75 points, or 1.12 percent, to 1,335.76.

(Reporting by Leah Schnurr; Editing by James Dalgleish)