diff options
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index 3ddfd86..73d5764 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see #include "basic-block.h" #include "output.h" #include "reload.h" +#include "target.h" #include "timevar.h" #include "tree-pass.h" #include "df.h" @@ -2898,6 +2899,9 @@ peep2_find_free_register (int from, int to, const char *class_str, /* Don't allocate fixed registers. */ if (fixed_regs[regno]) continue; + /* Don't allocate global registers. */ + if (global_regs[regno]) + continue; /* Make sure the register is of the right class. */ if (! TEST_HARD_REG_BIT (reg_class_contents[cl], regno)) continue; @@ -2907,6 +2911,9 @@ peep2_find_free_register (int from, int to, const char *class_str, /* And that we don't create an extra save/restore. */ if (! call_used_regs[regno] && ! df_regs_ever_live_p (regno)) continue; + if (! targetm.hard_regno_scratch_ok (regno)) + continue; + /* And we don't clobber traceback for noreturn functions. */ if ((regno == FRAME_POINTER_REGNUM || regno == HARD_FRAME_POINTER_REGNUM) && (! reload_completed || frame_pointer_needed)) |