U.S. stocks rose on Wednesday, boosted by gains in materials and technology shares and after Spain unveiled an austerity plan that further eased jitters over euro-zone sovereign debt woes.

Investors have worried that a debt crisis in Greece could spill over to other euro-zone nations with high debt loads, including Spain. Spain's plan to slash civil service pay and cut public sector jobs followed a 750 billion euro ($1 trillion) bailout agreement late Sunday to stem the debt woes, cheering investors.

We're getting the swing back and forth between risk appetite and risk aversion. That is what is controlling short term sentiment here, said Scott Marcouiller, senior equity market strategist at Wells Fargo Advisors in St. Louis. Investors are trying to find their sea legs.

The Dow Jones industrial average <.DJI> gained 87.59 points, or 0.81 percent, to 10,835.85. The Standard & Poor's 500 Index <.SPX> rose 10.48 points, or 0.91 percent, to 1,166.27. The Nasdaq Composite Index <.IXIC> climbed 27.59 points, or 1.16 percent, to 2,402.90.

Tech stocks led the way up, with Fidelity National Information Services Inc jumping 4 percent to $29.99. A private equity group is negotiating a deal that could be worth about $15 billion, according to a source.

Chipmakers also fared well with the PHLX semiconductor index <.SOXX> up 2.1 percent.

Materials shares also supported the market as the price of gold surged to a record high of $1,244.45 an ounce, a gain of nearly 20 percent since early February.

The PHLX gold and silver index <.XAU> rose nearly 2 percent, while Freeport-McMoRan Copper and Gold Inc gained 3.1 percent to $72.40.

(Editing by Jeffrey Benkoe)