From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13714 invoked by alias); 23 Oct 2017 17:11:34 -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 13573 invoked by uid 89); 23 Oct 2017 17:11:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=028, adjustments X-HELO: mail-wr0-f181.google.com Received: from mail-wr0-f181.google.com (HELO mail-wr0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:11:31 +0000 Received: by mail-wr0-f181.google.com with SMTP id l8so5266319wre.12 for ; Mon, 23 Oct 2017 10:11:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=5ZR+FQ4gG/oUVe6H86G3wSnw8r9NPP7p9P+LCV008eI=; b=d0PnEy+B810aJSEFrTIm3OFmiayBbgVdCcqh4YeTQ7Vs/ajO7MIytaqzz0NXjBIPnq 9SI0SpwGh4Lbbvtk5ECl67J33s2xqlerns0HWoHSABBER6S0iFL4LLeczJ6aywv1oLp/ XH9CgM8gXe8Q37l/Wcgx/r91uEujgzh+Sabt0AF6XJRPLE2alri7hBOV23UxEbHSzNM/ y688aHqooBd5lzifbr82b2BfI+kt/ouFlvhSaARyuR9uD8l3RYPUSNZHi+XhBZ1gQ5nk lOyhFmZ81UINo0RAXas1Td+qfjk3hl/zeR//vD/RuEXMOFcP/jmL782++zgQySWjUqtI Ncww== X-Gm-Message-State: AMCzsaXSHw3wRLUNhzPBCxgec+ESaiIiatkEyKPmgGPu8ctPOBUkJEiH Z5zy9k14ETh91QwU/jYPzr6H89bGQUU= X-Google-Smtp-Source: ABhQp+ST6VwSKr8DcPm0/n/JbsXgidMnIMjXh0SmUSXNwbHHBiim2ez56tzN/VUQ0snoWSdy1fLQTg== X-Received: by 10.223.139.18 with SMTP id n18mr11123707wra.223.1508778689685; Mon, 23 Oct 2017 10:11:29 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id t18sm293254wrg.49.2017.10.23.10.11.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:11:29 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [028/nnn] poly_int: ipa_parm_adjustment References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 17:12:00 -0000 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87inf5pz5r.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-10/txt/msg01529.txt.bz2 This patch changes the type of ipa_parm_adjustment::offset from HOST_WIDE_INT to poly_int64 and updates uses accordingly. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * ipa-prop.h (ipa_parm_adjustment::offset): Change from HOST_WIDE_INT to poly_int64_pod. * ipa-prop.c (ipa_modify_call_arguments): Track polynomail parameter offsets. Index: gcc/ipa-prop.h =================================================================== --- gcc/ipa-prop.h 2017-10-23 17:07:40.959671257 +0100 +++ gcc/ipa-prop.h 2017-10-23 17:16:58.508429306 +0100 @@ -828,7 +828,7 @@ struct ipa_parm_adjustment /* Offset into the original parameter (for the cases when the new parameter is a component of an original one). */ - HOST_WIDE_INT offset; + poly_int64_pod offset; /* Zero based index of the original parameter this one is based on. */ int base_index; Index: gcc/ipa-prop.c =================================================================== --- gcc/ipa-prop.c 2017-10-23 17:07:40.959671257 +0100 +++ gcc/ipa-prop.c 2017-10-23 17:16:58.507429441 +0100 @@ -4302,15 +4302,14 @@ ipa_modify_call_arguments (struct cgraph simply taking the address of a reference inside the original aggregate. */ - gcc_checking_assert (adj->offset % BITS_PER_UNIT == 0); + poly_int64 byte_offset = exact_div (adj->offset, BITS_PER_UNIT); base = gimple_call_arg (stmt, adj->base_index); loc = DECL_P (base) ? DECL_SOURCE_LOCATION (base) : EXPR_LOCATION (base); if (TREE_CODE (base) != ADDR_EXPR && POINTER_TYPE_P (TREE_TYPE (base))) - off = build_int_cst (adj->alias_ptr_type, - adj->offset / BITS_PER_UNIT); + off = build_int_cst (adj->alias_ptr_type, byte_offset); else { HOST_WIDE_INT base_offset; @@ -4330,8 +4329,7 @@ ipa_modify_call_arguments (struct cgraph if (!base) { base = build_fold_addr_expr (prev_base); - off = build_int_cst (adj->alias_ptr_type, - adj->offset / BITS_PER_UNIT); + off = build_int_cst (adj->alias_ptr_type, byte_offset); } else if (TREE_CODE (base) == MEM_REF) { @@ -4341,8 +4339,7 @@ ipa_modify_call_arguments (struct cgraph deref_align = TYPE_ALIGN (TREE_TYPE (base)); } off = build_int_cst (adj->alias_ptr_type, - base_offset - + adj->offset / BITS_PER_UNIT); + base_offset + byte_offset); off = int_const_binop (PLUS_EXPR, TREE_OPERAND (base, 1), off); base = TREE_OPERAND (base, 0); @@ -4350,8 +4347,7 @@ ipa_modify_call_arguments (struct cgraph else { off = build_int_cst (adj->alias_ptr_type, - base_offset - + adj->offset / BITS_PER_UNIT); + base_offset + byte_offset); base = build_fold_addr_expr (base); } } @@ -4602,7 +4598,7 @@ ipa_get_adjustment_candidate (tree **exp struct ipa_parm_adjustment *adj = &adjustments[i]; if (adj->base == base - && (adj->offset == offset || adj->op == IPA_PARM_OP_REMOVE)) + && (must_eq (adj->offset, offset) || adj->op == IPA_PARM_OP_REMOVE)) { cand = adj; break; @@ -4766,7 +4762,10 @@ ipa_dump_param_adjustments (FILE *file, else if (adj->op == IPA_PARM_OP_REMOVE) fprintf (file, ", remove_param"); else - fprintf (file, ", offset %li", (long) adj->offset); + { + fprintf (file, ", offset "); + print_dec (adj->offset, file); + } if (adj->by_ref) fprintf (file, ", by_ref"); print_node_brief (file, ", type: ", adj->type, 0);