diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-28 09:43:52 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-28 09:43:52 +0000 |
commit | e5d9420b3864e1bee10962f9962086f6b4424bd9 (patch) | |
tree | 693caa7eb8b98cbb78ccdeb56f79134e22d8d581 /gcc/lra-assigns.c | |
parent | c72a450a93b2267ed467dccba674ffbf5cf422aa (diff) | |
download | gcc-e5d9420b3864e1bee10962f9962086f6b4424bd9.tar.gz |
-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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211010 138bc75d-0d04-0410-961f-82ee72b054a4
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 f7bb86b2160..34b4a119667 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 (); |