diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2019-08-16 15:34:47 +0000 |
---|---|---|
committer | Bernd Edlinger <edlinger@gcc.gnu.org> | 2019-08-16 15:34:47 +0000 |
commit | 23e0f4c3394c87e9bcb1dbf8a2866a1d43b1cd70 (patch) | |
tree | e11d868007b4d718baf76e7e4f55e4ec323930c4 /gcc | |
parent | 94538b6545be9613ee25c80325e3cebf518730cf (diff) | |
download | gcc-23e0f4c3394c87e9bcb1dbf8a2866a1d43b1cd70.zip gcc-23e0f4c3394c87e9bcb1dbf8a2866a1d43b1cd70.tar.gz gcc-23e0f4c3394c87e9bcb1dbf8a2866a1d43b1cd70.tar.bz2 |
re PR tree-optimization/91109 ([arm] gcc.c-torture/execute/20040709-1.c fails since r273135)
2019-08-16 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR tree-optimization/91109
* lra-int.h (lra_need_for_scratch_reg_p): Declare.
* lra.c (lra): Use lra_need_for_scratch_reg_p.
* lra-spills.c (lra_need_for_scratch_reg_p): New function.
From-SVN: r274573
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/lra-int.h | 1 | ||||
-rw-r--r-- | gcc/lra-spills.c | 13 | ||||
-rw-r--r-- | gcc/lra.c | 6 |
4 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 36e6290..772c4e9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2019-08-16 Bernd Edlinger <bernd.edlinger@hotmail.de> + + PR tree-optimization/91109 + * lra-int.h (lra_need_for_scratch_reg_p): Declare. + * lra.c (lra): Use lra_need_for_scratch_reg_p. + * lra-spills.c (lra_need_for_scratch_reg_p): New function. + 2019-08-16 Uroš Bizjak <ubizjak@gmail.com> * config/i386/mmx.md (mmxdoublemode): New mode attribute. diff --git a/gcc/lra-int.h b/gcc/lra-int.h index a87a51e..77abb7b 100644 --- a/gcc/lra-int.h +++ b/gcc/lra-int.h @@ -396,6 +396,7 @@ extern bool lra_coalesce (void); /* lra-spills.c: */ +extern bool lra_need_for_scratch_reg_p (void); extern bool lra_need_for_spills_p (void); extern void lra_spill (void); extern void lra_final_code_change (void); diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c index c73d501..a322da8 100644 --- a/gcc/lra-spills.c +++ b/gcc/lra-spills.c @@ -549,6 +549,19 @@ spill_pseudos (void) } } +/* Return true if we need scratch reg assignments. */ +bool +lra_need_for_scratch_reg_p (void) +{ + int i; max_regno = max_reg_num (); + + for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) + if (lra_reg_info[i].nrefs != 0 && lra_get_regno_hard_regno (i) < 0 + && lra_former_scratch_p (i)) + return true; + return false; +} + /* Return true if we need to change some pseudos into memory. */ bool lra_need_for_spills_p (void) @@ -2567,7 +2567,11 @@ lra (FILE *f) lra_create_live_ranges (lra_reg_spill_p, true); live_p = true; if (! lra_need_for_spills_p ()) - break; + { + if (lra_need_for_scratch_reg_p ()) + continue; + break; + } } lra_spill (); /* Assignment of stack slots changes elimination offsets for |