From patchwork Fri Oct 14 16:44:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1690092 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=y79/CS59; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Mpsgv2d9xz1yqk for ; Sat, 15 Oct 2022 03:45:15 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4FEA43857C4D for ; Fri, 14 Oct 2022 16:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FEA43857C4D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665765913; bh=loKno4crb/vjerg10lHEF/D8b052t56jHUEK0MSMclA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=y79/CS59fDP6x5dPuBq9XMOq9LgB2VWHe/KR7akdv1/JxJsOPdaUPgNEpXmcZMrKH Qr/ibsIZNg6ZW8j+qMc8u5nAq6UDLhrJ3HmVeSsVJGRPfTPlWQkXnkTgESGV+OrFQS 5gTAyKsEpykPlHHcmQiPZP4R5z65ZM+lJOWc6g8c= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 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) 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 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Gcc-patches From: Florian Weimer Reply-To: Florian Weimer Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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(-) base-commit: 3dfeda095bd43c011fdc3834b9cec39bb9a73a1f 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. */