U.S. stocks lost early gains on Wednesday as the U.S. dollar strengthened further, pressuring commodity prices and stocks in the energy and materials sectors.

The dollar gained ground against the euro as uncertainty over Greece's public finances continued to pressure the single currency.

The Dow Jones industrial average <.DJI> gained 9.67 points, or 0.09 percent, to 10,278.48. The Standard & Poor's 500 Index <.SPX> gained 0.71 points, or 0.06 percent, to 1,095.58. The Nasdaq Composite Index <.IXIC> gained 0.49 points, or 0.02 percent, to 2,214.68.