From patchwork Mon Oct 23 17:19:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116788 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4884702qgn; Mon, 23 Oct 2017 10:19:32 -0700 (PDT) X-Received: by 10.99.134.200 with SMTP id x191mr11978893pgd.86.1508779172293; Mon, 23 Oct 2017 10:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508779172; cv=none; d=google.com; s=arc-20160816; b=VR1IFY1wTZj6DWkUwmGEr0ijzr28MZN0kdb/XR89gdimtrVD1M5Ufhq/d+ohK0EY/8 e1TN46NphKJdPZZd1lZqqGcCF1NuoSlMssVs/wb4JEdAlXewX8Ivzck+ajX/ITr/k4EZ UCGVw37ap+llWom3X4/jHGIJENc8Dy84Keym1GxcteBVpvpdprzB9lwFbSsERI/y/1tA DlHdFnqEgHx568/S1SdfWJZmMj2+71HSHX8W1wCBc5CZdjneZPDb4W6B9DnomPwd184+ Prud1qhWzOQ+nj0aYGaZgPJnYU+Kn8GNWqqoZWID7N7wmvCC1UKsDBBCqK/EkvQDqfrc uCcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:mail-followup-to:to:from:delivered-to:sender:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mailing-list:dkim-signature:domainkey-signature :arc-authentication-results; bh=3dIJGuCbTmhotg1CFBO4CboqIq6Hry0tcF5BK7m8p9w=; b=MeH5n4oS/EnO5fnczeZn+Vo8mHvC14lF2gaoMEtajuyvcv0iIcJ71KKb6rAnGBSnx0 zLm5aA9341otQVBp2BD92xm9eKTz82FLHdMhUt/u9IyIhj5ajOtloU03Fit+4GFeqRa8 jVzz6omzsLYuMhJPfs/flB3Nju2k73ZraXq9hdoXYyA8fGWmh6yrQx3yiJxFU3ZzOhje dOGpU/OseQMAomm0Y9zEwX2iCQOZZcYahaBI4ClHt+B8sdiNzbB2hVFwez7mn5vak8zl Y38BGoUhOkfrIDYAeSx9El40yAOrTd1ioD/aWrr9ErpEIUakoaWZOl5HHbqVXHolwhFp V8Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rgCTvQlm; spf=pass (google.com: domain of gcc-patches-return-464820-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464820-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 31si4285112plz.611.2017.10.23.10.19.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:19:32 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464820-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=rgCTvQlm; spf=pass (google.com: domain of gcc-patches-return-464820-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464820-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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:subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=default; b=viML6yC+nJZzrmoKn0BBjDuMGcG5m HLGUHd/BiriRyj8m2anvK37BST8FLTVnUzJSEx5POWTKQD7Cdzkf0EurFBbbgavT 9FtDOOHRyBzZBPi7nX2ScCR6d9v58Ex73lCqFU5t9UJ+983hIcWWTkWSIUSr0ycK x5khzufyrPHtUk= 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:subject:references:date:in-reply-to:message-id:mime-version :content-type; s=default; bh=G7Za7AAIQwbX8lC1Zur7o1SYKHc=; b=rgC TvQlmYcKBYz3W7BlJV40MYiHsSL2tFKZtbY2dmhSRKgkwWR76CSjZJZpf1rndYVS LG0+hrugKRBLDppSQEKcs9FNc2rvxY2pVHFYOGmNZ2Z/ipXGqc9lz4VKVgN0ea7f dyzkximlcevLs7y0NQ+U2sXw4f1zGraJkkvW5HII= Received: (qmail 81085 invoked by alias); 23 Oct 2017 17:19: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 80948 invoked by uid 89); 23 Oct 2017 17:19:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=044 X-HELO: mail-wr0-f177.google.com Received: from mail-wr0-f177.google.com (HELO mail-wr0-f177.google.com) (209.85.128.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:19:09 +0000 Received: by mail-wr0-f177.google.com with SMTP id z55so12088469wrz.1 for ; Mon, 23 Oct 2017 10:19:09 -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=3dIJGuCbTmhotg1CFBO4CboqIq6Hry0tcF5BK7m8p9w=; b=Hgm/MWxvbnXevTKQLw7ec75/JafZsx04XHD+qri66eB49EKnCO/srRVPOerqxZnTme WoQxdY80oPeCh6XdzQkJA8Pv8rz4SDbIcxRmjfRT2fmqF8Am2V/ikFMq61KIDyxjEVtu gPomXi9tJmrI2CyRXECttKd/tBbFNyAY/XaJNAjMwalVjpW9i1viyikN0+4GS8zClR0g bl47U0AFNcm5rZSeC+w8JzYHtVq4JZKHIm4hvgs9+hH8riYI7ObUCgizF0m9Gmg5i8sW TRGA95q9Dez0ke9qvhzoBh7NREZcRDGC1vUUUpJSgD9RgNZ0b2etYWMWfFN2hDXUwGZn /Otg== X-Gm-Message-State: AMCzsaWoKaHEbTUZOPvIW9j30x0fVfqPSukw7KnSk6ErNg7PjStwQObG afRvGh6KJMFj+u3tZpjtmIHLrm0K4CY= X-Google-Smtp-Source: ABhQp+QJB+aZ6Hfk3wz9QApkHwzQGYFUsV7nuZLaHaXKhK/zV7YYRdncG3c4nQPiFwX9irTHhZhV3g== X-Received: by 10.223.134.14 with SMTP id 14mr12170386wrv.148.1508779147333; Mon, 23 Oct 2017 10:19:07 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id q3sm5913258wrd.78.2017.10.23.10.19.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:19:06 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [044/nnn] poly_int: push_block/emit_push_insn References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:19:05 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87lgk1n5o6.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch changes the "extra" parameters to push_block and emit_push_insn from int to poly_int64. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * expr.h (push_block, emit_push_insn): Change the "extra" parameter from HOST_WIDE_INT to poly_int64. * expr.c (push_block, emit_push_insn): Likewise. Index: gcc/expr.h =================================================================== --- gcc/expr.h 2017-10-23 17:18:43.842393134 +0100 +++ gcc/expr.h 2017-10-23 17:18:56.434286222 +0100 @@ -233,11 +233,11 @@ extern rtx emit_move_resolve_push (machi /* Push a block of length SIZE (perhaps variable) and return an rtx to address the beginning of the block. */ -extern rtx push_block (rtx, int, int); +extern rtx push_block (rtx, poly_int64, int); /* Generate code to push something onto the stack, given its mode and type. */ extern bool emit_push_insn (rtx, machine_mode, tree, rtx, unsigned int, - int, rtx, int, rtx, rtx, int, rtx, bool); + int, rtx, poly_int64, rtx, rtx, int, rtx, bool); /* Extract the accessible bit-range from a COMPONENT_REF. */ extern void get_bit_range (poly_uint64_pod *, poly_uint64_pod *, tree, Index: gcc/expr.c =================================================================== --- gcc/expr.c 2017-10-23 17:18:47.661057448 +0100 +++ gcc/expr.c 2017-10-23 17:18:56.434286222 +0100 @@ -3865,19 +3865,19 @@ compress_float_constant (rtx x, rtx y) otherwise, the padding comes at high addresses. */ rtx -push_block (rtx size, int extra, int below) +push_block (rtx size, poly_int64 extra, int below) { rtx temp; size = convert_modes (Pmode, ptr_mode, size, 1); if (CONSTANT_P (size)) anti_adjust_stack (plus_constant (Pmode, size, extra)); - else if (REG_P (size) && extra == 0) + else if (REG_P (size) && known_zero (extra)) anti_adjust_stack (size); else { temp = copy_to_mode_reg (Pmode, size); - if (extra != 0) + if (maybe_nonzero (extra)) temp = expand_binop (Pmode, add_optab, temp, gen_int_mode (extra, Pmode), temp, 0, OPTAB_LIB_WIDEN); @@ -3887,7 +3887,7 @@ push_block (rtx size, int extra, int bel if (STACK_GROWS_DOWNWARD) { temp = virtual_outgoing_args_rtx; - if (extra != 0 && below) + if (maybe_nonzero (extra) && below) temp = plus_constant (Pmode, temp, extra); } else @@ -3895,7 +3895,7 @@ push_block (rtx size, int extra, int bel if (CONST_INT_P (size)) temp = plus_constant (Pmode, virtual_outgoing_args_rtx, -INTVAL (size) - (below ? 0 : extra)); - else if (extra != 0 && !below) + else if (maybe_nonzero (extra) && !below) temp = gen_rtx_PLUS (Pmode, virtual_outgoing_args_rtx, negate_rtx (Pmode, plus_constant (Pmode, size, extra))); @@ -4269,7 +4269,7 @@ memory_load_overlap (rtx x, rtx y, HOST_ bool emit_push_insn (rtx x, machine_mode mode, tree type, rtx size, - unsigned int align, int partial, rtx reg, int extra, + unsigned int align, int partial, rtx reg, poly_int64 extra, rtx args_addr, rtx args_so_far, int reg_parm_stack_space, rtx alignment_pad, bool sibcall_p) { @@ -4357,9 +4357,11 @@ emit_push_insn (rtx x, machine_mode mode /* Push padding now if padding above and stack grows down, or if padding below and stack grows up. But if space already allocated, this has already been done. */ - if (extra && args_addr == 0 - && where_pad != PAD_NONE && where_pad != stack_direction) - anti_adjust_stack (GEN_INT (extra)); + if (maybe_nonzero (extra) + && args_addr == 0 + && where_pad != PAD_NONE + && where_pad != stack_direction) + anti_adjust_stack (gen_int_mode (extra, Pmode)); move_by_pieces (NULL, xinner, INTVAL (size) - used, align, 0); } @@ -4480,9 +4482,11 @@ emit_push_insn (rtx x, machine_mode mode /* Push padding now if padding above and stack grows down, or if padding below and stack grows up. But if space already allocated, this has already been done. */ - if (extra && args_addr == 0 - && where_pad != PAD_NONE && where_pad != stack_direction) - anti_adjust_stack (GEN_INT (extra)); + if (maybe_nonzero (extra) + && args_addr == 0 + && where_pad != PAD_NONE + && where_pad != stack_direction) + anti_adjust_stack (gen_int_mode (extra, Pmode)); /* If we make space by pushing it, we might as well push the real data. Otherwise, we can leave OFFSET nonzero @@ -4531,9 +4535,11 @@ emit_push_insn (rtx x, machine_mode mode /* Push padding now if padding above and stack grows down, or if padding below and stack grows up. But if space already allocated, this has already been done. */ - if (extra && args_addr == 0 - && where_pad != PAD_NONE && where_pad != stack_direction) - anti_adjust_stack (GEN_INT (extra)); + if (maybe_nonzero (extra) + && args_addr == 0 + && where_pad != PAD_NONE + && where_pad != stack_direction) + anti_adjust_stack (gen_int_mode (extra, Pmode)); #ifdef PUSH_ROUNDING if (args_addr == 0 && PUSH_ARGS) @@ -4578,8 +4584,8 @@ emit_push_insn (rtx x, machine_mode mode } } - if (extra && args_addr == 0 && where_pad == stack_direction) - anti_adjust_stack (GEN_INT (extra)); + if (maybe_nonzero (extra) && args_addr == 0 && where_pad == stack_direction) + anti_adjust_stack (gen_int_mode (extra, Pmode)); if (alignment_pad && args_addr == 0) anti_adjust_stack (alignment_pad);