 Gap Inc. stock rallied 8 in the extended session Thursday after the retailer swung to a surprise quarterly profit and reported sales above Wall Streets expectations, saying it expects to better match inventory with demand by spring. 