* Bank shares rise even as Fannie, Freddie shares slump
* Material, energy stocks up; oil edges higher
* Hewlett-Packard earnings reassure investors
* Dow, S&P up 0.6 percent; Nasdaq up 0.2 percent (Recasts first two paragraphs, adds Bank of America)
By Steven C. Johnson
NEW YORK, Aug 20 (Reuters) - U.S. stocks rose on Wednesday as bank and energy shares rebounded even as investors dumped Fannie Mae and Freddie Mac on fears of an imminent government bailout of the housing finance companies.
A 14 percent jump in quarterly profit for computer maker Hewlett-Packard <HPQ.N> also helped boost the S&P 500 and raised hopes that overseas demand would continue to support technology spending. HP shares rose more than 5 percent.
Expectations that an imminent government bailout of Fannie and Freddie would wipe out shareholders drove the stocks to almost two-decade lows.
But because any bailout would be aimed at saving the housing and mortgage market, shares of big banks rose. Shares of top mortgage lender Wells Fargo & Co <WFC.N> rose 4.1 percent.
Energy shares also posted strong gains, supporting the S&P 500, with shares of oil producer and refiner Hess Corp <HES.N> rising 5.3 percent and ConocoPhillips <COP.N> up 2 percent.
Oil gained for a second straight day, settling up 45 cents at $114.98 as concerns swirled about Russia's possible reaction to a U.S.-Poland missile shield. Also, Goldman Sachs reiterated its year-end forecast of $149 a barrel for U.S. crude. For details, see [
]"Going into the day some reasonably good earnings gave us a positive bias, and also it seems to me that the commodity stocks, which have been pretty beaten up, are having a very strong rebound," said Eric Kuby, chief investment officer at North Star Investment Management in Chicago.
"But this may be just bargain hunting, as I haven't seen any economic numbers that would be driving this."
The Dow Jones industrial average <
> was up 68.88 points, or 0.61 percent, at 11,417.43. The Standard & Poor's 500 Index <.SPX> was up 7.85 points, or 0.62 percent, at 1,274.54. The Nasdaq Composite Index < > was up 4.72 points, or 0.20 percent, at 2,389.08.The S&P Financial index <.GSPF> gained 1.67 percent. Wells Fargo & Co shares rose 4.1 percent to $28.92, while Bank of America <BAC.N>, also a top mortgage lender, gained 4.3 percent to $29.29.
On the downside, shares of Fannie Mae <FNM.N> and Freddie Mac <FRE.N> lost more than 22 percent each. Shares of Fannie Mae, the biggest U.S. provider of housing finance, plunged 26.8 percent to $4.40, while Freddie shares fell 22.1 percent to $3.25.
"Until (the Fannie and Freddie) issue gets resolved, you'll continue to have that uncertainty, and it will be hard for the market to make any progress in that atmosphere," said Alan Lancz, president of Alan B. Lancz & Associates Inc, an investment advisory firm in Toledo, Ohio.
Shares of HP rose 5.7 percent to $46.16, their best one-day gain in six months, and were a main boost on both the Dow and S&P 500.
Shares of iPod maker Apple Inc <AAPL.O> rose 1.3 percent to $175.84, while Research In Motion Ltd <RIM.TO> <RIMM.O> shares gained 3.4 percent to $130.28 after Citigroup reiterated its "buy" rating on stock of the BlackBerry maker.
Hess Corp <HES.N> climbed 5.6 percent to $104.00, while ConocoPhillips <COP.N> rose 2 percent to $80.85.
Investors "are finally recognizing the strong fundamentals that those stocks have despite what the price of oil is on a weekly basis," said Michael Koskuba, portfolio manager and analyst with Victory Capital Management.
Material shares also had a strong day, with the S&P Materials Index up 2.1 percent. Shares of Freeport-McMoran <FCX.N> rose 7.5 percent after Morgan Stanley noted a declining spread between the London Metal Exchange and Shanghai copper prices, suggesting that a replenishing of Chinese inventories is near and bodes well for the copper and gold miner.
On the downside, concerns about consumer weakness sent shares of big manufacturers down. Textron Inc <TXT.N> lost 3.6 percent to $38.59
Trading volume was light on the New York Stock Exchange, with about 1.1 billion shares changing hands, below last year's estimated daily average of roughly 1.90 billion, while on Nasdaq, about 1.8 billion shares traded, also below last year's daily average of 2.17 billion.
Advancing stocks outnumbered declining ones by about 1.2 to 1 while on the Nasdaq, decliners just edged advancers by about 1.1 to 1. (Additional reporting by Walter Brandimarte and Kristina Cooke; Editing by Leslie Adler)