diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 75cc642b5a0..39330ba0515 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2020-05-09 Hans-Peter Nilsson + + * resource.c (init_resource_info): Filter-out TARGET_FLAGS_REGNUM + from end_of_function_needs. + 2020-05-08 Vladimir Makarov * ira-color.c (update_costs_from_allocno): Remove diff --git a/gcc/resource.c b/gcc/resource.c index 32faa73fd5f..0a9d5943abc 100644 --- a/gcc/resource.c +++ b/gcc/resource.c @@ -21,6 +21,7 @@ along with GCC; see the file COPYING3. If not see #include "system.h" #include "coretypes.h" #include "backend.h" +#include "target.h" #include "rtl.h" #include "df.h" #include "memmodel.h" @@ -1215,6 +1216,11 @@ init_resource_info (rtx_insn *epilogue_insn) break; } + /* Filter-out the flags register from those additionally required + registers. */ + if (targetm.flags_regnum != INVALID_REGNUM) + CLEAR_HARD_REG_BIT (end_of_function_needs.regs, targetm.flags_regnum); + /* Allocate and initialize the tables used by mark_target_live_regs. */ target_hash_table = XCNEWVEC (struct target_info *, TARGET_HASH_PRIME); bb_ticks = XCNEWVEC (int, last_basic_block_for_fn (cfun));