The present paper studies the influence of the interaction of incident pulsed laser and cold plasmas on the laser pulse in the relativistic laser-plasma system, taking the electron density fluctuation into account. For different initial parameters, the change of the laser-pulse width is analyzed in detail. The self-compression of the laser pulse is particularly discussed. Numerical calculation demonstrates that the pulse self-compression can be effectively achieved with the increase of the intensity and width of the laser pulse and the decrease of background plasma density. For initial laser-pulse parameters a0=0.12 and τ=70 and plasma density n0=0.3, the ratio of compressed laser pulse to initial one is near to 1/10. And hence optimized theoretical parameters for the self-compression of the laser pulse are given.