By Anora Mahmudova, MarketWatch

NEW YORK (MarketWatch) -- U.S. stocks ended Tuesday with small gains, rebounding from three straight sessions of heavy selling. Trading throughout the day was choppy, however, as renewed tensions in Ukraine weighed on global markets.

The S&P 500 (SPX) ended the day 6.92 points, or 0.4%, higher at 1,851.96, moving above a key technical level. The benchmark index turned slightly positive for the year. Utilities and consumer discretionary sector stocks led the gains.

The Dow Jones Industrial Average (DJI) added 10.27 points, or 0.1%, to 16,256.14 by the end of the session.

The Nasdaq Composite (RIXF) rose 33.23 points, or 0.8%, to 4,112.99.

Follow MarketWatch's live blog of today's stock-market action.

Alcoa Inc. (AA) unofficially kicked off the first-quarter earnings season, posting results after the closing bell. The aluminum producer's adjusted earnings per share topped estimates, but revenue came in just below expectations. Shares rose 2.4% in after-hours action. Read: Why Alcoa earnings still matter

On Friday, J.P. Morgan Chase & Co. (JPM) and Wells Fargo & Co. (WFC) are set to release results.

More than 90 companies in the S&P 500 have warned profit will fall short of forecasts, according to FactSet data. Analysts fear a poor earnings season could derail this year's rally.

"Investors already lowered their expectations for the first-quarter earnings and it is not the results themselves but the forward guidance that will be key," said Chris Gaffney, senior market strategist, EverBank.

"The selling of high-momentum stocks is not surprising as their valuations were too high. We are now seeing a rotation from those highflying companies into large-cap cyclicals and dividend-paying defensive stocks," he added.

"Earnings results over the next month may give another indication of which parts of the economy were most impacted by winter storms (and we can expect that weather is likely to get the blame for any shortfalls)," wrote Colin Cieszynski, senior market analyst at CMC Markets, in a note.

Among individual companies, shares of Gigamon Inc. (GIMO) tanked 34% after the data-traffic technology firm cut its revenue outlook.

James River Coal Co. (JRCC) sank 63% after the Appalachian coal miner late Monday filed for Chapter 11 bankruptcy protection as it continued its search for a buyer or investor.

First Solar, Inc. (FSLR) shares rose 7%, making it a top performer on the S&P 500. Analysts at Citigroup last week identified First Solar as one of the stocks that is likely to benefit from investors' interest in renewable energy.

Yelp Inc. (YELP) shares gained 1.9% Tuesday after analysts at SunTrust Robinson Humphrey upgraded the Internet stock to buy from neutral. The recent slide in the stock's value has created some opportunities for investors, the analysts said. Oppenheimer analysts also upgraded the Internet consumer review site's stock.

FireEye Inc. (FEYE) shares climbed 4% after Wedbush analyst Sanjit Singh upgraded the stock to outperform from neutral. The maker of security platforms that protect against cyberattacks saw its stock slide after a follow-on offering last month and broader selloff in technology stocks.

Consol Energy Inc. (CNX) shares climbed 3.2% after the energy company reported earnings results and issued an improved outlook.

In global markets news, Asian markets closed mostly higher, while European stocks continued to decline. Gold(GCM4) and oil (CLK4) advanced, finding support in a weaker dollar.

More must-reads from MarketWatch:

Dennis Gartman: I'm scared of stocks right now

Mark Hulbert: 5 signs of a stock-market bubble

Next stop 1,750 on the S&P?

Subscribe to WSJ: http://online.wsj.com?mod=djnwires