Carbon doping and the parasitic growth-rate reduction with carbon-tetrachloride (CCl4) in AlxGa1-xAs was studied in the entire Al composition range for metalorganic vapor phase epitaxial growth. The doping efficiency in AlGaAs was found to increase by two orders of magnitude when the Al composition in AlxGa1-xAs changed from 0 to 1. The parasitic growth rate reduction, however, decreased by a factor of 15 when x changed from 0 to 1. This reduction of growth rate was confirmed to be caused by the etching of the material from the surface by Cl radicals cracked from CCl4. This strong compositional selectivity of the doping and etching has potential implications for lateral definition of growth on patterned surfaces. The doping and etching behaviors were also studied as a function of the growth temperature. (C) 1997 American Institute of Physics.