From 9502c55830f2de2066d1671567d88a2a78361103 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Wed, 14 Mar 2001 02:29:02 +0000 Subject: [PATCH] Fix reg-alloc error reported by Andreas Schwab to Trillian list. * config/ia64/ia64.c (find_gr_spill): Subtract frame_pointer_needed from 80 in try_locals code. (ia64_expand_prologue): Add comment pointing to find_gr_spill change. From-SVN: r40447 --- gcc/ChangeLog | 6 ++++++ gcc/config/ia64/ia64.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 88a11cdb556..0fcf77fcd63 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2001-03-13 Jim Wilson + + * config/ia64/ia64.c (find_gr_spill): Subtract frame_pointer_needed + from 80 in try_locals code. + (ia64_expand_prologue): Add comment pointing to find_gr_spill change. + 2001-03-13 Zack Weinberg * aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF, gcc_AC_C_CHAR_BIT, diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 2b72959bdbb..fb8a5847ec2 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -1214,7 +1214,10 @@ find_gr_spill (try_locals) if (try_locals) { regno = current_frame_info.n_local_regs; - if (regno < 80) + /* If there is a frame pointer, then we can't use loc79, because + that is HARD_FRAME_POINTER_REGNUM. In particular, see the + reg_name switching code in ia64_expand_prologue. */ + if (regno < (80 - frame_pointer_needed)) { current_frame_info.n_local_regs = regno + 1; return LOC_REG (0) + regno; @@ -1874,6 +1877,10 @@ ia64_expand_prologue () /* Set the frame pointer register name. The regnum is logically loc79, but of course we'll not have allocated that many locals. Rather than worrying about renumbering the existing rtxs, we adjust the name. */ + /* ??? This code means that we can never use one local register when + there is a frame pointer. loc79 gets wasted in this case, as it is + renamed to a register that will never be used. See also the try_locals + code in find_gr_spill. */ if (current_frame_info.reg_fp) { const char *tmp = reg_names[HARD_FRAME_POINTER_REGNUM]; -- 2.30.2