By Will Horner and Caitlin McCabe

U.S. stocks wavered Tuesday, moving between small gains and losses, as investors weighed supply-chain problems and signs of rising inflation against an improved economic outlook.

The S&P 500 index was about flat as of the 4 p.m. close of trading in New York, after rising earlier in the day to its second-highest intraday level on record. The Dow Jones Industrial Average fell slightly, losing about 30 points, or 0.1%.

The Nasdaq Composite added about 0.3%, marking a third-consecutive day of gains for the index of technology and growth stocks. Companies including Amazon.com and PayPal were among those that pushed the index higher.

Stocks have been range bound in recent sessions, with indexes hovering close to record levels due to a rebounding U.S. economy and support from Washington and the Federal Reserve. The market's moves in recent weeks have moderated amid inflation concerns. Investors say they are settling in for a period of choppy trading while they await fresh clues on whether a sharp rise in consumer prices will prove to be fleeting.

"There will be constant gut checks from both the bond and the stock markets on whether this is transitory, or is turning into permanently higher inflation," said David Donabedian, chief investment officer at CIBC Private Wealth Management. "I would still put the odds of a higher S&P 500 at the end of the year as better than 50%, but I think there will be more volatility than return to be had in the second half of the year."

Behind the market's recent choppy moves have been tepid trading volumes, analysts and traders say, as well as no strong catalyst to drive stocks. Though inflation remains top-of-mind for many traders, many remain hopeful after a strong first-quarter earnings season and amid signs that the U.S. economy is returning to normal. Many say they are awaiting fresh data Thursday on consumer prices for better clarity.

"Overall, the market is clearly hanging in there...and we're flirting with all-time highs," said Ryan Detrick, chief market strategist at LPL Financial. "We just need the next driver to get us there."

Among the S&P 500's sectors, shares of energy companies rallied, extending their outperformance over other groups this year. Companies including Exxon Mobil and Diamondback Energy each rose 2% or more, buoyed, in part, by a continued rise in oil prices. Brent-crude futures, the benchmark in international energy markets, rose 1% to $72.22 a barrel.

Among individual stocks, shares of Clover Health Investments soared 82%, on pace for a new all-time high, after the healthcare company emerged as the latest darling for retail traders on Reddit forums, building on its 32% gain Monday.

Other so-called meme stocks like GameStop and Bed Bath & Beyond also climbed. GameStop, which reports first-quarter earnings Wednesday, jumped 3.7%. Bed Bath & Beyond added 8%. AMC Entertainment Holdings lost 1% after trading higher earlier in the day.

Coupa Software dropped 6.7% after the company said it expected to post a loss in its 2022 fiscal year. Marvell Technology rose 3.9% after the chip maker posted record quarterly sales.

In bond markets, the yield on the benchmark 10-year U.S. Treasury note fell to 1.537%, from 1.570% Monday. Bond yields drop when prices climb. While worries about a sharp and sustained spike in inflation have abated somewhat, money managers are continuing to assess whether it may erode the returns from fixed-income assets.

"You are beginning to see data which suggest that while elevated inflation might be transitory, the time horizon implied by the word 'transitory' is getting longer," Mr. Donabedian said. "If the inflation data is going to persist on the high side for the next six to nine months, then the Fed is going to have to clarify what it means by transitory."

Bitcoin prices continued to fall, hovering close to their lowest level since late January. The cryptocurrency fell 6.6% from its 5 p.m. ET level Monday to about $32,181, according to CoinDesk.

Overseas, the pan-continental Stoxx Europe 600 rose 0.1%, settling at a fresh all-time high.

In Asia, stock indexes mostly edged lower by the close of trading. Japan's Nikkei 225 slid 0.2%. In Hong Kong, the Hang Seng Index was relatively unchanged from the prior day. China's Shanghai Composite Index fell 0.5%.

Write to Will Horner at William.Horner@wsj.com and Caitlin McCabe at caitlin.mccabe@wsj.com

(END) Dow Jones Newswires

06-08-21 1617ET