From patchwork Sat Nov 23 10:19:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 293651 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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 979C42C0090 for ; Sat, 23 Nov 2013 21:23:39 +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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=VuCeRN83WKJytlZp 6attLYnsMD3YFiMNLDILnl/7pjdm34YdnQgV7NgwXnicfUJNOejwVzJqXXE5B6di NA55/YIM0y37PDg6BmWMajUTE1V/Z87LJdaMoEAZvf5IfdcuqcTY5qz+c2QgqJHN Cml4alG5O4j3RSJwzklEpRP4I9E= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=wpcEdAvqqC8xDPjX1a1YVH Oe3Rg=; b=P9lhPyQ+JVoxJ45yZwnhvhsEQW3mxxLMwqQMbofiFllfOYsXNk4jFL d8An7wBNltZGfZxrPsBEpxzZ/HxHx0To78SNlA9jpfyWDXk/7WG36+rhV+s5VMRs sTJ385YhlCO7o+1XSaKtR9NIKTqYxjSoSKPboVT1I6jNgGXN03Ul0= Received: (qmail 22890 invoked by alias); 23 Nov 2013 10:23:27 -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 22881 invoked by uid 89); 23 Nov 2013 10:23:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL, BAYES_50, RDNS_NONE, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from Unknown (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 23 Nov 2013 10:23:25 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id CA98D26A9FE3 for ; Sat, 23 Nov 2013 11:23:16 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dkk2T2ME7RKy for ; Sat, 23 Nov 2013 11:23:16 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id AA7FA26A5F73 for ; Sat, 23 Nov 2013 11:23:16 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Privatize recalculate_side_effects Date: Sat, 23 Nov 2013 11:19:31 +0100 Message-ID: <3383200.UT62eHieOI@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) MIME-Version: 1.0 Tested on x86_64-suse-linux, applied on the mainline as obvious. 2013-11-23 Eric Botcazou * gimplify.h (recalculate_side_effects): Delete. * gimplify.c (recalculate_side_effects): Make static and add comment. ada/ * gcc-interface/trans.c (Loop_Statement_to_gnu): Set TREE_SIDE_EFFECTS on the conditional expression directly. Index: gimplify.c =================================================================== --- gimplify.c (revision 205300) +++ gimplify.c (working copy) @@ -1757,7 +1757,9 @@ gimplify_var_or_parm_decl (tree *expr_p) return GS_ALL_DONE; } -void +/* Recalculate the value of the TREE_SIDE_EFFECTS flag for T. */ + +static void recalculate_side_effects (tree t) { enum tree_code code = TREE_CODE (t); Index: gimplify.h =================================================================== --- gimplify.h (revision 205300) +++ gimplify.h (working copy) @@ -64,7 +64,6 @@ extern tree unshare_expr (tree); extern tree unshare_expr_without_location (tree); extern tree voidify_wrapper_expr (tree, tree); extern tree build_and_jump (tree *); -extern void recalculate_side_effects (tree); extern enum gimplify_status gimplify_self_mod_expr (tree *, gimple_seq *, gimple_seq *, bool, tree); extern tree gimple_boolify (tree); Index: ada/gcc-interface/trans.c =================================================================== --- ada/gcc-interface/trans.c (revision 205300) +++ ada/gcc-interface/trans.c (working copy) @@ -2808,8 +2808,8 @@ Loop_Statement_to_gnu (Node_Id gnat_node if (gnu_cond_expr) { COND_EXPR_THEN (gnu_cond_expr) = gnu_loop_stmt; + TREE_SIDE_EFFECTS (gnu_cond_expr) = 1; gnu_result = gnu_cond_expr; - recalculate_side_effects (gnu_cond_expr); } else gnu_result = gnu_loop_stmt;