Updated from 4:11 p.m. EDT

Stocks got off to a slow start Tuesday, but an afternoon bounce in the chip sector turned the broader market around and lifted Wall Street to a higher close.

The Dow Jones Industrial Average recovered from a 75-point loss earlier in the session and finished up 31.22 points, or 0.28%, at 11,134.77. The S&P 500 added 5.18 points, or 0.41%, to 1272.52, and the Nasdaq Composite advanced 11.93 points, or 0.56%, to 2128.86, after having been down by as many as 21 points.

The rebound followed comments from KLA-Tencor ( KLAC) CEO Rick Wallace, who said his company had a "very good quarter." During his remarks, made at an analyst meeting in San Francisco, Wallace also said the chip-equipment maker appears to have beaten its bookings target for the June quarter.

KLA jumped $3.23, or 8.2%, to close at $42.56. The gain helped boost the Philadelphia Semiconductor Sector Index 3.3%.

"The market has been in a struggling recovery trend," said Phillip Roth, chief technical market analyst with Miller Tabak. "The benefit of the doubt goes to the upside. The weakest area has been tech, which was oversold. The reversal encouraged people today. The leadership is pretty good and has a chance to be sustained."

About 1.57 billion shares changed hands on the New York Stock Exchange, with advancers beating decliners by a 5-to-3 margin. Volume on the Nasdaq was 2.01 billion shares, and winners outpaced losers 9 to 7.

Sellers were in control before the KLA news, as disappointing numbers from Lucent ( LU) and Alcoa ( AA), the Dow's biggest drag, pressured the market. Late Monday, Alcoa posted a 62% year-over-year increase in its second-quarter profits, but its revenue fell short of Wall Street's expectations.

The aluminum producer had earnings of $744 million, or 85 cents a share, up from $460 million, or 52 cents a share, a year earlier. Earnings from continuing operations totaled $752 million, or 86 cents a share. Revenue rose to $7.96 billion from $6.69 billion a year earlier, but analysts were looking for $8.02 billion. Shares fell $1.63, or 4.9%, to $31.78.

Elsewhere, Lucent, the telecom gear-maker with a history of under-delivering, lowered its third-quarter guidance, citing a slowdown in wireless sales. Lucent forecast a profit of 2 cents a share for the latest quarter on revenue of $2.04 billion. Analysts surveyed by Thomson Financial were looking for a 4-cent profit on sales of $2.34 billion.

While Lucent's warning might have been a drag on the broader tech sector, the company's days of cutting its projections are drawing to an end. The company is planning to merge with France's Alcatel ( ALA), and it said the transaction is on track to close by the end of the year. Lucent added that the companies should be able to meet their cost-cutting targets. Lucent closed lower by 15 cents, or 6.4%, to $2.19.

"Lucent and Alcoa are weighing on the market, after investors have already been scrutinizing corporate profits," said Peter Cardillo, chief market strategist with S.W. Bach & Co. "There's no economic data out today, so all the focus is on earnings."

Away from stocks, seven explosions killed or injured dozens of people traveling during rush hour on a commuter rail in Bombay, the financial center of India. Both that city and New Delhi are on high alert.

On the economic front, the Office of Management and Budget said Tuesday that unexpectedly strong government revenue helped cut the federal budget deficit to $296 billion from $423 billion. While the previous figure represented 3.2% of gross domestic product, the revised number is 2.3% of GDP.

Commodities trended higher Tuesday. Crude tacked on 55 cents to $74.16 a barrel in Nymex trading and is now a little more than $1 below its all-time high reached late last week. Gold surged $17 to $643.10 an ounce, silver rose 44 cents to $11.50 an ounce, and copper was higher by 5 cents to $3.63 a pound.

The 10-year Treasury was up 6/32 in price and yielding 5.10%. The dollar was lower against the yen and the euro.

Shares of Pepsi Bottling ( PBG) finished up 5% after the company posted a second-quarter profit of $148 million, or 61 cents a share, nearly unchanged from a year ago. Excluding items, the company earned 69 cents a share, beating the Thomson First Call consensus of 59 cents a share.

Pepsi Bottling also raised its full-year profit forecast and its projection for volume growth. The stock gained $1.61 to $33.96.

After the close Tuesday, earnings reports are expected from restaurant chains Ruby Tuesday ( RI) and California Pizza Kitchen ( CPKI).

Research calls saw Lehman Brothers downgrade Hess ( HES) to underweight from equal-weight and cut Murphy Oil ( MUR) to equal-weight from overweight. Still, Hess managed to gain $1.46, or 2.7%, to $54.78. Murphy Oil fell 49 cents, or 0.9%, to finish at $55.65.

UBS initiated coverage on several telecom stocks. The firm assigned a neutral rating to ADC Telecom ( ADCT), Adtran ( ADTN) and Juniper Networks ( JNPR).

The airline sector was one of the worst performers Tuesday after Merrill Lynch downgraded Continental Airlines ( CAL), U.S. Airways Group ( LCC) and AMR ( AMR) to neutral from buy, citing their valuations.

The Amex Airline Index gave up 1.5%. U.S. Airways tumbled 4.3% to $53.45, AMR lost 1.5% to $27.25, and Continental was off 1.2% to $31.35.

Overseas equities were lower. London's FTSE 100 was down 0.7% at 5857, and Germany's Xetra DAX gave up 1.6% to 5616. Japan's Nikkei lost 0.5% to 15,474, and Hong Kong's Hang Seng fell 0.7% to 16,490.