From patchwork Mon Mar 21 18:15:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 87809 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 065CDB6F44 for ; Tue, 22 Mar 2011 05:20:57 +1100 (EST) Received: (qmail 26303 invoked by alias); 21 Mar 2011 18:20:26 -0000 Received: (qmail 26232 invoked by uid 22791); 21 Mar 2011 18:20:23 -0000 X-SWARE-Spam-Status: No, hits=-1.9 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; Mon, 21 Mar 2011 18:20:17 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 797E7CB024D for ; Mon, 21 Mar 2011 19:20:15 +0100 (CET) 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 Bl4JruiBUYqt for ; Mon, 21 Mar 2011 19:20:12 +0100 (CET) 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 D801ACB01D6 for ; Mon, 21 Mar 2011 19:20:10 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Re: [Ada] Avoid duplicating branches in loop conditions Date: Mon, 21 Mar 2011 19:15:37 +0100 User-Agent: KMail/1.9.9 References: <201103211307.26150.ebotcazou@adacore.com> In-Reply-To: <201103211307.26150.ebotcazou@adacore.com> MIME-Version: 1.0 Message-Id: <201103211915.37689.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 > 2011-03-21 Eric Botcazou > > * gcc-interface/decl.c (elaborate_expression_1): When optimization is > disabled, use the variable for bounds of loop iteration scheme. This quite mysteriously triggers a bogus -Wuninitialized warning on IRIX. Fixed thusly, tested on i586-suse-linux, applied on the mainline. 2011-03-21 Eric Botcazou PR bootstrap/48216 * gcc-interface/decl.c (elaborate_expression_1): Localize GNU_DECL. Index: gcc-interface/decl.c =================================================================== --- gcc-interface/decl.c (revision 171228) +++ gcc-interface/decl.c (working copy) @@ -6006,7 +6006,6 @@ elaborate_expression_1 (tree gnu_expr, E { const bool expr_global_p = Is_Public (gnat_entity) || global_bindings_p (); bool expr_variable_p, use_variable; - tree gnu_decl; /* In most cases, we won't see a naked FIELD_DECL because a discriminant reference will have been replaced with a COMPONENT_REF when the type @@ -6071,15 +6070,17 @@ elaborate_expression_1 (tree gnu_expr, E /* Now create it, possibly only for debugging purposes. */ if (use_variable || need_debug) - gnu_decl - = create_var_decl (create_concat_name (gnat_entity, - IDENTIFIER_POINTER (gnu_name)), - NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, - !need_debug, Is_Public (gnat_entity), - !definition, expr_global_p, NULL, gnat_entity); + { + tree gnu_decl + = create_var_decl (create_concat_name (gnat_entity, + IDENTIFIER_POINTER (gnu_name)), + NULL_TREE, TREE_TYPE (gnu_expr), gnu_expr, + !need_debug, Is_Public (gnat_entity), + !definition, expr_global_p, NULL, gnat_entity); - if (use_variable) - return gnu_decl; + if (use_variable) + return gnu_decl; + } return expr_variable_p ? gnat_save_expr (gnu_expr) : gnu_expr; }