From patchwork Mon Oct 23 17:35:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 116834 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4899493qgn; Mon, 23 Oct 2017 10:36:07 -0700 (PDT) X-Received: by 10.98.10.153 with SMTP id 25mr13560748pfk.60.1508780167545; Mon, 23 Oct 2017 10:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508780167; cv=none; d=google.com; s=arc-20160816; b=DI845fzjt0P6lf4aWQZKADkwlllzVKTIQ3AXbvP4bjyG+jypuhDcComlBvUmiYB29a yUxH6MaeKCTG6KP67u4AqRqZwXM/qd7PVJN10Blqkzlxw6ieeQpeGsc2c/DYeaCVkv8E VLOKWqYl0forX7PuS235juHtavpAT6bEJDbt3lrSO/J6bZtU1I34gkKRuHNG/NZBLTdw OXuerXZgrumqnfPjfwhWqPAyD3NWRL4F8Qg3oprhr+FeOCJsTOe1oY174ra8Rl5IZDa8 OP/uvF7sFlBAGrEELA0OTFLBHjWkr8haA0VOZUj5JiXcN9RwB69IZBo8A7WkSJSacSYb r3pA== 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=EprfI3vyxiPlN8vmp9SvQBr5SwqV8WjdikNsfZcnECs=; b=GEA6BXbLhPMRK5z6RF53v+yNttdmPJp8qeGcfibNDaulEaX6ckcPXpkvY0pjwskxtv y21DQbFoJleF9nZ+xmqqjNulxWt/kjMghu1/c+40yZoZQCLvpsFylg6D+cDFahELmPNM uPrrVmSoCnSOFKO8p6eys+BBTr6TnZsMuz3CXDvlVV/GDI2SR6bmZZ1Rvr9lJiSc6JGy WqShcOtx1jXkdFCJRYtfpxXEL+PCJD8buHNc8LSenf8l9UFKAwPyaB7CPrZKjg/6NsoS oLl51QQcfACqRmb7Sefs+Zrir+IzU5VVLa1ppTQiYo1NH85oSZ3bsSGzjZwE0ERgjiFq wsyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=BWVsjaTM; spf=pass (google.com: domain of gcc-patches-return-464865-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464865-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 b13si5150029pgu.17.2017.10.23.10.36.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 10:36:07 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-464865-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=BWVsjaTM; spf=pass (google.com: domain of gcc-patches-return-464865-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-464865-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=Sv+n78mZq+0QIkZx+n5doExXBIU9a QcajG1ZvKJ3x6gnSdVDswA6nhksFHDoSarzDLhP0mVKSNpOO+sC4tfqE6srlbHYY DiMlSoonmKZUfTX70vHfKw7CmkrUt8WaNouY1a5c4afhB5YFvtKnsPLjejRA3fXB o4tSu5zQHMARf8= 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=xxargq4gsgsnS2ahCnsgy23igxw=; b=BWV sjaTMX9jMANUO0LoizMjbBaPv8X8CX2ZOWgj0WBJ/CGThoZ7JrClpvKNDfeGmvOL pqGchazpi8p2ZN+7kPYCAclRMY0H7RH4V3y3j7AdvPgxlI85tTupzk5hM3YWS6iL q4hb1Rv63sC9D3JwGtwSYeh2KyOD8MYAXDr7ms4c= Received: (qmail 67509 invoked by alias); 23 Oct 2017 17:35:52 -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 67500 invoked by uid 89); 23 Oct 2017 17:35:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=089 X-HELO: mail-wr0-f176.google.com Received: from mail-wr0-f176.google.com (HELO mail-wr0-f176.google.com) (209.85.128.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:35:51 +0000 Received: by mail-wr0-f176.google.com with SMTP id y39so18215163wrd.4 for ; Mon, 23 Oct 2017 10:35:51 -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=EprfI3vyxiPlN8vmp9SvQBr5SwqV8WjdikNsfZcnECs=; b=l8NGT83FhUvvvdictP7vd2oM6h+IKtUOJ5RDj+2wpyXhBfom8I0o1ThDbW5BOA0i2p wML04Y+PNzeQDxj08l9CxY6fKOe2lsMiN0yw9N5R53sPlXh7d9JCQC5z8rSOaOsJ/ume lH7VK8uzHIZ78sNupDlOlmJphb44du+1z1ETIdmTPE1cBMjqVB8QXgosV4gtEa0ru3ay uYVrs4Pkp9yxCpndnki+1Krsr504JUwlxEJZ/70E6XUjSOdrpGoRHwQDZs2DEGNT8Cpc hqqDXdBGwHo0QTjXWzWtEQHk3IllFZrYPJOMvmvbk4j54Ur6ofVDvt7WY2TvgPSHQ3q9 wMaw== X-Gm-Message-State: AMCzsaWhcWCLAuVwCcXPD5S9PFdTrFuRPD9sE4XxTvtWW3OindWzaa4O 9U2kME4UbYz3lyOc1VHzsXJzIZDab+k= X-Google-Smtp-Source: ABhQp+RkOCI7jIkZ9vJYeBXeUmLccLfSNBIRdL2q97d37VguS86Bi/0AVMb3I451dERuxzO5t5P6Vw== X-Received: by 10.223.135.143 with SMTP id b15mr9999541wrb.278.1508780149317; Mon, 23 Oct 2017 10:35:49 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id y129sm4736814wmg.42.2017.10.23.10.35.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:35:48 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [089/nnn] poly_int: expand_expr_real_1 References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 18:35:48 +0100 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <874lqpg423.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This patch makes the VIEW_CONVERT_EXPR handling in expand_expr_real_1 cope with polynomial type and mode sizes. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * expr.c (expand_expr_real_1): Use tree_to_poly_uint64 instead of int_size_in_bytes when handling VIEW_CONVERT_EXPRs via stack temporaries. Treat the mode size as polynomial too. Index: gcc/expr.c =================================================================== --- gcc/expr.c 2017-10-23 17:25:34.105013764 +0100 +++ gcc/expr.c 2017-10-23 17:25:35.142976454 +0100 @@ -11116,9 +11116,10 @@ expand_expr_real_1 (tree exp, rtx target else if (STRICT_ALIGNMENT) { tree inner_type = TREE_TYPE (treeop0); - HOST_WIDE_INT temp_size - = MAX (int_size_in_bytes (inner_type), - (HOST_WIDE_INT) GET_MODE_SIZE (mode)); + poly_uint64 mode_size = GET_MODE_SIZE (mode); + poly_uint64 op0_size + = tree_to_poly_uint64 (TYPE_SIZE_UNIT (inner_type)); + poly_int64 temp_size = upper_bound (op0_size, mode_size); rtx new_rtx = assign_stack_temp_for_type (mode, temp_size, type); rtx new_with_op0_mode