Context: .The photospheres of about 5-10% of the upper main sequence stars exhibit remarkable chemical anomalies. Many of these chemically peculiar (CP) stars have a global magnetic field, the origin of which is still a matter of debate.
Aims: .We present a comprehensive statistical investigation of the evolution of magnetic CP stars, aimed at providing constraints to the theories that deal with the origin of the magnetic field in these stars.
Methods: .We have collected from the literature data for 150 magnetic CP stars with accurate Hipparcos parallaxes. We have retrieved from the ESO archive 142 FORS1 observations of circularly polarized spectra for 100 stars. From these spectra we have measured the mean longitudinal magnetic field, and discovered 48 new magnetic CP stars (five of which belonging to the rare class of rapidly oscillating Ap stars). We have determined effective temperature and luminosity, then mass and position in the H-R diagram for a final sample of 194 magnetic CP stars.
Results: .We found that magnetic stars with M > 3 ~M_⊙ are homogeneously distributed along the main sequence. Instead, there are statistical indications that lower mass stars (especially those with M ≤ 2~M_⊙) tend to concentrate in the centre of the main sequence band. We show that this inhomogeneous age distribution cannot be attributed to the effects of random errors and small number statistics. Our data suggest also that the surface magnetic flux of CP stars increases with stellar age and mass, and correlates with the rotation period. For stars with M > 3~M_⊙, rotation periods decrease with age in a way consistent with the conservation of the angular momentum, while for less massive magnetic CP stars an angular momentum loss cannot be ruled out.
Conclusions: .The mechanism that originates and sustains the magnetic field in the upper main sequence stars may be different in CP stars of different mass.