NEW YORK (AP) -- Stocks finished mostly higher Thursday as another day of mixed trading showed the market's recent rally losing some strength. Chipmakers rose, while drugmakers fell.
Chipmakers Xilinx and Lam Research soared and many of their peers also climbed as investors, many of whom have been pessimistic about demand for computer chips recently, saw signs of life in the business. The Philadelphia Semiconductor Index rose to its highest level since early December. Airlines also rose after several strong quarterly reports.
About two-thirds of the stocks on the New York Stock Exchange closed with gains, but major stock indexes didn't move much. Drugmakers including Merck and Pfizer took sharp losses, and spice maker McCormick had its biggest drop in 13 years. Other household products companies also sank.
The S&P 500 index rose 3.63 points, or 0.1 percent, to 2,642.33. The benchmark U.S. index is up 12.4 percent over the last month, but it's slipped 1.1 percent this week after big gains in each of the past four weeks. The Dow Jones Industrial Average dipped 22.38 points, or 0.1 percent, to 24,553.24.
Thanks to the big gains for technology companies, the Nasdaq composite added 47.69 points, or 0.7 percent, to 7,073.46. The Russell 2000 of small-company stocks gained 10.15 points, or 0.7 percent, to 1,464.41.
Brad McMillan, chief investment officer for Commonwealth Financial Network, said Wall Street analysts had become pessimistic in the last few months and thought this round of company earnings might be a big disappointment. As a result, they cut their forecasts for companies.
"There's an expectation that things are going to be terrible, but in fact things aren't terrible at all," he said. McMillan added that results from banks have been good, which suggests the U.S. economy is in decent shape.
"That's a sign, for all the worries about the economy, that things aren't as bad as people think they are," he said.
Xilinx surged 18.4 percent to $106.06 after its third-quarter results topped expectations. The company said it's benefiting from the expansion of 5G wireless networks in South Korea and preparations for deployment in China and North America, while several automakers are talking about using Xilinx products in autonomous cars. It made its biggest gain in 27 years.
Lam Research gained 15.7 percent to $161.20, its best day in 14 years, and Texas Instruments rallied 6.9 percent to $102.09 after their reports. Intel, the world's largest chipmaker, gained 3.8 percent to $49.76.
But if the companies are on the road to recovery, the ride doesn't look smooth. Intel tumbled 7.1 percent in aftermarket trading after its fourth-quarter results and its forecasts for the current year both disappointed investors.
American Airlines rallied 6.4 percent to $33.66 after reporting solid results in its latest quarter, and Southwest climbed 6.3 percent to $54.21. Southwest said the partial shutdown of the federal government could cost it up to $15 million in revenue this month, echoing Delta's statement that it could lose $25 million in revenue. While that's noticeable, it's a relatively small portion of their total revenue.
Among drug companies, Merck fell 3 percent to $73.17 and Pfizer lost 2.9 percent to $40.95 while Eli Lily slid 3.2 percent to $114.99.
McCormick slumped 10.5 percent to $124.35 after its quarterly profit and revenue both fell short of expectations. Investors were also disappointed with the spice and seasonings company's forecasts for 2019. The company has dramatically outperformed the broader stock market for the last few decades, and Thursday was its largest loss since September 2005.
Utility company PG&E surged 74.6 percent to $13.95 after investigators ruled that the company was not at fault for a North California wildfire that killed 22 people in 2017. The stock has plunged since November on concerns the company might be liable for billions of dollars in damages caused by that fire, and for the Camp Fire of 2018, which killed at least 86 people and destroyed 15,000 homes.
Those potential liabilities pushed the company to file for bankruptcy this month.
The European Central Bank did not change its interest rates or its projection for when it might start raising them. European Central Bank head Mario Draghi says risks to the European economy are increasing and the bank is ready to "adjust all of its instruments" if it runs into serious trouble.
The ECB is aiming to raise rates even though the European economy has cooled as countries including Germany have lost some strength. Schroders Investment Strategist Marina Severinovsky said the bank probably should have started raising rates in 2017, when the global economy was growing at a stronger pace.
"The ECB probably missed a key opportunity when markets were riding high," she said. "That may have been a time to move with more decisiveness."
Bond prices moved higher. The yield on the 10-year Treasury note fell to 2.71 percent from 2.75 percent.
U.S. crude oil rose 1 percent to $53.13 per barrel in New York. Brent crude, used to price international oils, slipped 0.1 percent to $61.09 per barrel in London.
Wholesale gasoline and heating oil both finished little changed, at $1.39 a gallon and $1.89 a gallon, respectively. Natural gas jumped 4 percent to $3.10 per 1,000 cubic feet.
The dollar edged up to 109.67 yen from 109.59 yen. The euro fell to $1.1299 from $1.1383.
Germany's DAX climbed 0.5 percent and the French CAC 40 rose 0.7 percent. The FTSE 100 in Britain slid 0.3 percent.
Hong Kong's Hang Seng picked up 0.4 percent and Japan's Nikkei 225 index declined 0.1 percent.