From patchwork Mon Oct 27 20:41:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 403896 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 0222F140077 for ; Tue, 28 Oct 2014 07:43:27 +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=RRIQ8OiqFE9lR+IK12nTxCq+lQuAugVC6knVCBi/UV4GxE3ulYUGQ qPCeC8dkW64N2N7sUnapax/1fUqwKUWcpBT4vi2QQogArmcOnY4TkENN3vm6TaK1 QIpKvPnFKTYe1C7LIx1WB6PlWAdliSCyDeNZWw9wO1RO0qq+xtbKN4= 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=oo726svRcse0vji3i+oYcnStkjE=; b=agxSeaUd/y7AdGG0Ihz2 yFlzOsoNlHF8C1t4Rx/PWEkYcziLFTcULcozLY8K9+LCncoKcHCSb9XbHJ6d+btK M9gHTj/BSzeIEfcVULmtO9GXUqshWOTxTTg+oIoXeXXmqAyU2E/5ndZ0BwTU51MY R/iJWQUW8S3FyF3Y2tehrlA= Received: (qmail 7772 invoked by alias); 27 Oct 2014 20:36:08 -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 6397 invoked by uid 89); 27 Oct 2014 20:35:53 -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; Mon, 27 Oct 2014 20:35:52 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9RKZhEC004713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Oct 2014 16:35:44 -0400 Received: from c64.redhat.com (vpn-236-51.phx2.redhat.com [10.3.236.51]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9RKYt66021050; Mon, 27 Oct 2014 16:35:43 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [gimple-classes, committed 82/92] Concretize gimple_call_arg_flags Date: Mon, 27 Oct 2014 16:41:20 -0400 Message-Id: <1414442490-14841-83-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1414442490-14841-1-git-send-email-dmalcolm@redhat.com> References: <1414442490-14841-1-git-send-email-dmalcolm@redhat.com> X-IsSubscribed: yes This corresponds to: [PATCH 84/89] Concretize gimple_call_arg_flags https://gcc.gnu.org/ml/gcc-patches/2014-04/msg01186.html from the original 89-patch kit That earlier patch was approved by Jeff: > This is fine, but will need tweaking once the const changes go in. The > final form is approved given its triviality, but please post for > archival purposes. in https://gcc.gnu.org/ml/gcc-patches/2014-05/msg00838.html gcc/ * gimple.h (gimple_call_arg_flags): Require a const_gimple_call rather than a const_gimple. * gimple.c (gimple_call_fnspec): Likewise. (gimple_call_arg_flags): Likewise. * tree-inline.c (remap_gimple_stmt): Use a dyn_cast rather than a is_gimple_call and repeated checked casts. --- gcc/ChangeLog.gimple-classes | 13 +++++++++++++ gcc/gimple.c | 4 ++-- gcc/gimple.h | 2 +- gcc/tree-inline.c | 6 +++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog.gimple-classes b/gcc/ChangeLog.gimple-classes index 56fe40d..e064bcf 100644 --- a/gcc/ChangeLog.gimple-classes +++ b/gcc/ChangeLog.gimple-classes @@ -1,5 +1,18 @@ 2014-10-24 David Malcolm + Concretize gimple_call_arg_flags + + * gimple.h (gimple_call_arg_flags): Require a const_gimple_call + rather than a const_gimple. + + * gimple.c (gimple_call_fnspec): Likewise. + (gimple_call_arg_flags): Likewise. + + * tree-inline.c (remap_gimple_stmt): Use a dyn_cast rather than a + is_gimple_call and repeated checked casts. + +2014-10-24 David Malcolm + Concretize gimple_call_set_tail and gimple_call_tail_p * gimple.h (gimple_call_set_tail): Require a gimple_call. diff --git a/gcc/gimple.c b/gcc/gimple.c index a244617..73aa6c1 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1367,7 +1367,7 @@ gimple_call_flags (const_gimple stmt) /* Return the "fn spec" string for call STMT. */ static const_tree -gimple_call_fnspec (const_gimple stmt) +gimple_call_fnspec (const_gimple_call stmt) { tree type, attr; @@ -1388,7 +1388,7 @@ gimple_call_fnspec (const_gimple stmt) /* Detects argument flags for argument number ARG on call STMT. */ int -gimple_call_arg_flags (const_gimple stmt, unsigned arg) +gimple_call_arg_flags (const_gimple_call stmt, unsigned arg) { const_tree attr = gimple_call_fnspec (stmt); diff --git a/gcc/gimple.h b/gcc/gimple.h index 9d09804..a396ec3 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -1373,7 +1373,7 @@ bool empty_body_p (gimple_seq); gimple_seq gimple_seq_copy (gimple_seq); bool gimple_call_same_target_p (const_gimple, const_gimple); int gimple_call_flags (const_gimple); -int gimple_call_arg_flags (const_gimple, unsigned); +int gimple_call_arg_flags (const_gimple_call, unsigned); int gimple_call_return_flags (const_gimple_call); bool gimple_assign_copy_p (gimple); bool gimple_assign_ssa_name_copy_p (gimple); diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 84dfea8..a0a299b 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1548,9 +1548,9 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) copy = gimple_copy (stmt); /* Clear flags that need revisiting. */ - if (is_gimple_call (copy) - && gimple_call_tail_p (as_a (copy))) - gimple_call_set_tail (as_a (copy), false); + if (gimple_call call_stmt = dyn_cast (copy)) + if (gimple_call_tail_p (call_stmt)) + gimple_call_set_tail (call_stmt, false); /* Remap the region numbers for __builtin_eh_{pointer,filter}, RESX and EH_DISPATCH. */