Hello! Attached patch optimizes ix86_atomic_assign_expand_fenv by using register form of "fnstsw %ax" instead of "fnstsw ". This way a memory RW cycle is removed for a temporary. 2014-07-12 Uros Bizjak * config/i386/i386-builtin-types.def: Add USHORT_FTYPE_VOID. Remove VOID_FTYPE_PUSHORT. * config/i386/i386.c (bdesc_special_args) <__builtin_ia32_fnstsw>: Change code to USHORT_FTYPE_VOID. (ix86_expand_special_args_builtin): Handle USHORT_FTYPE_VOID. (ix86_expand_builtin): Remove IX86_BUILTIN_FNSTSW handling. (ix86_atomic_assign_expand_fenv): Update for __builtin_ia32_fnstsw changes. * config/i386/i386.md (x86_fnstsw_1): Set length unconditionally to 2. (fnstsw): Change operand 0 to nonimmediate operand. Bootstrapped and regression tested on x86_64-linux-gnu {,-m32} and committed to mainline SVN. Uros.