From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28468 invoked by alias); 27 Jun 2013 15:54:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 28456 invoked by uid 89); 27 Jun 2013 15:54:14 -0000 X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 27 Jun 2013 15:54:13 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 27 Jun 2013 17:54:10 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1UsEWQ-0006W9-M6; Thu, 27 Jun 2013 17:54:10 +0200 Date: Thu, 27 Jun 2013 15:55:00 -0000 From: Marc Glisse To: Jakub Jelinek cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [C++] Fix __builtin_shuffle In-Reply-To: <20130627153313.GE2336@tucnak.redhat.com> Message-ID: References: <51CB558B.6090905@redhat.com> <51CC2F9D.908@redhat.com> <20130627153313.GE2336@tucnak.redhat.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-SW-Source: 2013-06/txt/msg01532.txt.bz2 On Thu, 27 Jun 2013, Jakub Jelinek wrote: > On Thu, Jun 27, 2013 at 05:24:45PM +0200, Marc Glisse wrote: >> On Thu, 27 Jun 2013, Jason Merrill wrote: >> >>> On 06/27/2013 07:59 AM, Marc Glisse wrote: >>>> I assume I can't call directly c_build_vec_perm_expr on the original >>>> arguments without build_non_dependent_expr? >>> >>> It looks like c_build_vec_perm_expr is safe to take the original >>> arguments, since it doesn't look deep into the expression. So >>> either way is fine. >> >> Cool, I'll go with the short version then (I tested it before posting): >> >> +tree >> +build_x_vec_perm_expr (location_t loc, >> + tree arg0, tree arg1, tree arg2, >> + tsubst_flags_t complain) >> +{ >> + if (processing_template_decl >> + && (type_dependent_expression_p (arg0) >> + || type_dependent_expression_p (arg1) >> + || type_dependent_expression_p (arg2))) >> + return build_min_nt_loc (loc, VEC_PERM_EXPR, arg0, arg1, arg2); >> + return c_build_vec_perm_expr (loc, arg0, arg1, arg2, complain & tf_error); >> +} > > But then you won't diagnose errors in never instantiated templates that > could be diagnosed (i.e. where the arguments aren't type dependent). I don't really see why, as I am still calling c_build_vec_perm_expr in the same cases, just possibly not exactly with the same arguments (they don't go through build_non_dependent_expr, but Jason seemed to imply that it did not matter since we don't look too deep through the arguments). > I think the standard C++ FE way is doing something like: [snip previous version that Jason accepted] If you prefer the long version, I don't mind going back to it. -- Marc Glisse