By Joe Wallace and Caitlin McCabe

U.S. stocks pared their gains Tuesday after fresh data showed that U.S. manufacturing activity, while expanding, continues to be affected by rising commodities prices, materials shortages and difficulties in the labor market.

The S&P 500 was little changed, following a fourth consecutive monthly advance for the broad index. The Dow Jones Industrial Average rose about 110 points, or 0.3%. The technology-focused Nasdaq Composite traded lower, falling 0.3% after initially rising to the start the day.

All three major indexes were trading off from larger gains notched earlier in the session.

Investors have grown more confident that rising inflation won't lead central banks to unwind stimulus measures, pushing major indexes back toward all-time highs in recent weeks. Data showing a jump in U.S. inflation had prompted markets to stutter earlier in May. The S&P 500 closed Friday at its third-highest level in history.

"The market is relatively sanguine about the inflationary pressure building," said Brian O'Reilly, head of market strategy for Mediolanum International Funds. "It is still a liquidity-driven equity market that is brushing off any bit of bad news," he added, pointing to President Biden's $6 trillion budget plan as the potential catalyst for further gains.

Still, other headwinds weigh on stocks. Valuations for some companies look high, particularly among growth and technology stocks, while investors have become increasingly concerned about elevated commodities prices, as well as supply chain setbacks and an uneven labor market recovery.

On Tuesday, the Institute for Supply Management said its purchasing-managers index of manufacturing activity picked up in May, registering at 61.2, versus 60.7 in April. The figure exceeded analyst expectations as demand boosted new orders. But the report also indicated that the U.S. manufacturing economy is grappling with record-long lead times, transportation bottlenecks, shortages of critical basic materials and worker absenteeism.

In corporate news, shares of Cloudera jumped 24%. Private-equity firms KKR and Clayton Dubilier & Rice agreed to buy the software company for roughly $5.3 billion in a deal that would take Cloudera private.

AMC Entertainment, a popular stock among individual traders, added 14%. The movie-theatre operator said it had sold new shares valued at $230.5 million to Mudrick Capital Management, raising cash at a premium to its closing stock price from Friday.

Other favorites among amateur investors rallied, including cannabis company Sundial Growers, which rose 4.2%. Videogame retailer GameStop added 7.9%.

In the bond market, the yield on the 10-year Treasury note edged up to 1.637%, from 1.592% Friday. Yields, which rise when bond prices fall, have waffled around the 1.6% mark since mid-April.

Brent-crude futures, the benchmark in international energy markets, rose 2.8% to $71.24 a barrel, putting them on track to close above $70 for the first time since May 2019. Prices have been bolstered by a decline in global stockpiles of oil that ballooned in the early stages of the pandemic.

Members of the Organization of the Petroleum Exporting Countries and their allies agreed Tuesday to pump more oil starting in July.

In overseas markets, the Stoxx Europe 600 rose 0.8%. The Shanghai Composite Index rose 0.3%, and Japan's Nikkei 225 ticked down 0.2%.

Write to Joe Wallace at Joe.Wallace@wsj.com and Caitlin McCabe at caitlin.mccabe@wsj.com

(END) Dow Jones Newswires

06-01-21 1124ET