Owens Corning reported a first-quarter loss Wednesday, hurt by the expense of laying off staff as well as higher materials costs. Shares slid 5 percent.

In the quarter ended March 31, the construction and industrial materials maker reported a net loss of $46 million, or 38 cents per share, compared with net income of $24 million, or 19 cents per share, in the same period a year before.

Excluding the costs of severance payments and other one-time items, Owens Corning said it earned 9 cents per share. That's still down from adjusted profit of 22 cents per share a year ago. Analysts polled by FactSet expected a much bigger profit of 30 cents per share.

Revenue rose 9 percent to $1.35 billion from $1.24 billion. Analysts expected $1.3 billion.

The company expects that the slowly improving U.S. housing market will help its building materials division, which makes insulation, roofing and other products. Revenue in that division rose 17 percent to $919 million in the January-March quarter. But CEO Mike Thaman said that the roofing unit was less profitable, despite increased sales volumes, because of higher asphalt costs.

Its composites business, which serves varied industries including transportation, wind energy and telecoms, is benefiting from increased industrial production worldwide, Owens Corning said. Still, the company expects to book $130 million in charges through early 2013 as it restructures its composites business to adjust to the slowing economy in Europe.

The Toledo, Ohio, company also announced a stock buyback program to repurchase up to 10 million additional shares.

Shares fell $1.75, or 5.1 percent, to $32.80 in late morning trading. The stock has traded between $18.67 and $38.94 over the last year.