From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A3F5B3858C50 for ; Fri, 14 Oct 2022 16:44:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3F5B3858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665765891; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=loKno4crb/vjerg10lHEF/D8b052t56jHUEK0MSMclA=; b=X+pO6PVsgRHgISPZr0dQN34bpYbsuNr9XMVcF0A4cJs9nOi7XUsZLzcPTrhCymU0fAEMj/ WnLRs8LRq6dajHWCJKatIJSno5Ci27UIPOMq6L/NLzEq2C2SLJO+lDejhKmDAnDIfJeNb3 M1FaNbQa9IQatYNNsLQGcqWoBcINUyc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-8sYX6H35NuiBgXLbALQ1aw-1; Fri, 14 Oct 2022 12:44:49 -0400 X-MC-Unique: 8sYX6H35NuiBgXLbALQ1aw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 843FD185A794 for ; Fri, 14 Oct 2022 16:44:49 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB07C40315A for ; Fri, 14 Oct 2022 16:44:48 +0000 (UTC) From: Florian Weimer To: gcc-patches@gcc.gnu.org Subject: [PATCH] libgcc: Move cfa_how into potential padding in struct frame_state_reg_info Date: Fri, 14 Oct 2022 18:44:47 +0200 Message-ID: <874jw6mk1s.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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: 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. --- 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