* Fannie and Freddie shares jump on rescue plan optimism
* Oil drops $4 on large builds in gasoline stocks
* Dow up 0.3 pct, S&P 500 up 0.4 pct, Nasdaq up 0.9 pct (Updates to close)
By Kristina Cooke
NEW YORK, July 23 (Reuters) - U.S. stocks rose on Wednesday as financial shares climbed on hopes lawmakers will approve a rescue plan for mortgage finance companies Fannie Mae <FNM.N> and Freddie Mac <FRE.N> and as the price of oil fell.
Financial shares rose after President George W. Bush dropped a threat to veto a housing rescue bill, clearing the way for measures aimed at stabilizing the battered housing market, which has been the source of huge losses for financial companies.
Removal of the presidential veto threat spurred investors to snap up shares of Fannie and Freddie, the top two U.S. housing finance companies, which would receive an emergency government lifeline under the bill.
Oil prices fell more than $4 after government data showed a big increase in U.S. inventories of gasoline, boosting companies sensitive to higher fuel costs, such as retailers and airlines.
"We're getting some positive spin from the lower oil price and also from the comments from the legislature on Fannie and Freddie," said Paul Nolte, director of investments at Hinsdale Associates, in Hinsdale, Illinois.
"And while earnings in general have been poor, investors are still welcoming these results. It's the analogy that if I was expecting you'd get a 'D' in math and you got a 'C,' I'd be pleased -- even though it's still only a 'C'."
The Dow Jones industrial average <
> rose 29.88 points, or 0.26 percent, to 11,632.38, while the Standard & Poor's 500 Index <.SPX> gained 5.11 points, or 0.40 percent, to 1,282.11, a three-week closing high. The Nasdaq Composite Index < > was up 21.92 points, or 0.95 percent, at 2,325.88.U.S. crude oil for September delivery fell $3.94 to $124.48 a barrel. While the drop in crude boosted the broader market, shares of major oil companies, such as Exxon Mobil <XOM.N>, fell. Exxon shares shed 2.3 percent to $80.99 and were the top drag on the S&P 500.
Robust results from Dow component AT&T <T.N> that showed stronger-than-expected wireless growth helped boost technology shares. Apple Inc <AAPL.O> led the Nasdaq higher after AT&T, the exclusive U.S. network carrier for the iPhone, said the launch of the iPhone 3G was strong.
But earnings reports painted a mixed picture. A drop in the shares of Boeing Co <BA.N>, another Dow component, kept gains in check on the blue chip index after the planemaker reported a bigger-than-expected drop in profit.
Boeing fell 3.7 percent to $66.72.
Industrial conglomerate Caterpillar <CAT.N> fell 3.4 percent to $72.42 after JPMorgan downgraded the company, citing the possibility that volumes may slow further in North America and Europe.
Financial shares rose, with the S&P financials sub-index <.GSPF> up 1.8 percent. Shares of Freddie Mac jumped 11.3 percent to $10.80, while Fannie Mae climbed 11.9 percent to $15.
Home builders also headed higher on optimism about the housing bill, pushing the Dow Jones home construction index <.DJUSHB> up 3.5 percent. Shares of luxury home builder Toll Brothers <TOL.N> rose 3.4 percent to $21.08.
Nolte and other analysts noted that given the Securities and Exchange Commission's clampdown on certain types of short selling in financial companies, some hedge funds were reversing the popular long-oil/short financials trade, heightening gains in financial stocks and the decline in oil.
Shares of AT&T <T.N>, the largest U.S. telecommunications company, jumped 3.9 percent to $33.06.
On the economic front, Federal Reserve said in its Beige Book that the pace of economic activity slowed somewhat through mid-July.
Trading was moderate on the New York Stock Exchange, with about 1.7 billion shares changing hands, below last year's estimated daily average of roughly 1.9 billion, while on Nasdaq, about 2.69 billion shares traded, above last year's daily average of 2.17 billion.
Advancing stocks outnumbered declining ones by 5 to 3 on the NYSE and by 4 to 3 on the Nasdaq. (Editing by Leslie Adler)