From patchwork Wed Jul 11 09:44:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Bosscher X-Patchwork-Id: 170406 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 393842C01F1 for ; Wed, 11 Jul 2012 19:45:15 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1342604716; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: MIME-Version:Received:From:Date:Message-ID:Subject:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=2o7MW+P F9kYlHMedp5lARACBxlk=; b=TO0eoMItl2Ryy6gPmP9Nh2tLfe1AkntJA3cwf+g W7FYXZpdqtNbzMFRlKKZkXlTk9yXhP6R2+Ke9QbEQvhOZcvAZmL+FKFNpJm1CRbI XLJJViEC93UZfxT64GNNJt//zYsrCdMcZ2yFspSEDUxofq1ukh8bFsxg2QlYLKSl s8/M= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:MIME-Version:Received:From:Date:Message-ID:Subject:To:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=i27iOT/bLw4qAICEaZ8Qxq1y8boWroBQzRtKJwxlv1zj+JLo4XQ6y3UDFEsNYh uE7qrf1Sbf8o+V1FdeH5gRXMKWSzPf+CV0sOs9y0YvliGo32j4oUEYVBHATabkHj YXnG7FK433CXclFFN+ds+HeFXsVs+sxOqsSgnJ2t9tmtg=; Received: (qmail 19554 invoked by alias); 11 Jul 2012 09:45:09 -0000 Received: (qmail 19512 invoked by uid 22791); 11 Jul 2012 09:45:07 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-lb0-f175.google.com (HELO mail-lb0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Jul 2012 09:44:54 +0000 Received: by lbol5 with SMTP id l5so1630175lbo.20 for ; Wed, 11 Jul 2012 02:44:53 -0700 (PDT) Received: by 10.152.122.12 with SMTP id lo12mr48493568lab.3.1341999891525; Wed, 11 Jul 2012 02:44:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.4.229 with HTTP; Wed, 11 Jul 2012 02:44:31 -0700 (PDT) From: Steven Bosscher Date: Wed, 11 Jul 2012 11:44:31 +0200 Message-ID: Subject: [patch] Remove unused java/expr.c:force_evaluation_order To: java-patches@gcc.gnu.org, GCC Patches X-IsSubscribed: yes 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 Hello, Remove force_evaluation_order because the only caller is force_evaluation_order itself. Will commit after a few days, if no-one objects. Ciao! Steven java/ * java-tree.h (force_evaluation_order): Remove prototype. * expr.c (force_evaluation_order): Remove unused function. Index: java-tree.h =================================================================== --- java-tree.h (revision 189423) +++ java-tree.h (working copy) @@ -1094,7 +1094,6 @@ extern int merge_type_state (tree); extern int push_type_0 (tree); extern void push_type (tree); extern void add_interface (tree, tree); -extern tree force_evaluation_order (tree); extern tree java_create_object (tree); extern int verify_constant_pool (struct JCF *); extern void start_java_method (tree); Index: expr.c =================================================================== --- expr.c (revision 189423) +++ expr.c (working copy) @@ -3689,82 +3689,6 @@ maybe_adjust_start_pc (struct JCF *jcf, return start_pc; } -/* Force the (direct) sub-operands of NODE to be evaluated in left-to-right - order, as specified by Java Language Specification. - - The problem is that while expand_expr will evaluate its sub-operands in - left-to-right order, for variables it will just return an rtx (i.e. - an lvalue) for the variable (rather than an rvalue). So it is possible - that a later sub-operand will change the register, and when the - actual operation is done, it will use the new value, when it should - have used the original value. - - We fix this by using save_expr. This forces the sub-operand to be - copied into a fresh virtual register, - - For method invocation, we modify the arguments so that a - left-to-right order evaluation is performed. Saved expressions - will, in CALL_EXPR order, be reused when the call will be expanded. - - We also promote outgoing args if needed. */ - -tree -force_evaluation_order (tree node) -{ - if (flag_syntax_only) - return node; - if (TREE_CODE (node) == CALL_EXPR - || (TREE_CODE (node) == COMPOUND_EXPR - && TREE_CODE (TREE_OPERAND (node, 0)) == CALL_EXPR - && TREE_CODE (TREE_OPERAND (node, 1)) == SAVE_EXPR)) - { - tree call, cmp; - int i, nargs; - - /* Account for wrapped around ctors. */ - if (TREE_CODE (node) == COMPOUND_EXPR) - call = TREE_OPERAND (node, 0); - else - call = node; - - nargs = call_expr_nargs (call); - - /* This reverses the evaluation order. This is a desired effect. */ - for (i = 0, cmp = NULL_TREE; i < nargs; i++) - { - tree arg = CALL_EXPR_ARG (call, i); - /* Promote types smaller than integer. This is required by - some ABIs. */ - tree type = TREE_TYPE (arg); - tree saved; - if (targetm.calls.promote_prototypes (type) - && INTEGRAL_TYPE_P (type) - && INT_CST_LT_UNSIGNED (TYPE_SIZE (type), - TYPE_SIZE (integer_type_node))) - arg = fold_convert (integer_type_node, arg); - - saved = save_expr (force_evaluation_order (arg)); - cmp = (cmp == NULL_TREE ? saved : - build2 (COMPOUND_EXPR, void_type_node, cmp, saved)); - - CALL_EXPR_ARG (call, i) = saved; - } - - if (cmp && TREE_CODE (cmp) == COMPOUND_EXPR) - TREE_SIDE_EFFECTS (cmp) = 1; - - if (cmp) - { - cmp = build2 (COMPOUND_EXPR, TREE_TYPE (node), cmp, node); - if (TREE_TYPE (cmp) != void_type_node) - cmp = save_expr (cmp); - TREE_SIDE_EFFECTS (cmp) = 1; - node = cmp; - } - } - return node; -} - /* Build a node to represent empty statements and blocks. */ tree