By Will Horner

Major U.S. stock indexes ended the day with small gains Wednesday as concerns around the consequences of a strong economic recovery, marked by inflation, continued to buffet the market.

The S&P 500 bounced around the flatline in afternoon trading, then finished 0.15% higher. The Dow Jones Industrial Average rose less than 0.1%, or 26 points, and the Nasdaq Composite picked up 0.1%.

Communication, consumer discretionary and material stocks all dragged the market lower as investors gravitated again toward the reopening trade and energy sector.

The market's more seismic moves were concentrated around a handful of stocks popular with individual investors, including AMC Entertainment and BlackBerry. Both of those stocks are on a tear again after surging earlier this year.

The major indexes, which are hovering close to all-time highs on the back of unprecedented fiscal and monetary support, are struggling for traction this month as investors look for ways to justify the high valuations already commanded by many stocks. On Tuesday, manufacturing data pointed to an expansion in factory activity driven by demand for goods, but also highlighted growing supply bottlenecks.

"Investors are much more anxious as we enter the midpoint of the year," said Michael Arone, chief investment strategist for State Street Global Advisors. He pointed to the increasingly common signs that inflation has taken hold as being one of investors' bigger issues right now, followed by questions of whether profits and growth have already peaked and determining where the U.S. is in the current economic cycle.

"Investors who like to align themselves with the economic cycle are finding this all problematic," he said.

The view is more clear-cut for Mr. Arone who says the rollout of Covid-19 vaccinations ushered in a renewed economic cycle that has been distorted by loose monetary policy and heavy economic stimulus.

Companies that are more sensitive to the economy, such as banks and firms powered by consumer spending, are likely to perform well, according to Willem Sels, global chief investment officer at HSBC Private Bank. He also favors stocks that will benefit from government spending on infrastructure and sustainability. Concerns that the Fed may pare back on quantitative easing measures due to inflation pressures are likely to continue prompting unease in markets, he added.

"There will be data points coming out in the coming weeks that will be very strong, and they will point to inflation pressures," Mr. Sels said. "More and more people will be wondering if the Fed will stick to its position or change, and that will inevitably lead to volatility."

On Wednesday, energy stocks led the market higher, with oil-field services Schlumberger rising 7.7% and Halliburton adding 4.3%.

Reopening stocks like American Airlines gained nearly 5%, while Carnival rose 3.9%. Microchip stocks also helped boost the market, with Nvidia and Advanced Micro Devices all notching advances.

Meanwhile, the S&P 500's consumer discretionary sector fell 0.4%, coinciding with a 3% slide in Tesla stock following a Wall Street Journal report that the electric car maker failed to oversee Chief Executive Elon Musk's tweets.

The index's materials sector also fell, shedding 0.9%, while industrials slipped 0.3%.

Frothy assets charted their own path Wednesday. Meme stock AMC shares skyrocketed 95% in the wake of news that it sold stock to hedge fund Mudrick Capital. BlackBerry shares got in on the rally, rising 32%, as did GameStop, which added 13%.

Dogecoin jumped after Coinbase Global said it would allow users to trade the currency on a platform geared toward more experienced investors. The cryptocurrency initially founded as a joke rose 25% over the past day.

In bond markets, the yield on the 10-year U.S. Treasury note edged lower to 1.599%, from 1.613% Tuesday. Yields drop when bond prices climb.

Investors are also monitoring surging commodity prices, which are feeding into those inflation concerns and weighing on sentiment, said Esther Baroudy, a senior portfolio manager at State Street Global Advisors.

"You have got a very, very big recovery going on and it is pushing up prices everywhere for basic commodities," she said. "A lot of it is driven by a roaring economy in the U.S. The manufacturing side of the economy, for example, is absolutely on fire."

Brent crude, the international energy benchmark, rose 1.4%, extending gains after OPEC forecast a rebound in demand.

Overseas, the Stoxx Europe 600 rose 0.3%. Major Asian stocks were mixed. Japan's Nikkei 225 rose 0.5%, while Hong Kong's Hang Seng Index fell 0.6%. In mainland China, the Shanghai Composite Index fell 0.8%.

-- Michael Wursthorn contributed to this article.

Write to Will Horner at William.Horner@wsj.com

(END) Dow Jones Newswires

06-02-21 1621ET