This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/80126] New: df_ref_change_reg_with_loc does not update hard_regs_live_count


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80126

            Bug ID: 80126
           Summary: df_ref_change_reg_with_loc does not update
                    hard_regs_live_count
           Product: gcc
           Version: 6.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefan at franke dot ms
  Target Milestone: ---

The method


static void
df_ref_change_reg_with_loc_1 (struct df_reg_info *old_df,
                              struct df_reg_info *new_df,
                              unsigned int new_regno, rtx loc)

does not update the hard_regs_live_count.

Old:

...
          struct df_insn_info *insn_info = DF_REF_INSN_INFO (the_ref);

          DF_REF_REGNO (the_ref) = new_regno;
...

Fixed:

...
          struct df_insn_info *insn_info = DF_REF_INSN_INFO (the_ref);

          if (DF_REF_FLAGS_IS_SET(the_ref, DF_HARD_REG_LIVE))
            {
              --df->hard_regs_live_count[DF_REF_REGNO(the_ref)];
              ++df->hard_regs_live_count[new_regno];
            }

          DF_REF_REGNO (the_ref) = new_regno;
...

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]