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: 2756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp278382wrs; Fri, 14 Oct 2022 09:45:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5NuLeSX2uateeYcpVfKLP5PHjapwQQ9HF5lMWdG5EbRH5Ivtf1rJElm3VhLjEkZ0iW1NXZ X-Received: by 2002:a05:6402:90a:b0:458:ca4d:a2f8 with SMTP id g10-20020a056402090a00b00458ca4da2f8mr5002046edz.230.1665765942016; Fri, 14 Oct 2022 09:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665765942; cv=none; d=google.com; s=arc-20160816; b=u9K7rSidj/TcGT5Cv2K34LVyFIzWFrNhNcIiyxOgqvDYqgp1E754b0Zv90sQjD5281 E8y8419BI7bZDSTLHVZEKenXwHx+SBR8UOBZxBXpmPjduQG0LM4qYED3CkKQx/p40DNj 0j+9v1RpxombW0TouK4c2aQU9GIZOFn7gQIjKhPqOKu2pyqP9oaF6APHeRiRom99lxIF 2f6WGfEtOpye+dU6n9uksalnc0WjOVcTJFQlS4uev+tnRdwfAFZ6j59hS2jj1XrgM2bW nWY8i7cVnU5bf1rBNEpo8X/qj/ifHsd+kxd+mjDiZ0kwZSi7c2HHV0lP94Nzg3hF3nEJ JOuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=loKno4crb/vjerg10lHEF/D8b052t56jHUEK0MSMclA=; b=Bzf+PsXNHjMNsQD1tW9U8nZ0molVS6ikDBG/Kv2Z5zm/L8sPJOVc6le9aoa5jq+/ce UMJjzB/M7Cv+J/7BK7T3CNmf19e0mUpmEIP4WDN17jxksOrcpaCHDx/3CCv+5b4QUC8B pVVdQeJjXAYrV1IoaBUdGLk0MqrQmqLkQPf/O9OJrNsZ6XMXPRv8VHudQmb72JmNIxoH 6lCgngE5c20NSgAcRvAbEoRdic8RcCKLwX/Q9Wk9vV1Zi87MRZ0HknEaLkU/b71OYEps FhqJHbCyrIGQ4Hurr5olmPczozLs6wrgvDuPu2nIydzIuoUTMKgUsLi+YmQa9wIn61WV Bv0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Rj+YeWDT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n10-20020a05640204ca00b00458d5d907c6si2393708edw.514.2022.10.14.09.45.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 09:45:42 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=Rj+YeWDT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB37C3857B93 for ; Fri, 14 Oct 2022 16:45:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB37C3857B93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665765940; 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=Rj+YeWDTupnYqbVshNLeJi4WJe+qVtiWY7Zoq6hXMQlHq2pSlCQmope1ymEGyiT4J Atd1CRtvnrhE3L8g29af/G62gLyuMlBxzxyHDm59z8VU/ygpUigvtggkwJyIZFcQLX E7+gHSAk6+wX7DezJSEQ9gNg64C/nnXrESLfJjd4= 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746682188582093749?= X-GMAIL-MSGID: =?utf-8?q?1746682188582093749?= 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. */