From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id E27853858D28; Mon, 17 Oct 2022 09:20:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E27853858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665998418; bh=kKUtpW23oYxAbivmC2npT3+LlW5MSQ0yGkf7sv03kTk=; h=From:To:Subject:Date:From; b=oZHlZ6UstVRtfUd9obEF9wDszBM/MZ7UZkcHhKSITL2pXAoRKL0Dn1zxGR1sX+4Fo mZxAYRRhXsKMNFrx1flvEmjs7a3QCLNG84KXPzEMfeO0O7R6LU3iMpE7cfeo6SrECv lncl8ILJhHTmH7pJ/AGBNIrikkTcgtOEaizmrmNs= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Florian Weimer To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3326] libgcc: Move cfa_how into potential padding in struct frame_state_reg_info X-Act-Checkin: gcc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: 0f4815502d8dac07579dc7a5a40c597a18291b4c X-Git-Newrev: acdb24166d13d87c374e578d2ad5d58249171930 Message-Id: <20221017092018.E27853858D28@sourceware.org> Date: Mon, 17 Oct 2022 09:20:18 +0000 (GMT) List-Id: https://gcc.gnu.org/g:acdb24166d13d87c374e578d2ad5d58249171930 commit r13-3326-gacdb24166d13d87c374e578d2ad5d58249171930 Author: Florian Weimer Date: Mon Oct 17 11:09:17 2022 +0200 libgcc: Move cfa_how into potential padding in struct frame_state_reg_info 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. Diff: --- 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. */