From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 8C37D3858C52 for ; Fri, 14 Oct 2022 18:00:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C37D3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com 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 5E7FE1042; Fri, 14 Oct 2022 11:00:12 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.62]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE68C3F792; Fri, 14 Oct 2022 11:00:05 -0700 (PDT) From: Richard Sandiford To: Florian Weimer via Gcc-patches Mail-Followup-To: Florian Weimer via Gcc-patches ,Florian Weimer , richard.sandiford@arm.com Cc: Florian Weimer Subject: Re: [PATCH] libgcc: Move cfa_how into potential padding in struct frame_state_reg_info References: <874jw6mk1s.fsf@oldenburg.str.redhat.com> Date: Fri, 14 Oct 2022 19:00:04 +0100 In-Reply-To: <874jw6mk1s.fsf@oldenburg.str.redhat.com> (Florian Weimer via Gcc-patches's message of "Fri, 14 Oct 2022 18:44:47 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-44.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_NONE,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Florian Weimer via Gcc-patches writes: > On many architectures, there is a padding gap after the how array > member, and cfa_how can be moved there. This reduces the size of the > struct and the amount of memory that uw_frame_state_for has to clear. > > There is no measurable performance benefit from this on x86-64 (even > though the memset goes from 120 to 112 bytes), but it seems to be a > good idea to do anyway. > > libgcc/ > > * unwind-dw2.h (struct frame_state_reg_info): Move cfa_how member > and reduce its size. OK, thanks. Richard > > --- > libgcc/unwind-dw2.h | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/libgcc/unwind-dw2.h b/libgcc/unwind-dw2.h > index af34e000f07..a0834b18277 100644 > --- a/libgcc/unwind-dw2.h > +++ b/libgcc/unwind-dw2.h > @@ -50,6 +50,12 @@ typedef struct > } reg[__LIBGCC_DWARF_FRAME_REGISTERS__+1]; > unsigned char how[__LIBGCC_DWARF_FRAME_REGISTERS__+1]; > > + enum { > + CFA_UNSET, > + CFA_REG_OFFSET, > + CFA_EXP > + } cfa_how : 8; > + > /* Used to implement DW_CFA_remember_state. */ > struct frame_state_reg_info *prev; > > @@ -58,11 +64,6 @@ typedef struct > _Unwind_Sword cfa_offset; > _Unwind_Word cfa_reg; > const unsigned char *cfa_exp; > - enum { > - CFA_UNSET, > - CFA_REG_OFFSET, > - CFA_EXP > - } cfa_how; > } regs; > > /* The PC described by the current frame state. */ > > base-commit: 3dfeda095bd43c011fdc3834b9cec39bb9a73a1f