U.S. stocks managed modest gains at midday on Tuesday, recovering from early losses on strength in the biotech sector after Gilead Sciences unveiled a large stock-buyback program.

Gilead authorized a program, for the second time this year, to repurchase up to $5 billion in common stock through May 2013. Its stock rose 3.3 percent to $39.65, while the NYSE Arca Biotech index <.BTK> gained 0.7 percent.

The three major U.S. stock indexes initially opened lower, easing from the previous session's hefty gains as concerns lingered about how Greece will get its budget deficit under control. The biggest winners from the previous session were among Tuesday's biggest losers, with the S&P financial index <.GSPF> down 0.2 percent and Dow component JPMorgan Chase & Co off 0.6 percent at $41.72.

Stocks scored their biggest one-day gain in more than a year on Monday after European leaders agreed to a $1 trillion emergency rescue package to stabilize the euro-zone currency. However, concerns remained about the high debt loads of some euro-zone nations.

The steps they're taking are right in the short term, but in the long term, there needs to be fiscal discipline, said Jack Ablin, chief investment officer at Harris Private Bank in Chicago.

Because the IMF is involved, there's the sense that the EU may not exert much control over its constituent countries.

The Dow Jones industrial average <.DJI> was up 32.04 points, or 0.30 percent, at 10,816,17. The Standard & Poor's 500 Index <.SPX> was up 2.71 points, or 0.23 percent, at 1,162.44. The Nasdaq Composite Index <.IXIC> was up 12.58 points, or 0.53 percent, at 2,387.22.

The Nasdaq rose on strength in biotech stocks, as well as tech, with Apple Inc up 1.4 percent at $257.64

Dow component International Business Machines Corp was up 0.9 percent at $127.39.

Earnings season continued, with Church & Dwight Co posting a first-quarter profit that beat expectations. However, the consumer products company also gave a weak second-quarter earnings outlook, and its stock fell3.5 percent to $66.96.

Overseas, Toyota Motor reported fourth-quarter earnings that comfortably beat forecasts. Toyota's U.S.-listed stock rose 1.5 percent to $77.91 on the New York Stock Exchange.

Walt Disney Co is scheduled to report its results after the market closes on Tuesday. The stock rose 1.5 percent to $35.83 and ranked among the Dow's biggest advancers.

On the heels of last week's dramatic intraday plunge in U.S. markets, an agreement to adopt market-wide circuit breakers to halt extreme drops in individual stocks is a done deal, a source told Reuters.

On the economic front, data showed U.S. wholesale inventories rose for a third straight month in March to their highest in eight months.

(Reporting by Ryan Vlastelica; Editing by Jan Paschal)