U.S. stocks gained on Wednesday as results from banks, including Morgan Stanley, topped expectations, and on increased optimism about the technology sector's profit outlook.

The energy sector also supported the market as the price of oil rose above $80 a barrel after data showed a smaller-than-expected rise in U.S. crude stockpiles. Chevron gained 1.1 percent to $77.89.

Among tech shares, SanDisk Corp surged 9.9 percent to $23.60 as it said it was seeing strong demand in the mobile phone market, while Yahoo Inc climbed 3.7 percent to $17.83, noting advertising showed signs of life last quarter.

The tech arena has been the stalwart, earnings-wise, said Alan Lancz, president of Alan B. Lancz & Associates Inc in Toledo, Ohio.

The product cycle has been pretty interesting because ... that's one area where the consumer has not backed off.

Morgan Stanley jumped 6 percent to $34.46 after it posted a profit after three quarters of losses on strong fixed-income sales and trading revenues.

Wells Fargo & Co and U.S. Bancorp results were boosted by revenue from underwriting mortgages, but the windfall could moderate as applications fall. U.S. Bancorp gained 6.6 percent to $25.36, while Wells retreated from earlier gains to slip 1.1 percent to $30.10. [ID:nN21445068] The KBW banks index <.BKX> rose 0.3 percent.

The Dow Jones industrial average <.DJI> gained 24.79 points, or 0.25 percent, to 10,066.27. The Standard & Poor's 500 Index <.SPX> rose 3.68 points, or 0.34 percent, to 1,094.74. The Nasdaq Composite Index <.IXIC> was up 8.29 points, or 0.38 percent, at 2,171.76.

Although the banks' robust results cheered the market, analysts raised concerns over how sustainable these types of profits would be in the long term.

The Dow's gains were limited as Boeing Co shed nearly 1 percent to $51.42 after the airplane maker and U.S. defense contractor posted a net loss on charges related to its long-delayed 787 plane and the 747 program.

Apple Inc rose along with technology shares to hit a record intraday high of $206.20 on Nasdaq; the stock was last up 3.2 percent at $205.14. Google Inc was up 1 percent at $557.29.

(Editing by Jan Paschal)