From patchwork Thu Oct 31 23:03:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 287680 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 847F22C0331 for ; Fri, 1 Nov 2013 10:03:30 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=VuRaNog+CYxmJBoD/notg2wdEVhyVJmwoA1Wh1GIBjiU77mLU7 XgpS22Bpd9wylKpquykT2lF7i0CVvxPqqbCEqSMvlA4lPIUg7zXUs3K7t3Zo8ZxE +6OIHPjdN5iJ1KM34ufO9loeWgexjaF1M9SYJ3xlzfIdibwamAIqHRlnU= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=I8LVMu3lD8LVmMAEEXxfPDgPzOk=; b=N/tF7eDmivgEUeOJGF1U HMh5SaVsT+0jq7aG1C7eYyb1K1ivfTTgrjoCxgZA6+LuBKz4ACaE0ZtlGddHIG+q dn8Tsbg8ignIPskOpmIgKIq4n7nz2rBVNfwkpc/H4MmYspD0mtLKEfGQXqiDHaKA iTQUR3K1ObHvpZSe/rnc/Ds= Received: (qmail 6803 invoked by alias); 31 Oct 2013 23:03:23 -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 6786 invoked by uid 89); 31 Oct 2013 23:03:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail2-relais-roc.national.inria.fr Received: from mail2-relais-roc.national.inria.fr (HELO mail2-relais-roc.national.inria.fr) (192.134.164.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 31 Oct 2013 23:03:19 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 01 Nov 2013 00:02:57 +0100 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1Vc1Gm-0001uh-Cy; Fri, 01 Nov 2013 00:03:16 +0100 Date: Fri, 1 Nov 2013 00:03:16 +0100 (CET) From: Marc Glisse To: gcc-patches@gcc.gnu.org cc: jason@redhat.com Subject: PR 58834: __builtin_shuffle in a template Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Hello, __builtin_shuffle with 2 arguments is represented as having 3 arguments, the second being 0, which isn't supported here. Bootstrap+testsuite on x86_64-unknown-linux-gnu. 2013-11-01 Marc Glisse PR c++/58834 gcc/cp/ * pt.c (value_dependent_expression_p): Handle null argument. gcc/testsuite/ * g++.dg/ext/pr58834.C: New file. Index: gcc/cp/pt.c =================================================================== --- gcc/cp/pt.c (revision 204279) +++ gcc/cp/pt.c (working copy) @@ -20499,21 +20499,21 @@ value_dependent_expression_p (tree expre considered dependent. Other parts of the compiler arrange for an expression with type-dependent subexpressions to have no type, so this function doesn't have to be fully recursive. */ bool type_dependent_expression_p (tree expression) { if (!processing_template_decl) return false; - if (expression == error_mark_node) + if (expression == NULL_TREE || expression == error_mark_node) return false; /* An unresolved name is always dependent. */ if (identifier_p (expression) || TREE_CODE (expression) == USING_DECL) return true; /* Some expression forms are never type-dependent. */ if (TREE_CODE (expression) == PSEUDO_DTOR_EXPR || TREE_CODE (expression) == SIZEOF_EXPR || TREE_CODE (expression) == ALIGNOF_EXPR Index: gcc/testsuite/g++.dg/ext/pr58834.C =================================================================== --- gcc/testsuite/g++.dg/ext/pr58834.C (revision 0) +++ gcc/testsuite/g++.dg/ext/pr58834.C (working copy) @@ -0,0 +1,5 @@ +template void foo() +{ + int i __attribute__((vector_size(2*sizeof(int)))); + (void) __builtin_shuffle(i, i); +}