]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[target/117316] Fix initializer for riscv code alignment handling
authorJeff Law <jlaw@ventanamicro.com>
Mon, 28 Oct 2024 11:39:24 +0000 (05:39 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Mon, 28 Oct 2024 11:39:24 +0000 (05:39 -0600)
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.

gcc/config/riscv/riscv.cc

index 7d6fc1429b55748c620ec0392f7b8ec9a2ea6580..be7c29f274d63d11274daf972a4729a21ea01368 100644 (file)
@@ -295,9 +295,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;
 };
 
 
@@ -457,6 +457,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.  */
@@ -476,6 +479,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.  */
@@ -495,6 +501,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.  */
@@ -514,6 +523,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.  */
@@ -533,6 +545,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.  */
@@ -552,6 +567,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.  */
@@ -571,6 +589,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.  */
@@ -590,6 +611,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 ();