Deactivation of silicon dopants by hydrogen in GaAs and GaAlAs proceeds through the formation of hydrogen-dopant complexes with thermodynamical and vibrational characteristics weakly sensitive to the alloy composition. However the hydrogen diffusion profile is strongly sensitive to the alloy composition. In GaAs:Si, the profile is an erfc function while in Ga1-xAlxAs:Si with x > xo, it is rather a step like function. From the doping level dependence of xo, we explain the hydrogen diffusion properties within a model where H° and H- govern the diffusion profiles respectively for x < xo and x > xo. We deduce that hydrogen behaves as a deep acceptor in these materials with a level slightly resonant in the conduction band of GaAs and localized in the band gap of Ga1-xAlxAs alloys for x > 0.07.