From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15869 invoked by alias); 9 Mar 2018 12:31:15 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 15835 invoked by uid 89); 9 Mar 2018 12:31:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,KAM_SHORT,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=mason, Mason, H*f:sk:c9d985c, H*f:sk:7ff89ab X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Mar 2018 12:31:14 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AC5D4023BB3; Fri, 9 Mar 2018 12:31:09 +0000 (UTC) Received: from oldenburg.str.redhat.com (dhcp-192-212.str.redhat.com [10.33.192.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id B40DE202322A; Fri, 9 Mar 2018 12:31:08 +0000 (UTC) Subject: Re: Stack allocation on amd64 To: Mason Cc: GCC help References: <7ff89abb-397d-dc6a-4f02-b11d3dca2aa9@redhat.com> <91d8150c-b738-b809-8ae8-89a223ecea0a@free.fr> From: Florian Weimer Message-ID: Date: Fri, 09 Mar 2018 12:31:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <91d8150c-b738-b809-8ae8-89a223ecea0a@free.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00029.txt.bz2 On 03/09/2018 12:57 PM, Mason wrote: > The main question remains: why is gcc allocating e.g. 24 bytes > for an 8-byte array? (N=2) 8 bytes are enough AFAICT. There is some discussion regarding this matter in this bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57908 I find the ABI requirement and the current compiler behavior a bit puzzling, and it seems that we don't reduce alignment for small arrays on the stack with -Os, as suggested in the report. Thanks, Florian