Updated from 4:08 p.m. EDT

Stocks managed to close with slight gains Tuesday after much meandering, amid a worrisome outlook from

General Motors

(GM) - Get Report

and weak economic figures.

Earnings reports due after the bell from

Microsoft

(MSFT) - Get Report

and

Intel

(INTC) - Get Report

also contributed to the nervous tone.

The

Dow Jones Industrial Average

climbed 51 points, or 0.6%, to 8402, while the

Nasdaq

gained 6 points, or 0.4%, to 1391. The

S&P 500

rose 5.5 points, or 0.6%, to 890.

On the NYSE, 1.4 billion shares traded hands, with winners outpacing losers by almost two to one. Some 1.3 billion shares changed hands on the Nasdaq, with advancers and decliners running about even.

"It's a short week, so people are starting to take some time to peel off and analyze results," said Jim Awad, president of Awad Asset Management. "It's still early in the process, so investors are making tentative bets until the numbers start to settle down."

GM posted a first-quarter profit of $2.71 a share, up from 57 cents a share a year earlier. But GM said it "is now less certain of its ability to achieve prior 2003 guidance of $5 earnings per share" because of uncertain economic conditions. GM shares shed 2.8% to $35.10.

Meanwhile,

IBM

(IBM) - Get Report

reported lower-than-expected earnings Monday, but beat analysts' sales estimates. Profit rose 16%, while revenue had an 11% increase. The company also said it expects to meet forecasts for 2003 sales and profit. IBM shares gained 2.5% to $82.61.

The Empire State Manufacturing Survey, a gauge of manufacturing conditions in New York State, fell to negative 20.4 in April, the lowest level since October 2001, compared with negative 2.8 in March. Any negative reading means companies felt the environment deteriorated rather than improved in the month. Also, a Federal Reserve report showed that industrial production contracted 0.5% in March, slightly more than the 0.2% expected, compared with a 0.1% decline the previous month. Capacity utilization was also lower, at 74.8%, from 75.3% the prior month.

Johnson & Johnson

(JNJ) - Get Report

said earnings shot up to $2.1 billion, or 69 cents a share, from $1.83 billion, or 59 cents a share, in the year-ago quarter. That topped estimates of 68 cents. Sales jumped 13% to $9.82 billion. But sales of anemia treatment Procrit, Johnson & Johnson's best-selling drug, grew only 1% in the quarter. The company's shares fell 3.2% to $55.92.

Hewlett-Packard

(HPQ) - Get Report

, IBM's rival, declined after Merrill Lynch analysts downgraded the stock to neutral following IBM's disappointing hardware sales. Hewlett-Packard shares finished 2.2% lower at $15.54.

Continental Airlines

(CAL) - Get Report

posted a wider first-quarter loss to $221 million, or $3.38 per share, but it was better than the $3.43 loss per share analysts had expected. Shares of the company rose 13.5% to $6.46.

Meanwhile, American Airlines' parent,

AMR

(AMR)

, shares rose 10.4% to $3.40 before being halted, amid uncertainty about whether unions would accept or reject a wage-cut plan.

Computer-chip designer

Rambus

(RMBS) - Get Report

posted second-quarter earnings of 5 cents a share, compared with 7 cents a share last year. Revenue rose to $28 million from $24 million. The company said it expects sales to remain flat in the third quarter. Rambus shares finished 5.7% lower at $14.87.

Meanwhile, a lawsuit that will be filed by the Minnesota State Board of Investments alleges that

AOL Time Warner

(AOL)

overstated revenue by $1.7 billion,

The New York Times

reported. AOL shares moved 1.2% lower to $12.36.

Chip-equipment maker

Novellus

(NVLS)

said second-quarter earnings will be 5 cents a share, below the 9 cents analysts had been expecting. The company cited severe acute respiratory syndrome, or SARS, as a reason for a drop in orders. Novellus shares lost 3.6% to $26.38.

Bank One

(ONE) - Get Report

said revenue fell 4.6% to $3.97 billion, while profit was a penny lower than expected. Its shares shed 1.4% to $36.32.

HCA

(HCA) - Get Report

, said it expects first-quarter profit will rise less than expected because of fewer hospital admissions. The company forecast earnings of 81 cents to 83 cents a share, compared with analysts' estimates of 88 cents a share. The company's shares finished 19.6% lower at $28.99.

Metal mining company

Phelps Dodge

(PD) - Get Report

restated its financial results for the three years ended in 2002, following a review by the

Securities and Exchange Commission

. Shares climbed 0.7% to $33.15.

On the war front, the U.S. military said the fighting in Iraq was mainly finished and that a potentially long rebuilding process was underway. Two of five aircraft-carrier battle groups stationed in the Persian Gulf were being sent home.

"I would anticipate that the major combat engagements are over," Maj. Gen. Stanley McChrystal said at the Pentagon. "I think we will move into a phase where it is smaller, albeit sharp fights."

Bond prices were higher, with the yield on the 10-year note down 4 basis points at 3.97%. Nymex crude was up 2.6% at $29.29. Gold prices were lower, while the dollar was higher against the euro and yen.

Overseas markets were higher, with London's FTSE 100 up 1.7% at 3915 and Germany's Xetra DAX up 3.1% at 2863. In Asia, Japan's Nikkei gained 1.1% to end at 7838, while Hong Kong's Hang Seng rose 1.2% to close at 8632.

U.S. stocks were coming off a rally Monday, when the Dow Jones rose 148 points to 8351 and the Nasdaq added 26 points to 1384. The S&P 500 climbed 17 points to 885.