From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 4E8DA386F830; Fri, 12 Jun 2020 18:47:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4E8DA386F830 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591987672; bh=WZXBQLNOML+4oOpMf847jM+lrmCQN/ZYDWIoNa3OWhw=; h=From:To:Subject:Date:From; b=FAJ91s7YF32W1cFHn7S0uFfH7wChi760wT5RE1FBDtX2vvTXKVJebVOmox2iRiL5I 60dMdnFxctKitxP15ZHsw9gBFvpQMz9G9d/sCG11IImicQNwiYNTrAXMXoAUCJiiwq MmylnEqadInG/1+vgaNs22YXjWNHB1AhGOyV6nwI= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/c++-coroutines] [Ada] Bump secondary stack alignment factor in full runtimes X-Act-Checkin: gcc X-Git-Author: Olivier Hainque X-Git-Refname: refs/heads/devel/c++-coroutines X-Git-Oldrev: cb539f3b30f59c7a53bac36aa94962e9cb99fb0e X-Git-Newrev: 4739f95b008ff61288e46a5f615e97fbdb06af01 Message-Id: <20200612184752.4E8DA386F830@sourceware.org> Date: Fri, 12 Jun 2020 18:47:52 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2020 18:47:52 -0000 https://gcc.gnu.org/g:4739f95b008ff61288e46a5f615e97fbdb06af01 commit 4739f95b008ff61288e46a5f615e97fbdb06af01 Author: Olivier Hainque Date: Tue Mar 24 08:49:29 2020 +0000 [Ada] Bump secondary stack alignment factor in full runtimes 2020-06-12 Olivier Hainque gcc/ada/ * libgnat/s-secsta.ads (Memory_Alignment): New constant, memory alignment for chunks and allocated blocks. Initialize to Standard'Maximum_Alignment * 2. (Chunk_Memory): Use it. * libgnat/s-secsta.adb (Round_Up): Likewise. Diff: --- gcc/ada/libgnat/s-secsta.adb | 2 +- gcc/ada/libgnat/s-secsta.ads | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/gcc/ada/libgnat/s-secsta.adb b/gcc/ada/libgnat/s-secsta.adb index 0010449ea94..7ec846281f9 100644 --- a/gcc/ada/libgnat/s-secsta.adb +++ b/gcc/ada/libgnat/s-secsta.adb @@ -564,7 +564,7 @@ package body System.Secondary_Stack is -------------- function Round_Up (Size : Storage_Count) return Memory_Size is - Algn_MS : constant Memory_Size := Standard'Maximum_Alignment; + Algn_MS : constant Memory_Size := Memory_Alignment; Size_MS : constant Memory_Size := Memory_Size (Size); begin diff --git a/gcc/ada/libgnat/s-secsta.ads b/gcc/ada/libgnat/s-secsta.ads index 764ae2f153b..d06e97f96d8 100644 --- a/gcc/ada/libgnat/s-secsta.ads +++ b/gcc/ada/libgnat/s-secsta.ads @@ -261,10 +261,23 @@ private subtype Memory_Index is Memory_Size; -- Index into the memory storage of a single chunk + Memory_Alignment : constant := Standard'Maximum_Alignment * 2; + -- The memory alignment we will want to honor on every allocation. + -- + -- At this stage, gigi assumes we can accomodate any alignment requirement + -- there might be on the data type for which the memory gets allocated (see + -- build_call_alloc_dealloc). + -- + -- The multiplication factor is intended to account for requirements + -- by user code compiled with specific arch/cpu options such as -mavx + -- on X86[_64] targets, which Standard'Maximum_Alignment doesn't convey + -- without such compilation options. * 4 would actually be needed to + -- support -mavx512f on X86, but this would incur more annoying memory + -- consumption overheads. + type Chunk_Memory is array (Memory_Size range <>) of SSE.Storage_Element; - for Chunk_Memory'Alignment use Standard'Maximum_Alignment; - -- The memory storage of a single chunk. It utilizes maximum alignment in - -- order to guarantee efficient operations. + for Chunk_Memory'Alignment use Memory_Alignment; + -- The memory storage of a single chunk -------------- -- SS_Chunk --