From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14872 invoked by alias); 18 Sep 2019 06:53:20 -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 14864 invoked by uid 89); 18 Sep 2019 06:53:20 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=decl_initial, DECL_INITIAL X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2019 06:53:19 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4E1731000 for ; Tue, 17 Sep 2019 23:53:18 -0700 (PDT) Received: from localhost (unknown [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 24AB03F59C for ; Tue, 17 Sep 2019 23:55:49 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Don't treat variable-length vectors as VLAs during gimplification Date: Wed, 18 Sep 2019 06:53:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg01048.txt.bz2 Source-level SVE vectors should be gimplified in the same way as normal fixed-length vectors rather than as VLAs. This is tested by later SVE patches. Tested on aarch64-linux-gnu with SVE (with and without follow-on patches) and x86_64-linux-gnu. OK to install? Richard 2019-09-18 Richard Sandiford gcc/ * gimplify.c (gimplify_decl_expr): Use poly_int_tree_p instead of checking specifically for INTEGER_CST. Index: gcc/gimplify.c =================================================================== --- gcc/gimplify.c 2019-08-08 18:11:51.411313290 +0100 +++ gcc/gimplify.c 2019-09-18 07:52:22.799034800 +0100 @@ -1754,11 +1754,12 @@ gimplify_decl_expr (tree *stmt_p, gimple tree init = DECL_INITIAL (decl); bool is_vla = false; - if (TREE_CODE (DECL_SIZE_UNIT (decl)) != INTEGER_CST + poly_uint64 size; + if (!poly_int_tree_p (DECL_SIZE_UNIT (decl), &size) || (!TREE_STATIC (decl) && flag_stack_check == GENERIC_STACK_CHECK - && compare_tree_int (DECL_SIZE_UNIT (decl), - STACK_CHECK_MAX_VAR_SIZE) > 0)) + && maybe_gt (size, + (unsigned HOST_WIDE_INT) STACK_CHECK_MAX_VAR_SIZE))) { gimplify_vla_decl (decl, seq_p); is_vla = true;