NEW YORK (AP) -- Early gains on Wall Street vanished by early afternoon Tuesday following lower profits from technology companies and a steep drop in oil prices.
The Dow Jones industrial average was down 28 points to 12,707 at 1:40 EST. It was up 94 shortly after the opening bell.
The broader Standard & Poor's 500 slipped six points to 1,346. The Nasdaq dropped 16 points to 2,916.
Chip maker Advanced Micro Devices fell sharply after reporting that a slowdown in China and Europe led to an 11 percent slump in second-quarter revenue. The company had previously forecast a gain of 3 percent. Other technology companies also fell.
The bad news outweighed hopeful developments in Europe. Early Tuesday, European finance ministers agreed on the terms of a bailout for Spain's banks. The first installment of $37 billion in aid can be ready by the end of the month. But investors were concerned that some details seemed to be missing from the plan.
Adding to the uncertainty is a slew of upcoming corporate earnings reports. Financial analysts expect companies in the S&P 500 will report profits fell 1 percent in the April through June period from a year ago. That would be the first drop in nearly three years.
"The past quarter was great, but going forward many companies may have problems," said Joe Kinahan, chief derivatives strategist at TD Ameritrade, a brokerage. "People are confused about what to think."
A resolution to a labor dispute in Norway weighed on oil prices, which pushed energy stocks lower. Early Tuesday, the Norwegian government intervened to end a strike that threatened North Sea oil production.
Benchmark crude oil fell nearly $1 to $85.25 a barrel in New York. Major energy companies fell as a result, including Occidental Petroleum, down $1.10 at $84.09, and ConocoPhillips, down 52 cents at $53.81.
Natural gas producers also took a hit from a sharp drop in the price of natural gas, which was down 2 percent at $2.81 per 1,000 cubic feet. Cabot Oil & Gas slumped 78 cents to $39.49 and Chesapeake Energy gave up 93 cents to $19.06.
In Europe, the deal to aid Spain helped push the yield on its benchmark 10-year government bond down to 6.8 percent. On Monday, that country's key borrowing rate surged to 7 percent, a dangerously high level. The lower yield means investors are less fearful about the country having trouble paying its debts.
Portugal, Ireland and Greece all had to ask for help from international lenders after spikes in their own borrowing rates made it unaffordable for them to raise money from selling bonds on the open market. Spain is the largest European country to date to seek international assistance.
In corporate news, Applied Materials, which makes equipment for chipmakers, cut its fiscal year profit and sales estimates because of weak demand. The stock fell 29 cents to $10.73.
Embattled BlackBerry maker Research in Motion fell 35 cents to $7.32. The company's CEO, Thorsten Heins, told a shareholders meeting that he isn't satisfied with the company's performance. Two weeks ago the company announced disappointing earnings, plans to cut 30 percent of its workforce and the latest delay in BlackBerry 10.
Alcoa lost 29 cents to $8.47 after a financial analyst cut his estimate for the company's 2012 earnings. The aluminum maker was the biggest loser among the 30 companies in the Dow index. Alcoa reported Monday that it beat analyst estimate for earnings in the second quarter but that revenue dropped due to slowing world demand for the metal.