  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. 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. We found that
magnetic stars with M>3Msun are homogeneously distributed along the main
sequence. Instead, there are statistical indications that lower mass stars
(especially those with M<=2Msun) 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>3Msun, 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. The mechanism that originates and
sustains the magnetic field in the upper main sequence stars may be different
in CP stars of different mass.
