From patchwork Fri Sep 13 07:51:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 274672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A03712C0165 for ; Fri, 13 Sep 2013 17:51:59 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; q= dns; s=default; b=ImfQvdTIdOQtDRFNnMUr8epBwd//QYn/WcZByoCERStOEZ iIAH0L/w2SXiHjC3HtU8T7JtiiTfIbOusrnFCMA7t77rU5Qvjecp8uyRqrLeSFe9 aNBVGCWm7Aemw+5u0mnOEpKHcfRernC5rdgVsdaMX+HCMXWbgO8KS+X98zxPw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:content-type; s= default; bh=23LlVweok6VioeOrQQujmlv09dc=; b=iQ6BLQ6ftjO7QICOFgOI IfJGg3m8LSgQdwFyP83wvJWm74rQCHjXeD2t0RlobTfR/wecjq1ONjETV/Qak5xs IFUnE7d1ICIZXulWx06ohiwumJWPMUfFtvoW1++e3IppS79QGJsd05bhx+hsWt15 kenRfJ+J5+a5T5jKavaakuU= Received: (qmail 27323 invoked by alias); 13 Sep 2013 07:51:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 27312 invoked by uid 89); 13 Sep 2013 07:51:52 -0000 Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 13 Sep 2013 07:51:52 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, KAM_STOCKGEN, NO_RELAYS autolearn=no version=3.3.2 X-HELO: mail-ie0-f175.google.com Received: by mail-ie0-f175.google.com with SMTP id e14so1771314iej.20 for ; Fri, 13 Sep 2013 00:51:50 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.51.16.3 with SMTP id fs3mr744140igd.53.1379058710481; Fri, 13 Sep 2013 00:51:50 -0700 (PDT) Received: by 10.64.12.42 with HTTP; Fri, 13 Sep 2013 00:51:50 -0700 (PDT) Date: Fri, 13 Sep 2013 09:51:50 +0200 Message-ID: Subject: [patch c] Fix target/57848: internal compiler error on builtin and '#pragma GCC target()' option From: Kai Tietz To: GCC Patches X-IsSubscribed: yes 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 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);