By Alexandra Scaggs 

U.S. stocks gained broadly on Wednesday, as rising hopes of economic stimulus from Asia helped boost investor confidence.

The Dow Jones Industrial Average rose 72 points, or 0.4%, to 16332. The S&P 500 index advanced six points, or 0.3%, to 1849, with all 10 sectors higher.

The Nasdaq Composite Index climbed 11 points, or 0.3%, to 4045, with its rise bolstered by gains in social-media and biotechnology stocks. The Nasdaq Biotechnology Index rose 1.2%.

On Tuesday, stocks ended a roller-coaster session broadly higher. The Dow closed up 89 points to post the best two-day point gain since March 18.

Helping drive the early gains was a report showing that China's gross domestic product grew 7.4% in the first quarter, the slowest rate in 18 months, but above economists' forecasts of 7.3%. Traders said the slowing pace of growth raised investor hopes of more stimulus from the Chinese government.

"The Chinese data certainly corroborates the idea that the economy is slowing, but at the same time officials have become concerned enough" that more stimulus could be a possibility, said Dan Greenhaus, chief market strategist at New York brokerage firm BTIG.

The data from China helped offset mixed corporate earnings reports. With 47 companies reporting, the S&P 500 is on pace to report that first-quarter earnings declined 1.9% from the previous year, according to FactSet, and that sales rose 2.2%.

Stock-market gains this year will be mostly based on earnings, said Christian Ledoux, director of equity research at South Texas Money Management. "It is going to be bumpy for most of the year... equity [valuations] are slightly above average, and they're working their way towards overvalued."

Still, he said, he is keeping his allocation to U.S. stocks steady, as they are a good value when compared with investments such as bonds.

BTIG's Mr. Greenhaus said that any new stimulus from China would be a positive factor for stocks globally. Stocks in Europe and Asia gained, with the Stoxx Europe 600 up 1% as the Chinese data offset mixed data from Europe.

In Asia, Japan's Nikkei Stock Average shot up 3%, helped by China's GDP data, and after Bank of Japan Governor Haruhiko Kuroda said he would closely monitor stock prices and that inflation was on a steady track toward the 2.0% target. China's Shanghai Composite gained 0.2%.

Stock futures pared some of their gains premarket after U.S. housing data missed forecasts. New residential construction for March rose 2.8% to a seasonally adjusted annualized rate of 946,000, falling well below forecasts of a rise of 6.4% to a seasonally adjusted annualized rate of 965,000. Building permits fell 2.4% to 990,000, versus forecasts of 1.01 million.

Industrial production rose 0.7% in March, while a rise of 0.4% was forecast. Capacity utilization rose by more than expected as well.

At 12:25 p.m., Federal Reserve Chairwoman Janet Yellen is giving a speech on monetary policy and the economy at the Economic Club of New York. The Fed's "beige book" report, a read on the U.S. economy from anecdotes gathered by the central bank's 12 districts, is due later in the afternoon.

The yield on the 10-year Treasury note rose to 2.647% from 2.628% late Tuesday.

Dow component Intel shares were little changed after it reported late Tuesday first-quarter earnings that topped analyst estimates, while revenue was in line with its forecast and PC sales continued to decline.

Yahoo surged 5.6% after first-quarter results exceeded expectations, and the company provided an upbeat revenue outlook for the current quarter.

Bank of America slipped 3.4% after the banking giant reported it swung to a first-quarter loss as a result of previously-disclosed litigation expenses, while revenue fell slightly less than expected.

Gold futures slipped 0.1% to $1,299.20 a troy ounce, after falling 2% Tuesday to mark the biggest one-day percentage loss since Dec. 19.

Crude-oil futures added 0.7% to $104.50 a barrel. The dollar rose against the yen, but lost some ground against the euro.

In other corporate news, New York investment bank Moelis & Co. opened 5.5% higher in its public debut, after pricing its initial public offering below its forecast range.

Google, which is due to report results after the close, rose 1.4%.

Twitter slipped 3.1%. The stock shot up 11% Tuesday, the biggest one-day gain since the microblogging site went public in November. Tuesday's rally came one day after some of the company's earliest and biggest backers said they didn't plan to sell shares when rules barring them from doing so expire next month.

Twitter had been one of the hardest-hit of the previous highfliers, as the stock was down 37% on the year through Friday, after ending last year 145% above its $26 initial public offering price.

Write to Alexandra Scaggs at alexandra.scaggs@wsj.com

Intel (NASDAQ:INTC)
Historical Stock Chart
From Mar 2024 to Apr 2024 Click Here for more Intel Charts.
Intel (NASDAQ:INTC)
Historical Stock Chart
From Apr 2023 to Apr 2024 Click Here for more Intel Charts.