From patchwork Tue Nov 8 18:05:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1345 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2864869wru; Tue, 8 Nov 2022 10:06:46 -0800 (PST) X-Google-Smtp-Source: AMsMyM48KV0Fq/gw5F8YFstVkMhGW8tWjNWIoldnrAfrgEOfINRTvcKzEN+yXO5PFw/F9K2B8DmL X-Received: by 2002:a17:907:62a1:b0:781:b320:90c0 with SMTP id nd33-20020a17090762a100b00781b32090c0mr51492723ejc.255.1667930806563; Tue, 08 Nov 2022 10:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667930806; cv=none; d=google.com; s=arc-20160816; b=IBAKk+xyt6k+eHpSQc470D6R++/uusIun0Hor/c9VW0iXjBLXdvVN2+c370OMfKuDq AOIP6/WSsQ03+cleExJ/2CPCjKBazW3lpU3/9cyJ07r5Vn1iIuc7K7TGRSz7R8NycEXm jfWx6ZPSsP+mFisyWHH3B/YwBhb14XOn6aL+/WiDOJCUgnmVvnzw9IHrEm0w0Gp0Dr/G sGiV9hx+2MVGtYRlDwPeEwFTfk3CF2qi07w8gvJo/9EWl1rvHPImCA6uL684LN2clRJX vXUW4jb7Oj67QBOiTZf/N7wQ8NoQ1DmNhvT1GKVQkchMNfG1Wg5ogW06f3w/DDJucdUb 6flQ== 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:date:message-id:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=/kNXIkofpg/6NKA/QSAa7U0hvvYx/WXaLMd2CqLj8vY=; b=Y5enFYo4jdAQ9y2lp1bShM0JOaK6drKKXcLYm7b4pAoA/wUZ7FUUMtjoO4diAj56GY XdsVVT437xiZ86i1kCn0AIbQ+Yxa7rb2cQhQNWDfjd9aZUQHmMrlTS0ixXkfj3cogKlo MVaIR8wAPPpfDtt+eD1h9hysf4XuxXD27tRoQixXzRgsrzR5F+O2ZDfwwnNbN5OfPZ06 9p7IxYHlHbPy6357oKpEgWjQ1Cb+TPNxeWRNyzIyAuDkyx8zkmSkkvZRhtriomAoQ5HC GNfsxybxSxM5h2/oud4B7RtrwDcCoURHwScGr8yflZjp52CCskugg+I+wc4N/W1LMLKx 75yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=TteZ1e5m; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id a3-20020a1709063a4300b0078dfd359c52si8911532ejf.602.2022.11.08.10.06.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:06:46 -0800 (PST) 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=TteZ1e5m; 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 896003857C5B for ; Tue, 8 Nov 2022 18:06:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 896003857C5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667930787; bh=/kNXIkofpg/6NKA/QSAa7U0hvvYx/WXaLMd2CqLj8vY=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=TteZ1e5mb3v3V/Y1YVsEmVScXX3YBAyzYvqWW1HXy52tUTiLsQ2Cn4mLAvkIxwstw opdPjLfok0f0XiyJtsLlfRNucBRsDYmCakEJlNQg0Ww585LXtjYLMuRcZayAiOcDby bY119FOHA6aLDW8B+nzX8/JFaR3DRj5D2s0cUMYs= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id CC8443858C55 for ; Tue, 8 Nov 2022 18:05:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC8443858C55 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-107-RIcx3AO7N8ybWQHOMErPMg-1; Tue, 08 Nov 2022 13:05:40 -0500 X-MC-Unique: RIcx3AO7N8ybWQHOMErPMg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 12AB7855440 for ; Tue, 8 Nov 2022 18:05:02 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B38A0C16932 for ; Tue, 8 Nov 2022 18:05:01 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH 0/3] Further libgcc unwinder improvements X-From-Line: e5de1b7feecc0ce5bec77e6a21032ab1f6c0a315 Mon Sep 17 00:00:00 2001 Message-Id: Date: Tue, 08 Nov 2022 19:05:00 +0100 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.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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?1748952213266585339?= X-GMAIL-MSGID: =?utf-8?q?1748952213266585339?= This series makes some further unwinder improvements. Unfortunately, not many targets define __LIBGCC_DWARF_REG_SIZES_CONSTANT__; x86-64 does, and it makes uw_install_context_1 quite a bit faster because GCC no longer has to emit generic memcpy code for it. In general, it may be worthwhile to replace this code with target-specific implementations. Tested on powerpc64le-linux-gnu, x86_64-linux-gnu; I didn't see any test result differences. Built GCC for msp430-elf, too. The revision for the patch I posted earlier (using SWAR techniques for get_cie_encoding) is not ready yet and probably won't make GCC 13. It requires some header cleanups first. Thanks, Florian Florian Weimer (3): Compute a table of DWARF register sizes at compile Define __LIBGCC_DWARF_REG_SIZES_CONSTANT__ if DWARF register size is constant libgcc: Specialize execute_cfa_program in DWARF unwinder for alignments gcc/c-family/c-cppbuiltin.cc | 8 + gcc/config/msp430/msp430.cc | 11 +- gcc/config/rs6000/rs6000.cc | 14 +- gcc/debug.h | 2 + gcc/doc/tm.texi | 7 +- gcc/dwarf2cfi.cc | 116 +++++----- gcc/target.def | 8 +- libgcc/unwind-dw2-execute_cfa.h | 322 ++++++++++++++++++++++++++++ libgcc/unwind-dw2.c | 360 ++++++-------------------------- 9 files changed, 472 insertions(+), 376 deletions(-) create mode 100644 libgcc/unwind-dw2-execute_cfa.h base-commit: 5d060d8b0477ff4911f41c816281daaa24b41a13