U.S. stocks gained on Monday, lifted by expectations the Federal Reserve will add liquidity to the economy when it meets on Tuesday amid worries of a slowing recovery.

But Hewlett-Packard Co weighed on the blue-chip Dow industrials, with shares sliding after its chief executive resigned late on Friday following a sexual harassment investigation.

Among the Dow's top advancers, McDonald's shares hit a lifetime high at $73.33 after the world's biggest hamburger chain reported a stronger-than-expected 7 percent increase in global same-store sales in July. At midday, the stock was up 1.73 percent at $72.98.

The Fed, while widely expected to renew its vow to keep interest rates near zero for an extended period, may indicate it is prepared to print more money to support the economy. The central bank's options include reinvesting the proceeds of mortgage bonds as they mature and putting the money back into new securities.

Friday's weaker-than-expected July jobs report was the latest to suggest the U.S. recovery was losing momentum.

On Monday, Goldman Sachs cut its year-end target for the S&P 500 index to 1,200 from 1,250.

We think the fed funds rate isn't going anywhere, but in terms of additional quantitative easing, that's a two-edged sword, because it could be construed that the economy really is worse than we think said Hank Smith, chief investment officer of Haverford Trust Co. in Philadelphia.

The Dow Jones industrial average <.DJI> was up 34.59 points, or 0.32 percent, at 10,688.08. The Standard & Poor's 500 Index <.SPX> was up 3.64 points, or 0.32 percent, at 1,125.28. The Nasdaq Composite Index <.IXIC> was up 9.86 points, or 0.43 percent, at 2,298.33

Hewlett-Packard CEO Mark Hurd quit on Friday after the closing bell following an investigation that found he had falsified expense reports to conceal a close personal relationship with a female contractor.

HP's stock fell 7.7 percent to $42.76, although some analysts saw the selling as short-lived.

We do not see this changing our thesis, and depending on the extent and duration of the sell-off, this might be a good opportunity to add shares, said Smith, whose firm owns the stock.

U.S.-listed shares of Research in Motion Ltd gained 3.1 percent to $55.13 after a Saudi official said the BlackBerry maker and Saudi mobile firms were testing three servers to send communications and data through Saudi Arabia before Canada to address Riyadh's concerns over security.

(Reporting by Caroline Valetkevitch; Additional reporting by Angela Moon; Editing by Jan Paschal)