From patchwork Thu Jan 26 16:39:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 1732380 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=rtofjdCT; 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 4P2mf662Pxz23gY for ; Fri, 27 Jan 2023 03:40:13 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 655893858C50 for ; Thu, 26 Jan 2023 16:40:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 655893858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674751211; bh=gGuOxK9d83Vyz+WnnzogHL3nmPBgMc0xiExh36Aw6QQ=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=rtofjdCTkupUtNCE0PMAAghnBGGVvB7gGrCirLubbQhjU3d869bA6pwRjUIgmk1eW 9i8qgJ0/cg+AAvdNE7CkTz5xTRxqgNAtVPnE0QaHYNfyJ4CbI4PhiyqGFVuQ1I2HHC df9Ewk3EIgyOfdoSSWY4pAk4klYFXMhq1DJ2S+x8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 5F1E53858D28 for ; Thu, 26 Jan 2023 16:39:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5F1E53858D28 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3F7451FE87; Thu, 26 Jan 2023 16:39:51 +0000 (UTC) Received: from hawking.suse.de (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id 1CD752C141; Thu, 26 Jan 2023 16:39:51 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id 742C844384A; Thu, 26 Jan 2023 17:39:49 +0100 (CET) To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com, andrew@sifive.com, jim.wilson.gcc@gmail.com Subject: [PATCH] riscv: Enable -fasynchronous_unwind_tables by default on Linux X-Yow: Where's SANDY DUNCAN? Date: Thu, 26 Jan 2023 17:39:48 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, 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: Andreas Schwab via Gcc-patches From: Andreas Schwab Reply-To: Andreas Schwab Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This follows the example of aarch64. gcc/: * common/config/riscv/riscv-common.cc (riscv_option_optimization_table) [TARGET_DEFAULT_ASYNC_UNWIND_TABLES]: Enable -fasynchronous_unwind_tables and -funwind-tables. * config.gcc (riscv*-*-linux*): Define TARGET_DEFAULT_ASYNC_UNWIND_TABLES. --- gcc/common/config/riscv/riscv-common.cc | 4 ++++ gcc/config.gcc | 1 + 2 files changed, 5 insertions(+) diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 2e3116e7673..616e2f897b9 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -1756,6 +1756,10 @@ static const struct default_options riscv_option_optimization_table[] = { { OPT_LEVELS_1_PLUS, OPT_fsection_anchors, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 }, +#if TARGET_DEFAULT_ASYNC_UNWIND_TABLES == 1 + { OPT_LEVELS_ALL, OPT_fasynchronous_unwind_tables, NULL, 1 }, + { OPT_LEVELS_ALL, OPT_funwind_tables, NULL, 1}, +#endif { OPT_LEVELS_NONE, 0, NULL, 0 } }; diff --git a/gcc/config.gcc b/gcc/config.gcc index 89f56047cfe..744b46fb3b0 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2417,6 +2417,7 @@ riscv*-*-linux*) *) echo "Unknown value for enable_multilib"; exit 1 esac tmake_file="${tmake_file} riscv/t-riscv riscv/t-linux" + tm_defines="${tm_defines} TARGET_DEFAULT_ASYNC_UNWIND_TABLES=1" gnu_ld=yes gas=yes case $target in