Organisms with complex life-cycles acquire essential nutrients as juveniles, and hence even a short-term food stress during development can impose serious fitness costs apparent in adults. We used the Glanville fritillary butterfly to investigate the effects of larval food stress on adult performance under semi-natural conditions in a population enclosure. We were specifically interested in whether the negative effects observed were due to body mass reduction only or whether additional effects unrelated to pupal mass were evident. The two sexes responded differently to the larval food stress. In females, larval food stress reduced pupal mass and reproductive performance. The reduced reproductive performance was partially mediated by pupal mass reduction. Food stressed females also had reduced within-patch mobility, and this effect was not dependent on pupal mass. Conversely, food stress had no effect on male pupal mass, suggesting a full compensation via prolonged development time. Nonetheless, food stressed males were less likely to sire any eggs, potentially due to changes in their territorial behavior, as indicated by food stress also increasing male within-patch mobility (i.e., patrolling behavior). When males did sire eggs, the offspring number and viability were unaffected by male food stress treatment. Viability was in general higher for offspring sired by lighter males. Our study highlights how compensatory mechanisms after larval food stress can act in a sex-specific manner and that the alteration in body mass is only partially responsible for the reduced adult performance observed.Electronic supplementary materialThe online version of this article (doi:10.1007/s00442-017-3903-7) contains supplementary material, which is available to authorized users.