Hello, this patch fixes a wrong assumption in c_builtin_function_ext_scope. The check for never being called on preexisting symbols (with meaning), isn't correct as the turning on of builtins via pragmas wasn't considered.
The following sample demonstrate this issue pretty well (it is reduced testcase of failure occuring in i386 intrinsics): extern unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int); #pragma GCC target("sse4.2") To be compiled for 32-bit mode without enabled sse. ChangeLog 2013-09-13 Kai Tietz <kti...@redhat.com> PR target/57484 * c/c-decl.c (c_builtin_function_ext_scope): Remove wrong assumption that it is never called on prexisting symbol. Tested for i686-w64-mingw32, x86_64-w64-mingw32, x86_64-unknown-linux-gnu (multilib). Ok for apply? Regards, Kai Index: c-decl.c =================================================================== --- c-decl.c (Revision 202554) +++ c-decl.c (Arbeitskopie) @@ -3629,9 +3629,6 @@ c_builtin_function_ext_scope (tree decl) const char *name = IDENTIFIER_POINTER (id); C_DECL_BUILTIN_PROTOTYPE (decl) = prototype_p (type); - /* Should never be called on a symbol with a preexisting meaning. */ - gcc_assert (!I_SYMBOL_BINDING (id)); - bind (id, decl, external_scope, /*invisible=*/false, /*nested=*/false, UNKNOWN_LOCATION);