diff options
author | Tom de Vries <tom@codesourcery.com> | 2014-05-28 09:43:52 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2014-05-28 09:43:52 +0000 |
commit | b8c6a45ab7a0a6c8c7a6315f255312b32b5a8403 (patch) | |
tree | 693caa7eb8b98cbb78ccdeb56f79134e22d8d581 /gcc/lra-assigns.c | |
parent | dbe7d9e3ffd9c5cdb879dd705ed86da5972773ac (diff) | |
download | gcc-b8c6a45ab7a0a6c8c7a6315f255312b32b5a8403.zip gcc-b8c6a45ab7a0a6c8c7a6315f255312b32b5a8403.tar.gz gcc-b8c6a45ab7a0a6c8c7a6315f255312b32b5a8403.tar.bz2 |
-fuse-caller-save - Support in lra
2014-05-28 Tom de Vries <tom@codesourcery.com>
* lra-int.h (struct lra_reg): Add field actual_call_used_reg_set.
* lra.c (initialize_lra_reg_info_element): Add init of
actual_call_used_reg_set field.
(lra): Call lra_create_live_ranges before lra_inheritance for
-fuse-caller-save.
* lra-assigns.c (lra_assign): Allow call_used_regs to cross calls for
-fuse-caller-save.
* lra-constraints.c (need_for_call_save_p): Use actual_call_used_reg_set
instead of call_used_reg_set for -fuse-caller-save.
* lra-lives.c (process_bb_lives): Calculate actual_call_used_reg_set.
From-SVN: r211010
Diffstat (limited to 'gcc/lra-assigns.c')
-rw-r--r-- | gcc/lra-assigns.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/lra-assigns.c b/gcc/lra-assigns.c index f7bb86b..34b4a11 100644 --- a/gcc/lra-assigns.c +++ b/gcc/lra-assigns.c @@ -1447,6 +1447,7 @@ lra_assign (void) bitmap_head insns_to_process; bool no_spills_p; int max_regno = max_reg_num (); + unsigned int call_used_reg_crosses_call = 0; timevar_push (TV_LRA_ASSIGN); init_lives (); @@ -1459,14 +1460,22 @@ lra_assign (void) bitmap_initialize (&all_spilled_pseudos, ®_obstack); create_live_range_start_chains (); setup_live_pseudos_and_spill_after_risky_transforms (&all_spilled_pseudos); -#ifdef ENABLE_CHECKING for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) if (lra_reg_info[i].nrefs != 0 && reg_renumber[i] >= 0 && lra_reg_info[i].call_p && overlaps_hard_reg_set_p (call_used_reg_set, PSEUDO_REGNO_MODE (i), reg_renumber[i])) - gcc_unreachable (); -#endif + { + if (!flag_use_caller_save) + gcc_unreachable (); + call_used_reg_crosses_call++; + } + if (lra_dump_file + && call_used_reg_crosses_call > 0) + fprintf (lra_dump_file, + "Found %u pseudo(s) with a call used reg crossing a call.\n" + "Allowing due to -fuse-caller-save\n", + call_used_reg_crosses_call); /* Setup insns to process on the next constraint pass. */ bitmap_initialize (&changed_pseudo_bitmap, ®_obstack); init_live_reload_and_inheritance_pseudos (); |