riscv: Enable -fasynchronous-unwind-tables by default on Linux
authorAndreas Schwab <schwab@suse.de>
Wed, 25 Jan 2023 11:00:09 +0000 (12:00 +0100)
committerAndreas Schwab <schwab@suse.de>
Mon, 30 Jan 2023 09:46:15 +0000 (10:46 +0100)
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
gcc/config.gcc

index 2e3116e..616e2f8 100644 (file)
@@ -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 }
   };
 
index 89f5604..744b46f 100644 (file)
@@ -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