http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51258
--- Comment #4 from Andrew Macleod <amacleod at redhat dot com> 2011-11-22 16:07:52 UTC --- I built a compiler in my linux box with a target of i386-apple-darwin. during expanding an atomic_exchange it fails the call to can_compare_and_swap_p(TImode, true). It returns CODE_FOR_nothing for both cases: icode = direct_optab_handler (atomic_compare_and_swap_optab, mode); if (icode != CODE_FOR_nothing) return true; icode = optab_handler (sync_compare_and_swap_optab, mode); if (icode != CODE_FOR_nothing) return true; so something in the config/i386/sync.md file must be wrong for a 32 bit compiler which specifies -m64. It does not set up the optab table for a TI mode compare_and_swap.