The day's biggest gainers included Amazon.com Inc
The Global X social media index
But gains in the blue-chip Dow Jones industrial average were capped by a decline in bank stocks. Goldman Sachs Group
Alcoa Inc
Retailer Bed, Bath & Beyond
Also Read
"Ironically, while the S&P is just shy of its all-time high, the number of S&P constituents that have lowered their quarterly EPS outlook is also at an all-time high," said Robbert van Batenburg, director of market strategy at Newedge USA, LLC, in New York.
"While this is a concerning statistic, it has become a tradition for many companies to gradually manage EPS estimates lower throughout the quarter and then subsequently 'beat' the - excessively low - consensus estimates."
S&P 500 companies' first-quarter earnings are projected to have increased just 1% from a year ago, Thomson Reuters data showed. The forecast is down sharply from the start of the year, when profit growth was estimated at 6.5%.
Companies across America are blaming the brutal winter for weak first-quarter results, but investors are expecting a quick rebound in the second quarter.
Financial stocks were in the spotlight as regulators finalized the rule to limit banks' reliance on debt. Under the rule, the eight biggest US banks must raise a total of about $68 billion in capital by 2018 to comply with a new rule designed to prevent another financial crisis.
The rules would apply to JPMorgan Chase, Citigroup
Biotechnology stocks, which had been punished in the recent selloff, seesawed between gains and losses on Tuesday. The Nasdaq biotechnology index fell 0.4%. Gilead Sciences Inc
The Dow Jones industrial average rose 10.27 points or 0.06%, to end at 16,256.14. The S&P 500 gained 6.92 points or 0.38%, to finish at 1,851.96. The Nasdaq Composite added 33.234 points or 0.81%, to close at 4,112.986.
Tuesday's advance followed the S&P 500's biggest three-day retreat since late January and the Nasdaq's steepest three-day drop since November 2011.
The benchmark S&P 500 index rose above its 50-day moving average around 1,840, a key support level. The index has managed to stay above 1,840 several times over the past month.
In contrast to the day's positive trend, shares of Gigamon Inc
About 6.7 billion shares changed hands on US exchanges, slightly below the 6.8 billion average so far this month, according to data from BATS Global Markets.
Advancers outnumbered decliners on the New York Stock Exchange by a ratio of about 2 to 1. On the Nasdaq, 17 stocks rose for nearly every nine that fell.