From patchwork Mon Apr 21 16:57:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 340976 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 AB6951400CF for ; Tue, 22 Apr 2014 12:43:13 +1000 (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:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=vxFeumTB3EhexbiUzIMvZO2YSMWVk27IlHXqSjSV+e3wtPdv3iTVc sK8lqDRI41c+4G9jEzMWVUAz1+8vVijuTBUDAVG1iZkBbMhBIIGMWYTrHnoHiiRl HvxxZWxDOE5v2z5bi15lgGxvF+eXZCrxEhO0aYbj18UW5GJ3FKtFJY= 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=GrGDQLBChXwP8deSTAAemu4jKs0=; b=yJ+quaAc2zylFOJ2eKcT Bbnu3q+yJ3PULfm9aVnu8Aor7Gg9zyRu7EO5dD3+GVb6y68sVeKqi7FLHGG1LRCW 01p/0qlBW0LDd0NIY8FpOhOJTzCBFQHTQ6dXQjvCYGJxi08gj7hK+X6aVPIT6mKD Kmc2hdAh7xHMmIKLAxyi0RI= Received: (qmail 22009 invoked by alias); 21 Apr 2014 17:12:46 -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 21992 invoked by uid 89); 21 Apr 2014 17:12:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 21 Apr 2014 17:12:44 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WcHXU-0002VW-1i for gcc-patches@gcc.gnu.org; Mon, 21 Apr 2014 12:57:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20459) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcHXT-0002VH-QQ for gcc-patches@gcc.gnu.org; Mon, 21 Apr 2014 12:57:51 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3LGup1I003799 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 21 Apr 2014 12:56:51 -0400 Received: from c64.redhat.com (vpn-227-164.phx2.redhat.com [10.3.227.164]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3LGtvOk023014; Mon, 21 Apr 2014 12:56:50 -0400 From: David Malcolm To: gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH 85/89] Concretize gimple_assign_nontemporal_move_p Date: Mon, 21 Apr 2014 12:57:56 -0400 Message-Id: <1398099480-49147-86-git-send-email-dmalcolm@redhat.com> In-Reply-To: <1398099480-49147-1-git-send-email-dmalcolm@redhat.com> References: <1398099480-49147-1-git-send-email-dmalcolm@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-IsSubscribed: yes gcc/ * gimple.h (gimple_assign_nontemporal_move_p): Require a const_gimple_assign rather than a const_gimple. * cfgexpand.c (expand_gimple_stmt_1): Add local assign_stmt and checked cast within "case GIMPLE_ASSIGN". * gimple-streamer-out.c (output_gimple_stmt): Add checked cast to gimple_assign. --- gcc/cfgexpand.c | 18 ++++++++++-------- gcc/gimple-streamer-out.c | 5 ++++- gcc/gimple.h | 3 +-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 983cec0..4447ca0 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -3189,7 +3189,8 @@ expand_gimple_stmt_1 (gimple stmt) case GIMPLE_ASSIGN: { - tree lhs = gimple_assign_lhs (stmt); + gimple_assign assign_stmt = stmt->as_a_gimple_assign (); + tree lhs = gimple_assign_lhs (assign_stmt); /* Tree expand used to fiddle with |= and &= of two bitfield COMPONENT_REFs here. This can't happen with gimple, the LHS @@ -3199,7 +3200,7 @@ expand_gimple_stmt_1 (gimple stmt) || get_gimple_rhs_class (gimple_expr_code (stmt)) == GIMPLE_SINGLE_RHS) { - tree rhs = gimple_assign_rhs1 (stmt); + tree rhs = gimple_assign_rhs1 (assign_stmt); gcc_assert (get_gimple_rhs_class (gimple_expr_code (stmt)) == GIMPLE_SINGLE_RHS); if (gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (rhs)) @@ -3210,12 +3211,13 @@ expand_gimple_stmt_1 (gimple stmt) ; else expand_assignment (lhs, rhs, - gimple_assign_nontemporal_move_p (stmt)); + gimple_assign_nontemporal_move_p ( + assign_stmt)); } else { rtx target, temp; - bool nontemporal = gimple_assign_nontemporal_move_p (stmt); + bool nontemporal = gimple_assign_nontemporal_move_p (assign_stmt); struct separate_ops ops; bool promoted = false; @@ -3223,18 +3225,18 @@ expand_gimple_stmt_1 (gimple stmt) if (GET_CODE (target) == SUBREG && SUBREG_PROMOTED_VAR_P (target)) promoted = true; - ops.code = gimple_assign_rhs_code (stmt); + ops.code = gimple_assign_rhs_code (assign_stmt); ops.type = TREE_TYPE (lhs); switch (get_gimple_rhs_class (gimple_expr_code (stmt))) { case GIMPLE_TERNARY_RHS: - ops.op2 = gimple_assign_rhs3 (stmt); + ops.op2 = gimple_assign_rhs3 (assign_stmt); /* Fallthru */ case GIMPLE_BINARY_RHS: - ops.op1 = gimple_assign_rhs2 (stmt); + ops.op1 = gimple_assign_rhs2 (assign_stmt); /* Fallthru */ case GIMPLE_UNARY_RHS: - ops.op0 = gimple_assign_rhs1 (stmt); + ops.op0 = gimple_assign_rhs1 (assign_stmt); break; default: gcc_unreachable (); diff --git a/gcc/gimple-streamer-out.c b/gcc/gimple-streamer-out.c index b27d4de..22cc03a 100644 --- a/gcc/gimple-streamer-out.c +++ b/gcc/gimple-streamer-out.c @@ -80,7 +80,10 @@ output_gimple_stmt (struct output_block *ob, gimple stmt) bp_pack_var_len_unsigned (&bp, gimple_num_ops (stmt)); bp_pack_value (&bp, gimple_no_warning_p (stmt), 1); if (is_gimple_assign (stmt)) - bp_pack_value (&bp, gimple_assign_nontemporal_move_p (stmt), 1); + bp_pack_value (&bp, + gimple_assign_nontemporal_move_p ( + stmt->as_a_gimple_assign ()), + 1); bp_pack_value (&bp, gimple_has_volatile_ops (stmt), 1); hist = gimple_histogram_value (cfun, stmt); bp_pack_value (&bp, hist != NULL, 1); diff --git a/gcc/gimple.h b/gcc/gimple.h index dd6dd38..d487629 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -2727,9 +2727,8 @@ gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code, /* Returns true if GS is a nontemporal move. */ static inline bool -gimple_assign_nontemporal_move_p (const_gimple gs) +gimple_assign_nontemporal_move_p (const_gimple_assign gs) { - GIMPLE_CHECK (gs, GIMPLE_ASSIGN); return gs->nontemporal_move; }