From patchwork Fri Jan 12 13:33:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 124346 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp2066942qgn; Fri, 12 Jan 2018 05:33:24 -0800 (PST) X-Google-Smtp-Source: ACJfBotO5cJ5noXHKOtmFSC3KGtBuiJhR79phG0E8DDUK07m+sgq/pPp9PjBswKAFfg4ggeaOCNL X-Received: by 10.99.39.70 with SMTP id n67mr21013211pgn.323.1515764004627; Fri, 12 Jan 2018 05:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515764004; cv=none; d=google.com; s=arc-20160816; b=nzphStyObu3iw9UadtuTYVFKQevYWi8kufm8Oi9FA9ZRzRO2Tu3LCcGohOt2sKpmne r2DJVaWKn5rVMwtJt35yUpLLh268EexFqqej9YkUo3+V50F/QWTVlBGgrJw2N1OmKLwT Kkfq6hezhAsDpHECSxQBjTUEEutxuOLs38LXEv/M3NHykCJprRRDku5bR/zH9ZuAXtVj Ajco/qc3ml7yNl6ejXYXFgJzrChyT87NIBNQGanu+fTjsRv/oR76FrENLRBwJAXckOqO BjW0rzbFmyZpIHQfrDlpsixM5TP5mXnkkFWj3AtsV8g8Hy67etbKski6tU7QAO+yslYm h8Vw== 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:cc: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=JHlszLDBe/at65M6qUuBmnsry1hflB1bM1azqIYiydo=; b=dTUyqcpwyuunLkDk0VTaESQAmyUlOQf/hM+uWUFQQT4TvGwsy+Vl89QAtp/Wufo89q qpXujx6iK3zgBjX7K7IiKm0cyeX+Wl9HsFLUFVikV7admrodHB01te8w+2frsMKPiNbK or+YUkRrOsW+iCKPeonI7pJLfedRo+8R/Oq7m9SgPssuUc9JDwKlD7dmmh75ZKMRF9cS y6/TzmagOOZO9nqjrSfsxbjOZa5PrEDPtSi6HumF2aX+Kpqj5bvokD9U2cUyRdtPWF5t P8nBD/XzpjTlpzCvhKItjV710C8wcoRgp0dWhEH9h9YKRRvw6VN9r29Prk6viDfL9hw1 cMZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MF973T6B; spf=pass (google.com: domain of gcc-patches-return-470980-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470980-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 w19si309613pfi.187.2018.01.12.05.33.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jan 2018 05:33:24 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-470980-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=MF973T6B; spf=pass (google.com: domain of gcc-patches-return-470980-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-470980-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:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; q=dns; s=default; b=s2WmwedWdlJBd4BF TYyNW4vVtQ7QeumeIgMIt1zzF4usg4/677Ir6HMF5t1/yX/fz1JDI7YOWBZuuZRP QNZqtYDOKcJ7b9l+dGw5OLpdsiWZKaqaB8tRZwjb0ikwXUe6CJ98LxMjK4/AJRrk prJIpv8H4zceFCRfq1QXXGeHGrw= 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:cc:subject:references:date:in-reply-to:message-id :mime-version:content-type; s=default; bh=+IfFPIqTdKkSONFNYlAVda pPURY=; b=MF973T6BBMDsCVrxGKiMGe5UxP7vRUbUG2dCfnqcZDWL94jhS0JNGe CHNvls4nOWluFcyNKpiUB94XVWLXY14sVLwPpiYFE/vSaLbXc/4k+ubAGVGhR7jw UdHxPmPD/PFlIxqPeotH9RHMZtkCYfcKYwR2qaZs/Rv7OCzodFSpQ= Received: (qmail 107576 invoked by alias); 12 Jan 2018 13:33:13 -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 107535 invoked by uid 89); 12 Jan 2018 13:33:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:87po6f1, Hx-languages-length:1676, H*i:sk:87po6f1 X-HELO: mail-wr0-f169.google.com Received: from mail-wr0-f169.google.com (HELO mail-wr0-f169.google.com) (209.85.128.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jan 2018 13:33:11 +0000 Received: by mail-wr0-f169.google.com with SMTP id 36so5349168wrh.1 for ; Fri, 12 Jan 2018 05:33:10 -0800 (PST) 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:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version; bh=JHlszLDBe/at65M6qUuBmnsry1hflB1bM1azqIYiydo=; b=KUKVzDM0FVP9M9n9DKb9KoHSaPfq/1XAGe/RhVAE6tz9gPp//TMHIRwoifa+7K0GUs ft8TIXonC42FpR23r9SaEcLFQO5d+N8WJ54lQ/RTF6BRDD6HBQcDHel3ca+lYm64ViQN T5k0pOwDMmg+V0P/DjpPSuPDxK1OhvvDdoF+FijWYa1Ql7Dgejzkcv32nPJvSZe6VKy1 ORx/rZglXT4akwfOJJmUYfJRg7dU2uNkDJNMCMo11Cgxsv99Im0rmq7GSQy1ZTjMIZE4 LsHFK00vC0Oh+ArJxVvoZsSb4563SzO8GKOyp1/ayeBEdsKPF+7RhWzrwJOLIaGOmEeB adkg== X-Gm-Message-State: AKwxytcKN6Pa2X6UhTAzM317DVX5HVWS/b4wXGV8WolIpyb545etDpBv KbpvJMQ+N0IQzpUAULVdETRaPaeDx7w= X-Received: by 10.223.156.198 with SMTP id h6mr640590wre.281.1515763989005; Fri, 12 Jan 2018 05:33:09 -0800 (PST) Received: from localhost ([95.144.14.233]) by smtp.gmail.com with ESMTPSA id s20sm2701406wma.45.2018.01.12.05.33.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Jan 2018 05:33:08 -0800 (PST) From: Richard Sandiford To: Jeff Law Mail-Followup-To: Jeff Law , gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Cc: gcc-patches@gcc.gnu.org Subject: Allow variable-sized temporary variables in gimplify.c References: <87r2qyc1ww.fsf@linaro.org> <87y3l31se3.fsf@linaro.org> <87po6f19w2.fsf@linaro.org> Date: Fri, 12 Jan 2018 13:33:07 +0000 In-Reply-To: <87po6f19w2.fsf@linaro.org> (Richard Sandiford's message of "Fri, 12 Jan 2018 13:31:25 +0000") Message-ID: <87lgh319t8.fsf_-_@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 This is needed to build libgfortran for SVE. The OpenMP code needs to create temporary vector variables, and the variables will therefore be variable-sized for SVE. Earlier patches made such variables work. Tested on aarch64-linux-gnu, x86_64-linux-gnu and powerpc64le-linux-gnu. Also tested by comparing the before-and-after assembly output for at least one target per CPU directory. OK to install? Thanks, Richard 2018-01-12 Richard Sandiford gcc/ * gimplify.c (gimple_add_tmp_var_fn): Allow variables to have a poly_uint64 size, rather than requiring an unsigned HOST_WIDE_INT size. (gimple_add_tmp_var): Likewise. Index: gcc/gimplify.c =================================================================== --- gcc/gimplify.c 2018-01-10 08:43:40.053367209 +0000 +++ gcc/gimplify.c 2018-01-12 12:49:36.756892670 +0000 @@ -702,7 +702,7 @@ gimple_add_tmp_var_fn (struct function * /* Later processing assumes that the object size is constant, which might not be true at this point. Force the use of a constant upper bound in this case. */ - if (!tree_fits_uhwi_p (DECL_SIZE_UNIT (tmp))) + if (!tree_fits_poly_uint64_p (DECL_SIZE_UNIT (tmp))) force_constant_size (tmp); DECL_CONTEXT (tmp) = fn->decl; @@ -721,7 +721,7 @@ gimple_add_tmp_var (tree tmp) /* Later processing assumes that the object size is constant, which might not be true at this point. Force the use of a constant upper bound in this case. */ - if (!tree_fits_uhwi_p (DECL_SIZE_UNIT (tmp))) + if (!tree_fits_poly_uint64_p (DECL_SIZE_UNIT (tmp))) force_constant_size (tmp); DECL_CONTEXT (tmp) = current_function_decl;