Context : Gamma-ray burst emission in the prompt phase is often interpreted as synchrotron radiation from high-energy electrons accelerated in internal shocks . Fast synchrotron cooling of a power-law distribution of electrons leads to the prediction that the slope below the spectral peak has a photon index \alpha = -3 / 2 ( N ( E ) \propto E ^ { \alpha } ) . However , this differs significantly from the observed median value \alpha \approx - 1 . This discrepancy has been used to argue against this scenario . Aims : We quantify the influence of inverse Compton ( IC ) and adiabatic cooling on the low energy slope to understand whether these processes can reconcile the observed slopes with a synchrotron origin . Methods : We use a time-dependent code developed to calculate the GRB prompt emission within the internal shock model . The code follows both the shock dynamics and electron energy losses and can be used to generate lightcurves and spectra . We investigate the dependence of the low-energy slope on the parameters of the model and identify parameter regions that lead to values \alpha > -3 / 2 . Results : Values of \alpha between -3 / 2 and -1 are reached when electrons suffer IC losses in the Klein-Nishina regime . This does not necessarily imply a strong IC component in the Fermi /LAT range ( GeV ) because scatterings are only moderately efficient . Steep slopes require that a large fraction ( 10-30 % ) of the dissipated energy is given to a small fraction ( \la 1 % ) of the electrons and that the magnetic field energy density fraction remains low ( \la 0.1 % ) . Values of \alpha up to -2 / 3 can be obtained with relatively high radiative efficiencies ( > 50 % ) when adiabatic cooling is comparable with radiative cooling ( marginally fast cooling ) . This requires collisions at small radii and/or with low magnetic fields . Conclusions : Amending the standard fast cooling scenario to account for IC cooling naturally leads to values \alpha up to -1 . Marginally fast cooling may also account for values of \alpha up to -2 / 3 , although the conditions required are more difficult to reach . About 20 % of GRBs show spectra with slopes \alpha > -2 / 3 . Other effects , not investigated here , such as a thermal component in the electron distribution or pair production by high-energy gamma-ray photons may further affect \alpha . Still , the majority of observed GRB prompt spectra can be reconciled with a synchrotron origin , constraining the microphysics of mildly relativistic internal shocks .