Continuum -ray spectra and angular distributions from decays of highly excited K39, K40, Ca42, and Sc45 compound nuclei produced by bombarding Al27 with C12, C13, N15, and O18 ions have been measured and the giant-dipole- resonance strength function has been extracted. The effective temperature associated with the states upon which the giant dipole resonance is built is nearly constant (1.7-1.8 MeV) for these reactions, while the final average spin varies from 8 to 18.5Latin small letter h with stroke as the projectile energy varies from 32 to 72.5 MeV. The parameters of the giant-dipole-resonance strength function extracted from fits of statistical model calculations to the -ray spectra measured at =90°provide direct information on the spin dependence of the hot nuclear shape. The mean energy of the giant dipole resonance shows a weak spin dependence that has a different character for K39 and Sc45 nuclei. The width of the giant dipole resonance increases rapidly with spin for all reactions studied, from 11.6±0.3 MeV at 8Latin small letter h with stroke to 14.7±0.5 MeV at 18.5Latin small letter h with stroke for Sc*45 at Tf=1.7-1.8 MeV, for example, presumably due to rotational broadening of the giant dipole resonance. For the reactions C12+27Al at Elab=62.7 MeV and O18+27Al at Elab=44.9 and 72.5 MeV, angular distributions have been measured. The observed energy dependence of the a2 coefficient suggests large nuclear deformation consistent with oblate noncollective or prolate collective rotation. The level density in nuclei with A40 has been calculated in the Reisdorf approach with parameters fitted to low-energy level density data for nuclei in this mass region. © 1990 The American Physical Society.