From patchwork Thu Nov 6 14:32:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 407543 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 14E711400A6 for ; Fri, 7 Nov 2014 01:42:04 +1100 (AEDT) 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:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=a3eGLHaSnQ5kdqc/ZmmPS+Lb0FmlsPqpKMETF8DyzAotMuaqcW7Oz cPMlrJf0vWrnSVQBywhtpEmLJrKzNh8Ow/2sg8tim+TeG+sAMKPTTli6ZrMijY9f deKGinvKfZmtPvFpttWlzRoB0zLJhRNyPn+zHY0AhmUU+UpAOAPhrU= 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:cc:subject:date:message-id:in-reply-to:references; s= default; bh=I+ywAOS3I57Jmq9modhmgfJ0AlQ=; b=oLZ6x29ffsXduXHshv31 NV5WdwyyuNxVQ/JqIa1K2SRRdAgF9uiPq9mr11ETf1gjbB6hLqOqBBxOV0h0lBfq sxL+YHUVlHxc2DhWnuDtK6azAgIZ1vwCB9tnYHCNFQwtiFYhhVg7UXFWOB8wBs/Z zhGivlp6xyNtQGu5tAq1Q1o= Received: (qmail 26516 invoked by alias); 6 Nov 2014 14:37:12 -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 26104 invoked by uid 89); 6 Nov 2014 14:37:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS 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; Thu, 06 Nov 2014 14:37:07 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA6Eb52b028102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 6 Nov 2014 09:37:05 -0500 Received: from surprise.redhat.com (vpn-235-14.phx2.redhat.com [10.3.235.14]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA6Eag8D016497; Thu, 6 Nov 2014 09:37:04 -0500 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [gimple-classes, committed 35/44] gimple_assign_rhs_to_tree takes a const gassign * Date: Thu, 6 Nov 2014 09:32:11 -0500 Message-Id: <1415284340-14186-36-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1415284340-14186-1-git-send-email-dmalcolm@redhat.com> References: <1415284340-14186-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes gcc/ChangeLog.gimple-classes: * cfgexpand.c (gimple_assign_rhs_to_tree): Strengthen param from gimple to const gassign *. (expand_debug_expr): Add checked cast. (expand_gimple_basic_block): Likewise. * cfgexpand.h (gimple_assign_rhs_to_tree): Strengthen param from gimple to const gassign *. * tree-ssa.c (insert_debug_temp_for_var_def): Add checked cast. --- gcc/ChangeLog.gimple-classes | 10 ++++++++++ gcc/cfgexpand.c | 8 +++++--- gcc/cfgexpand.h | 2 +- gcc/tree-ssa.c | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index 631e0df..17a7c80 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,15 @@ 2014-11-04 David Malcolm + * cfgexpand.c (gimple_assign_rhs_to_tree): Strengthen param from + gimple to const gassign *. + (expand_debug_expr): Add checked cast. + (expand_gimple_basic_block): Likewise. + * cfgexpand.h (gimple_assign_rhs_to_tree): Strengthen param from + gimple to const gassign *. + * tree-ssa.c (insert_debug_temp_for_var_def): Add checked cast. + +2014-11-04 David Malcolm + * asan.c (asan_expand_check_ifn): Strengthen local "shadow_test" from gimple to gassign *. Introduce gassign * locals "add_7", "cast", "t_ge_shadow", "and_expr", using them in place of diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 73862eb..279202d 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -108,7 +108,7 @@ static rtx expand_debug_expr (tree); statement STMT. */ tree -gimple_assign_rhs_to_tree (gimple stmt) +gimple_assign_rhs_to_tree (const gassign *stmt) { tree t; enum gimple_rhs_class grhs_class; @@ -4558,7 +4558,8 @@ expand_debug_expr (tree exp) gimple g = get_gimple_for_ssa_name (exp); if (g) { - op0 = expand_debug_expr (gimple_assign_rhs_to_tree (g)); + op0 = expand_debug_expr (gimple_assign_rhs_to_tree ( + as_a (g))); if (!op0) return NULL; } @@ -5044,7 +5045,8 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls) replace all uses of OP in debug insns with that temporary. */ gimple debugstmt; - tree value = gimple_assign_rhs_to_tree (def); + tree value = + gimple_assign_rhs_to_tree (as_a (def)); tree vexpr = make_node (DEBUG_EXPR_DECL); rtx val; enum machine_mode mode; diff --git a/gcc/cfgexpand.h b/gcc/cfgexpand.h index 6314b83..2b13996 100644 --- a/gcc/cfgexpand.h +++ b/gcc/cfgexpand.h @@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see #ifndef GCC_CFGEXPAND_H #define GCC_CFGEXPAND_H -extern tree gimple_assign_rhs_to_tree (gimple); +extern tree gimple_assign_rhs_to_tree (const gassign *); extern HOST_WIDE_INT estimated_stack_frame_size (struct cgraph_node *); #endif /* GCC_CFGEXPAND_H */ diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index b893df9..f23107c 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -416,7 +416,7 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var) } if (!no_value) - value = gimple_assign_rhs_to_tree (def_stmt); + value = gimple_assign_rhs_to_tree (as_a (def_stmt)); } if (value)