The various struct df_problem instances are constant data; mark them
as such.

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu

OK for trunk?

gcc/ChangeLog:
        * df-core.c (df_add_problem): Make the problem param be const.
        (df_remove_problem): Make local "problem" be const.
        * df-problems.c (problem_RD): Make const.
        (problem_LR): Likewise.
        (problem_LIVE): Likewise.
        (problem_MIR): Likewise.
        (problem_CHAIN): Likewise.
        (problem_WORD_LR): Likewise.
        (problem_NOTE): Likewise.
        (problem_MD): Likewise.
        * df-scan.c (problem_SCAN): Likewise.
        * df.h (struct df_problem): Make field "dependent_problem" be
        const.
        (struct dataflow): Likewise for field "problem".
        (df_add_problem): Make param const.
---
 gcc/df-core.c     |  4 ++--
 gcc/df-problems.c | 16 ++++++++--------
 gcc/df-scan.c     |  2 +-
 gcc/df.h          |  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/gcc/df-core.c b/gcc/df-core.c
index 5464bc3..c1e9714 100644
--- a/gcc/df-core.c
+++ b/gcc/df-core.c
@@ -411,7 +411,7 @@ struct df_d *df;
 /* Add PROBLEM (and any dependent problems) to the DF instance.  */
 
 void
-df_add_problem (struct df_problem *problem)
+df_add_problem (const struct df_problem *problem)
 {
   struct dataflow *dflow;
   int i;
@@ -584,7 +584,7 @@ df_set_blocks (bitmap blocks)
 void
 df_remove_problem (struct dataflow *dflow)
 {
-  struct df_problem *problem;
+  const struct df_problem *problem;
   int i;
 
   if (!dflow)
diff --git a/gcc/df-problems.c b/gcc/df-problems.c
index f7bf3c8..132c127 100644
--- a/gcc/df-problems.c
+++ b/gcc/df-problems.c
@@ -668,7 +668,7 @@ df_rd_bottom_dump (basic_block bb, FILE *file)
 
 /* All of the information associated with every instance of the problem.  */
 
-static struct df_problem problem_RD =
+static const struct df_problem problem_RD =
 {
   DF_RD,                      /* Problem id.  */
   DF_FORWARD,                 /* Direction.  */
@@ -1190,7 +1190,7 @@ df_lr_verify_solution_end (void)
 
 /* All of the information associated with every instance of the problem.  */
 
-static struct df_problem problem_LR =
+static const struct df_problem problem_LR =
 {
   DF_LR,                      /* Problem id.  */
   DF_BACKWARD,                /* Direction.  */
@@ -1718,7 +1718,7 @@ df_live_verify_solution_end (void)
 
 /* All of the information associated with every instance of the problem.  */
 
-static struct df_problem problem_LIVE =
+static const struct df_problem problem_LIVE =
 {
   DF_LIVE,                      /* Problem id.  */
   DF_FORWARD,                   /* Direction.  */
@@ -2169,7 +2169,7 @@ df_mir_verify_solution_end (void)
 
 /* All of the information associated with every instance of the problem.  */
 
-static struct df_problem problem_MIR =
+static const struct df_problem problem_MIR =
 {
   DF_MIR,                       /* Problem id.  */
   DF_FORWARD,                   /* Direction.  */
@@ -2641,7 +2641,7 @@ df_chain_insn_bottom_dump (const rtx_insn *insn, FILE 
*file)
     }
 }
 
-static struct df_problem problem_CHAIN =
+static const struct df_problem problem_CHAIN =
 {
   DF_CHAIN,                   /* Problem id.  */
   DF_NONE,                    /* Direction.  */
@@ -3008,7 +3008,7 @@ df_word_lr_bottom_dump (basic_block bb, FILE *file)
 
 /* All of the information associated with every instance of the problem.  */
 
-static struct df_problem problem_WORD_LR =
+static const struct df_problem problem_WORD_LR =
 {
   DF_WORD_LR,                      /* Problem id.  */
   DF_BACKWARD,                     /* Direction.  */
@@ -3683,7 +3683,7 @@ df_note_free (void)
 
 /* All of the information associated every instance of the problem.  */
 
-static struct df_problem problem_NOTE =
+static const struct df_problem problem_NOTE =
 {
   DF_NOTE,                    /* Problem id.  */
   DF_NONE,                    /* Direction.  */
@@ -4693,7 +4693,7 @@ df_md_bottom_dump (basic_block bb, FILE *file)
   df_print_regset (file, &bb_info->out);
 }
 
-static struct df_problem problem_MD =
+static const struct df_problem problem_MD =
 {
   DF_MD,                      /* Problem id.  */
   DF_FORWARD,                 /* Direction.  */
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 98de844..e6d01d6 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -396,7 +396,7 @@ df_scan_start_block (basic_block bb, FILE *file)
 #endif
 }
 
-static struct df_problem problem_SCAN =
+static const struct df_problem problem_SCAN =
 {
   DF_SCAN,                    /* Problem id.  */
   DF_NONE,                    /* Direction.  */
diff --git a/gcc/df.h b/gcc/df.h
index 7741ea5..40c3794 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -275,7 +275,7 @@ struct df_problem {
   df_dump_insn_problem_function dump_insn_bottom_fun;
   df_verify_solution_start verify_start_fun;
   df_verify_solution_end verify_end_fun;
-  struct df_problem *dependent_problem;
+  const struct df_problem *dependent_problem;
   unsigned int block_info_elt_size;
 
   /* The timevar id associated with this pass.  */
@@ -290,7 +290,7 @@ struct df_problem {
 /* The specific instance of the problem to solve.  */
 struct dataflow
 {
-  struct df_problem *problem;           /* The problem to be solved.  */
+  const struct df_problem *problem;     /* The problem to be solved.  */
 
   /* Array indexed by bb->index, that contains basic block problem and
      solution specific information.  */
@@ -948,7 +948,7 @@ extern struct df_d *df;
 
 /* Functions defined in df-core.c.  */
 
-extern void df_add_problem (struct df_problem *);
+extern void df_add_problem (const struct df_problem *);
 extern int df_set_flags (int);
 extern int df_clear_flags (int);
 extern void df_set_blocks (bitmap);
-- 
1.8.5.3

Reply via email to