From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104747 invoked by alias); 4 Dec 2015 17:10:34 -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 103600 invoked by uid 89); 4 Dec 2015 17:10:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 04 Dec 2015 17:10:32 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 99C1739EC6D; Fri, 4 Dec 2015 17:10:31 +0000 (UTC) Received: from [10.10.116.24] (ovpn-116-24.rdu2.redhat.com [10.10.116.24]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB4HAUR4024704; Fri, 4 Dec 2015 12:10:31 -0500 Subject: Re: [PATCH 01/10] C++ FE: expression ranges v4 To: David Malcolm References: <565627A0.6040107@redhat.com> <1449154548-43964-1-git-send-email-dmalcolm@redhat.com> <1449154548-43964-2-git-send-email-dmalcolm@redhat.com> Cc: gcc-patches@gcc.gnu.org, =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= From: Jason Merrill Message-ID: <5661C906.2040807@redhat.com> Date: Fri, 04 Dec 2015 17:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1449154548-43964-2-git-send-email-dmalcolm@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-12/txt/msg00595.txt.bz2 On 12/03/2015 09:55 AM, David Malcolm wrote: > @@ -362,10 +362,11 @@ convert_to_real_1 (tree type, tree expr, bool fold_p) > case REAL_TYPE: > /* Ignore the conversion if we don't need to store intermediate > results and neither type is a decimal float. */ > - return build1 ((flag_float_store > - || DECIMAL_FLOAT_TYPE_P (type) > - || DECIMAL_FLOAT_TYPE_P (itype)) > - ? CONVERT_EXPR : NOP_EXPR, type, expr); > + return build1_loc (loc, > + (flag_float_store > + || DECIMAL_FLOAT_TYPE_P (type) > + || DECIMAL_FLOAT_TYPE_P (itype)) > + ? CONVERT_EXPR : NOP_EXPR, type, expr); .... > @@ -5438,7 +5438,7 @@ build_nop (tree type, tree expr) > { > if (type == error_mark_node || error_operand_p (expr)) > return expr; > - return build1 (NOP_EXPR, type, expr); > + return build1_loc (EXPR_LOCATION (expr), NOP_EXPR, type, expr); Hmm, I'm uneasy about assigning a location to a conversion or other expression that doesn't correspond to particular text; it could be associated with the location of the operand or the enclosing expression that prompted the conversion. I think we've been deliberately leaving the location unset. But that causes problems with code that only looks at the top-level EXPR_LOCATION. Arguably such code should be fixed to look at the pre-conversion expression tree for a location, but I guess this is reasonable. Past GCC 6 I think we definitely want to use a new tree code rather than cp_expr; as Jakub pointed out, cp_expr doesn't do anything for templates or language-independent code. The current patchset is OK for GCC 6. Jason