The following proposed patch disables setting, saving and restoring the VRSAVE register on all targets except Darwin.
VRSAVE was removed from the AIX ABI and was suppose to have been removed from the PPC SVR4 ABI. All recent versions of the Linux kernel set and maintain VRSAVE itself, as a process-level flag, not as individual bits, so no need for the compiler to set the register or to save and restore it across calls. All uses of VRSAVE (e.g., GLibc) will continue to work using the value set by the kernel. Comments? - David * config/rs6000/rs6000.c (rs6000_option_override_internal): Do not set TARGET_ALTIVEC_VRSAVE for TARGET_ELF. (rs6000_stack_info): Only set vrsave_mask for Darwin. Index: rs6000.c =================================================================== *** rs6000.c (revision 191810) --- rs6000.c (working copy) *************** rs6000_option_override_internal (bool gl *** 2725,2734 **** else rs6000_altivec_abi = 1; } - - /* Enable VRSAVE for AltiVec ABI, unless explicitly overridden. */ - if (!global_options_set.x_TARGET_ALTIVEC_VRSAVE) - TARGET_ALTIVEC_VRSAVE = rs6000_altivec_abi; } /* Set the Darwin64 ABI as default for 64-bit Darwin. --- 2725,2730 ---- *************** rs6000_stack_info (void) *** 17842,17848 **** else info_ptr->spe_gp_size = 0; ! if (TARGET_ALTIVEC_ABI) info_ptr->vrsave_mask = compute_vrsave_mask (); else info_ptr->vrsave_mask = 0; --- 17838,17845 ---- else info_ptr->spe_gp_size = 0; ! /* Only set VRSAVE register on Darwin. */ ! if (DEFAULT_ABI == ABI_DARWIN) info_ptr->vrsave_mask = compute_vrsave_mask (); else info_ptr->vrsave_mask = 0;