Crude oil hitting new highs near $114 also lifted the energy sector, providing support to the broader market.
"We didn't get another Wachovia today," said Owen Fitzpatrick, head of the U.S. equity group at Deutsche Bank.
Wachovia posted an unexpected quarterly loss Monday, a stark reminder of the credit-market troubles crippling results in the financial sector and elsewhere.
"The market is digesting the whole banking and financial issues, but the market has still to digest the recession story and how much of damage to earnings we'll get," Fitzpatrick said.
The Dow Jones Industrial Average gained 26 points to 12,328, with 19 of its 30 components rising.
Financial stocks powered the advance in the broad market and on the Dow, with gains led by Citigroup Inc. , JP Morgan Chase and Bank of America . Bear Stearns , which is being bought by J.P. Morgan, said its quarterly profit fell 79%.
Chevron Corp. and Exxon Mobil Corp. also gained ground, along with broad gains in the energy sector.
Also on the Dow, Johnson & Johnson rose 0.1% after posting upbeat earnings, while Intel Corp. fell 0.3% to $20.61, ahead of its earnings after the close.
The S&P 500 index rose 0.3 points to 1,328, while the Nasdaq Composite traded flat at 2,275.
On the economic front, manufacturers in New York state were once again positive about the economy in April, the New York Federal Reserve Bank reported. The Empire State index jumped nearly 23 points in April to 0.6 from negative 22.2 in March.
Wholesale prices soared 1.1% in March, led by rising energy and food prices, the Labor Department reported. But the core producer price index, which excludes volatile food and energy, rose only 0.2%. Economists surveyed by MarketWatch had expected the PPI to rise 0.4% and the core to rise 0.2%.
The dollar strengthened slightly after the data, while crude futures spiked to a fresh high. Light crude futures contracts hit $112.97 and were recently up $1.04 a barrel at $112.80, helped by supply disruptions.
Earnings season also swung into full gear Tuesday as State Street Corp. reported a 69% rise in first-quarter net income to $530 million, or $1.35 a share. Adjusted earnings were $1.39, topping the $1.30 expected by analysts.
Investors were also digesting what the proposed merger of Delta Air Lines Inc. and Northwest Airlines Corp. would mean for other U.S. carriers.
Delta and Northwest said Monday that they had agreed to a $17.7 billion merger deal in what would create the world's second-largest carrier after Air France-KLM, raising investor hopes that the emerging company will be better positioned to deal with the soaring price of fuel and a more competitive global environment.
Northwest shareholders are to receive 1.25 Delta shares for each share they own, representing a 16.8% premium over April 14 closing prices.
Also in the spotlight, shares of AstraZeneca rose in London after reaching a settlement with Indian drugmaker Ranbaxy on a copycat version of its drug Nexium. Ranbaxy won't start making a generic version until May 2014.
Indian software giant Infosys Technologies said current fiscal-year earnings per share would grow by at least 16%, matching market forecasts.
By Nick Godt