From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119569 invoked by alias); 23 Oct 2017 17:40:30 -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 119552 invoked by uid 89); 23 Oct 2017 17:40:30 -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=099 X-HELO: mail-wr0-f174.google.com Received: from mail-wr0-f174.google.com (HELO mail-wr0-f174.google.com) (209.85.128.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Oct 2017 17:40:28 +0000 Received: by mail-wr0-f174.google.com with SMTP id 15so4381668wrb.5 for ; Mon, 23 Oct 2017 10:40:28 -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=TtQTsbcBuYrSIEpPWRIW+fUKjXcBU2DfZ7zeZ2Xnaw8=; b=H2YatHqKO8DyujAKB2OjcYYKbMZK6kg4genwfgEq2hTaXHGsCaNU43GhUiXbH2J4J/ KhQI1Y0pbYMr/D+Ksyx/Q04148GfO6ScXeOfpObUjcpFAETwTgVy3wGcR/ytpeT5Gp/b uKd98yqZMuEwSCNEAQ0rskoVQblu4JCABtsgHVUXR7w4tJScG7Mhr4z9uNsDWgpfFtyV u+oGJ7YZX8lXkW4gc5sraCqEOtc7phw/8wH/0V4spOK7Na85LgMiTybNTqWa+IMXWvdh eLlqFV3TlH+Qj0eVn9SHYyiluBM4FcXzdA93hbZrrqO7HfbemvKXho+893jb7RTJDS8C mXeA== X-Gm-Message-State: AMCzsaUlnqDvjoD8/fJcwr0AtDG/bT20KS3GQJ59k34XtUOB0IsTcZUU MTTUDemrhcAcFcEO/S4Jvx6w1l2yAPY= X-Google-Smtp-Source: ABhQp+SP6Gm52wrI5ZxIjo9zqSsSwkLOa8w9nmSYeAhhYa5rBWujl62Xs/peF39p0jBfYanQBr6AQQ== X-Received: by 10.223.157.40 with SMTP id k40mr6447203wre.153.1508780426577; Mon, 23 Oct 2017 10:40:26 -0700 (PDT) Received: from localhost ([2.26.27.199]) by smtp.gmail.com with ESMTPSA id m138sm4976440wmd.29.2017.10.23.10.40.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Oct 2017 10:40:25 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [099/nnn] poly_int: struct_value_size References: <871sltvm7r.fsf@linaro.org> Date: Mon, 23 Oct 2017 17:40:00 -0000 In-Reply-To: <871sltvm7r.fsf@linaro.org> (Richard Sandiford's message of "Mon, 23 Oct 2017 17:54:32 +0100") Message-ID: <87wp3ldapi.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/msg01600.txt.bz2 This patch makes calls.c treat struct_value_size (one of the operands to a call pattern) as polynomial. 2017-10-23 Richard Sandiford Alan Hayward David Sherwood gcc/ * calls.c (emit_call_1, expand_call): Change struct_value_size from a HOST_WIDE_INT to a poly_int64. Index: gcc/calls.c =================================================================== --- gcc/calls.c 2017-10-23 17:25:45.501604113 +0100 +++ gcc/calls.c 2017-10-23 17:25:46.488568637 +0100 @@ -377,7 +377,7 @@ emit_call_1 (rtx funexp, tree fntree ATT tree funtype ATTRIBUTE_UNUSED, poly_int64 stack_size ATTRIBUTE_UNUSED, poly_int64 rounded_stack_size, - HOST_WIDE_INT struct_value_size ATTRIBUTE_UNUSED, + poly_int64 struct_value_size ATTRIBUTE_UNUSED, rtx next_arg_reg ATTRIBUTE_UNUSED, rtx valreg, int old_inhibit_defer_pop, rtx call_fusage, int ecf_flags, cumulative_args_t args_so_far ATTRIBUTE_UNUSED) @@ -437,7 +437,8 @@ emit_call_1 (rtx funexp, tree fntree ATT next_arg_reg, NULL_RTX); else pat = targetm.gen_sibcall (funmem, rounded_stack_size_rtx, - next_arg_reg, GEN_INT (struct_value_size)); + next_arg_reg, + gen_int_mode (struct_value_size, Pmode)); } /* If the target has "call" or "call_value" insns, then prefer them if no arguments are actually popped. If the target does not have @@ -470,7 +471,7 @@ emit_call_1 (rtx funexp, tree fntree ATT next_arg_reg, NULL_RTX); else pat = targetm.gen_call (funmem, rounded_stack_size_rtx, next_arg_reg, - GEN_INT (struct_value_size)); + gen_int_mode (struct_value_size, Pmode)); } emit_insn (pat); @@ -3048,7 +3049,7 @@ expand_call (tree exp, rtx target, int i /* Size of aggregate value wanted, or zero if none wanted or if we are using the non-reentrant PCC calling convention or expecting the value in registers. */ - HOST_WIDE_INT struct_value_size = 0; + poly_int64 struct_value_size = 0; /* Nonzero if called function returns an aggregate in memory PCC style, by returning the address of where to find it. */ int pcc_struct_value = 0; @@ -3210,7 +3211,8 @@ expand_call (tree exp, rtx target, int i } #else /* not PCC_STATIC_STRUCT_RETURN */ { - struct_value_size = int_size_in_bytes (rettype); + if (!poly_int_tree_p (TYPE_SIZE_UNIT (rettype), &struct_value_size)) + struct_value_size = -1; /* Even if it is semantically safe to use the target as the return slot, it may be not sufficiently aligned for the return type. */