https://gcc.gnu.org/g:b07b227ad0ceade439f702356abe0a59a89b48d5
commit b07b227ad0ceade439f702356abe0a59a89b48d5 Author: Jeff Law <j...@ventanamicro.com> Date: Mon Oct 28 05:39:24 2024 -0600 [target/117316] Fix initializer for riscv code alignment handling The construct used for initializing the code alignments in a recent change is causing bootstrap problems on riscv64 as seen in the referenced bugzilla. This patch adjusts the initializer by pushing the NULL down into each uarch clause. Bootstrapped on riscv64, regression test in flight, but given bootstrap is broken it seemed advisable to move this forward now. I'm so much looking forward to the day when we have performant hardware for bootstrap testing... Sigh. Anyway, bootstrapped and installing on the trunk. PR target/117316 gcc/ * config/riscv/riscv.cc (riscv_tune_param): Drop initializer. (*_tune_info): Add initializers for code alignments. (cherry picked from commit f475a31ab4c7f27f6f8c7a418412f9fddc371638) Diff: --- gcc/config/riscv/riscv.cc | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 56bd03f8ce7d..f0d274653146 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -294,9 +294,9 @@ struct riscv_tune_param bool overlap_op_by_pieces; unsigned int fusible_ops; const struct cpu_vector_cost *vec_costs; - const char *function_align = nullptr; - const char *jump_align = nullptr; - const char *loop_align = nullptr; + const char *function_align; + const char *jump_align; + const char *loop_align; }; @@ -456,6 +456,9 @@ static const struct riscv_tune_param rocket_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for Sifive 7 Series. */ @@ -475,6 +478,9 @@ static const struct riscv_tune_param sifive_7_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for Sifive p400 Series. */ @@ -494,6 +500,9 @@ static const struct riscv_tune_param sifive_p400_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_LUI_ADDI | RISCV_FUSE_AUIPC_ADDI, /* fusible_ops */ &generic_vector_cost, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for Sifive p600 Series. */ @@ -513,6 +522,9 @@ static const struct riscv_tune_param sifive_p600_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_LUI_ADDI | RISCV_FUSE_AUIPC_ADDI, /* fusible_ops */ &generic_vector_cost, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for T-HEAD c906. */ @@ -532,6 +544,9 @@ static const struct riscv_tune_param thead_c906_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for xiangshan nanhu. */ @@ -551,6 +566,9 @@ static const struct riscv_tune_param xiangshan_nanhu_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_ZEXTW | RISCV_FUSE_ZEXTH, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for a generic ooo profile. */ @@ -570,6 +588,9 @@ static const struct riscv_tune_param generic_ooo_tune_info = { true, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ &generic_vector_cost, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; /* Costs to use when optimizing for size. */ @@ -589,6 +610,9 @@ static const struct riscv_tune_param optimize_size_tune_info = { false, /* overlap_op_by_pieces */ RISCV_FUSE_NOTHING, /* fusible_ops */ NULL, /* vector cost */ + NULL, /* function_align */ + NULL, /* jump_align */ + NULL, /* loop_align */ }; static bool riscv_avoid_shrink_wrapping_separate ();