public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] riscv: Enable -fasynchronous_unwind_tables by default on Linux
@ 2023-01-26 16:39 Andreas Schwab
  2023-01-26 18:53 ` Kito Cheng
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2023-01-26 16:39 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, palmer, andrew, jim.wilson.gcc

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
-- 
2.39.1


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] riscv: Enable -fasynchronous_unwind_tables by default on Linux
  2023-01-26 16:39 [PATCH] riscv: Enable -fasynchronous_unwind_tables by default on Linux Andreas Schwab
@ 2023-01-26 18:53 ` Kito Cheng
  0 siblings, 0 replies; 2+ messages in thread
From: Kito Cheng @ 2023-01-26 18:53 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: gcc-patches, palmer, andrew, jim.wilson.gcc

[-- Attachment #1: Type: text/plain, Size: 1947 bytes --]

OK, thanks for this :)

On Fri, Jan 27, 2023 at 12:40 AM Andreas Schwab via Gcc-patches <
gcc-patches@gcc.gnu.org> wrote:

> 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
> --
> 2.39.1
>
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-26 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26 16:39 [PATCH] riscv: Enable -fasynchronous_unwind_tables by default on Linux Andreas Schwab
2023-01-26 18:53 ` Kito Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).