From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115529 invoked by alias); 27 Jul 2015 03:10:56 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 115449 invoked by uid 89); 27 Jul 2015 03:10:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no 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, 27 Jul 2015 03:10:52 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZJYoQ-0002un-Mz for gcc-patches@gcc.gnu.org; Sun, 26 Jul 2015 23:10:49 -0400 Received: from [2600:3c03::f03c:91ff:fe6e:c625] (port=49217 helo=paperclip.tbsaunde.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJYoQ-0002uc-IR for gcc-patches@gcc.gnu.org; Sun, 26 Jul 2015 23:10:46 -0400 Received: from iceball.corp.tor1.mozilla.com (unknown [23.233.68.71]) by paperclip.tbsaunde.org (Postfix) with ESMTPSA id 67786C0D5 for ; Mon, 27 Jul 2015 03:10:45 +0000 (UTC) From: tbsaunde+gcc@tbsaunde.org To: gcc-patches@gcc.gnu.org Subject: [PATCH 6/9] tree-chkp.c: switch to targetm.pointer_size () Date: Mon, 27 Jul 2015 03:42:00 -0000 Message-Id: <1437966615-21093-7-git-send-email-tbsaunde+gcc@tbsaunde.org> In-Reply-To: <1437966615-21093-1-git-send-email-tbsaunde+gcc@tbsaunde.org> References: <1437966615-21093-1-git-send-email-tbsaunde+gcc@tbsaunde.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c03::f03c:91ff:fe6e:c625 X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg02207.txt.bz2 From: Trevor Saunders gcc/ChangeLog: 2015-07-26 Trevor Saunders * tree-chkp.c (chkp_build_array_ref): Call targetm.pointer_size (). (chkp_find_bounds_for_elem): Likewise. (chkp_find_bound_slots_1): Likewise. (chkp_add_bounds_to_call_stmt): Likewise. (chkp_instrument_function): Likewise. --- gcc/tree-chkp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c index 8c1b48c..456e79b 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -1583,7 +1583,7 @@ chkp_build_array_ref (tree arr, tree etype, tree esize, ALL_BOUNDS[i] is filled with elem bounds if there is a field in TYPE which has pointer type and offset - equal to i * POINTER_SIZE in bits. */ + equal to i * targetm.pointer_size () in bits. */ static void chkp_find_bounds_for_elem (tree elem, tree *all_bounds, HOST_WIDE_INT offs, @@ -1593,7 +1593,7 @@ chkp_find_bounds_for_elem (tree elem, tree *all_bounds, if (BOUNDED_TYPE_P (type)) { - if (!all_bounds[offs / POINTER_SIZE]) + if (!all_bounds[offs / targetm.pointer_size ()]) { tree temp = make_temp_ssa_name (type, NULL, ""); gimple assign = gimple_build_assign (temp, elem); @@ -1602,7 +1602,8 @@ chkp_find_bounds_for_elem (tree elem, tree *all_bounds, gsi_insert_before (iter, assign, GSI_SAME_STMT); gsi = gsi_for_stmt (assign); - all_bounds[offs / POINTER_SIZE] = chkp_find_bounds (temp, &gsi); + all_bounds[offs / targetm.pointer_size ()] + = chkp_find_bounds (temp, &gsi); } } else if (RECORD_OR_UNION_TYPE_P (type)) @@ -1659,7 +1660,7 @@ chkp_find_bound_slots_1 (const_tree type, bitmap have_bound, HOST_WIDE_INT offs) { if (BOUNDED_TYPE_P (type)) - bitmap_set_bit (have_bound, offs / POINTER_SIZE); + bitmap_set_bit (have_bound, offs / targetm.pointer_size ()); else if (RECORD_OR_UNION_TYPE_P (type)) { tree field; @@ -1906,7 +1907,7 @@ chkp_add_bounds_to_call_stmt (gimple_stmt_iterator *gsi) else if (chkp_type_has_pointer (type)) { HOST_WIDE_INT max_bounds - = TREE_INT_CST_LOW (TYPE_SIZE (type)) / POINTER_SIZE; + = TREE_INT_CST_LOW (TYPE_SIZE (type)) / targetm.pointer_size (); tree *all_bounds = (tree *)xmalloc (sizeof (tree) * max_bounds); HOST_WIDE_INT bnd_no; @@ -4267,7 +4268,8 @@ chkp_instrument_function (void) EXECUTE_IF_SET_IN_BITMAP (slots, 0, bnd_no, bi) { tree bounds = chkp_get_next_bounds_parm (arg); - HOST_WIDE_INT offs = bnd_no * POINTER_SIZE / BITS_PER_UNIT; + HOST_WIDE_INT offs + = bnd_no * targetm.pointer_size () / BITS_PER_UNIT; tree addr = chkp_build_addr_expr (orig_arg); tree ptr = build2 (MEM_REF, ptr_type_node, addr, build_int_cst (ptr_type_node, offs)); -- 2.4.0