U.S. stocks inched lower for the third consecutive session on Tuesday driven by losses in communications stocks.

The Dow Jones Industrial Average lost 117.72 points, or 0.3%, to close at 34378.34. The S&P 500 declined 10.54 points, or 0.2%, to close at 4350.65 while the tech-heavy Nasdaq ticked down 20.28 points, or 0.1%, to close at 14465.92.

Stock...

U.S. stocks inched lower for the third consecutive session on Tuesday driven by losses in communications stocks.

The Dow Jones Industrial Average lost 117.72 points, or 0.3%, to close at 34378.34. The S&P 500 declined 10.54 points, or 0.2%, to close at 4350.65 while the tech-heavy Nasdaq ticked down 20.28 points, or 0.1%, to close at 14465.92.

Stock indexes have been dragged lower in choppy trading in recent weeks. Investors are contending with an energy crunch that threatens to add to inflationary pressures just as signs emerge that global economic growth is slowing. 

“Investors are running around like chickens with their heads cut off,” said John Buckingham, portfolio manager at Kovitz. “They focus on one thing at a time and buy and then change their mind and sell.”

Communications stocks led losses among the S&P 500’s 11 sectors, declining more than 1%. Google parent Alphabet Inc. slid $49.30, or 1.8%, to $2,728.98 and Facebook Inc. fell $1.68, or 0.5%, to $323.77. Steeply rising bond yields and regulation issues have dragged down tech shares in recent sessions.

Those losses were offset by gains among real estate and consumer discretionary stocks: MGM Resorts International rose $4.27, or 9.6%, to $48.69, its highest close since 2008, after Credit Suisse more than doubled its price target for the company. Other entertainment stocks joined the rally with Caesars Entertainment Inc. and Las Vegas Sands Corp. both adding around 2%.

General Motors Co. said it would recover from supplier LG Electronics Inc. nearly all of the $2 billion cost of recalling Chevrolet Bolt electric models for the risk of battery fires. Shares of the Michigan-based company rose 87 cents, or 1.5%, to $58.96.

Third-quarter earnings season, which begins this week, will provide clues on how companies are faring with price increases. Some of the U.S.’s biggest financial firms, including JPMorgan Chase and BlackRock, are set to kick off the reporting season Wednesday.

“The main topic will be inflation, there is some real concern about a winter of discontent,” said Brian O’Reilly, head of market strategy for Mediolanum International Funds. “We could see some volatility if companies don’t get their communications right on their cost pressures.”

Oil prices waffled in volatile trading Tuesday, but held near multiyear highs. West Texas Intermediate, the U.S. oil benchmark, gained 12 cents a barrel, or 0.1%, to $80.64, its highest settle value in nearly seven years. Brent crude, the international benchmark, lost 23 cents a barrel, or 0.3%, to $83.42. Crude prices have been on an extended climb in recent weeks amid a world-wide shortage of natural gas

Concerns about disappointing economic data also have increased for investors.

U.S. data showed job openings dropped to 10.4 million, missing forecasts of 10.9 million. Meanwhile, the International Monetary Fund lowered its growth forecast for the world economy for this year, citing supply-chain disruptions in rich economies and global-health concerns caused by the spread of the contagious Covid-19 Delta variant.

“There is a tone of worry on the data front, and that’s been the factor that hasn’t really turned around yet. We haven’t seen any strong reports that suggest that this is just a temporary Delta variant driven slowdown,” said Anwiti Bahuguna, senior portfolio manager and head of multiasset strategy at Columbia Threadneedle Investments.

The yield on the benchmark 10-Year U.S. Treasury note was little changed at 1.579%, the largest one-day decline in more than a week. Yields, which rise when bond prices fall, have been on an upward trajectory since the Federal Reserve strongly signaled last month it could start tapering its bond purchases as soon as November.

Overseas, the pan-continental Stoxx Europe 600 index declined less than 0.1%. In Asia, stock markets were broadly lower. In Japan, the Nikkei 225 lost 0.9%, while in Hong Kong, the Hang Seng Index fell 1.4%. In mainland China, the Shanghai Composite Index fell 1.2%.

Concerns about China’s struggling real-estate sector continued. Two board members of embattled developer Fantasia resigned, days after the company failed to make a $206 million bond payment. Its troubles add to worries that China’s property sector difficulties extend beyond Evergrande, whose failure to meet its debt payments raised concerns about a fresh drag on the world’s second-biggest economy.

A Fantasia Holdings residential development in Shanghai, China. Two board members of the Chinese developer resigned, days after the company failed to make a $206 million bond payment.

Photo: Qilai Shen/Bloomberg News

Write to Will Horner at william.horner@wsj.com and Hardika Singh at Hardika.Singh@wsj.com