From patchwork Fri Oct 22 23:38:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 68984 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]) by ozlabs.org (Postfix) with SMTP id B3064B7043 for ; Sat, 23 Oct 2010 10:39:43 +1100 (EST) Received: (qmail 1341 invoked by alias); 22 Oct 2010 23:39:41 -0000 Received: (qmail 1332 invoked by uid 22791); 22 Oct 2010 23:39:40 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Oct 2010 23:39:34 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id BEA46CB0216 for ; Sat, 23 Oct 2010 01:39:32 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fhr7moeJG3me for ; Sat, 23 Oct 2010 01:39:32 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 9EDCDCB01EB for ; Sat, 23 Oct 2010 01:39:32 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Small tweak to gimplify_variable_sized_compare Date: Sat, 23 Oct 2010 01:38:24 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201010230138.24424.ebotcazou@adacore.com> 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 The transformation performed in the function drops the source location info. Tested on x86_64-suse-linux, applied on the mainline as obvious. 2010-10-22 Eric Botcazou * gimplify.c (gimplify_variable_sized_compare): Preserve the source location info of the expression. Index: gimplify.c =================================================================== --- gimplify.c (revision 165750) +++ gimplify.c (working copy) @@ -4634,10 +4634,10 @@ gimplify_modify_expr (tree *expr_p, gimp static enum gimplify_status gimplify_variable_sized_compare (tree *expr_p) { + location_t loc = EXPR_LOCATION (*expr_p); tree op0 = TREE_OPERAND (*expr_p, 0); tree op1 = TREE_OPERAND (*expr_p, 1); - tree t, arg, dest, src; - location_t loc = EXPR_LOCATION (*expr_p); + tree t, arg, dest, src, expr; arg = TYPE_SIZE_UNIT (TREE_TYPE (op0)); arg = unshare_expr (arg); @@ -4646,8 +4646,11 @@ gimplify_variable_sized_compare (tree *e dest = build_fold_addr_expr_loc (loc, op0); t = implicit_built_in_decls[BUILT_IN_MEMCMP]; t = build_call_expr_loc (loc, t, 3, dest, src, arg); - *expr_p + + expr = build2 (TREE_CODE (*expr_p), TREE_TYPE (*expr_p), t, integer_zero_node); + SET_EXPR_LOCATION (expr, loc); + *expr_p = expr; return GS_OK; }