This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
expand_inline_function: avoid putting virtual-stack-vars in reg_map
- To: gcc-patches at gcc dot gnu dot org
- Subject: expand_inline_function: avoid putting virtual-stack-vars in reg_map
- From: Joern Rennecke <amylaar at cambridge dot redhat dot com>
- Date: Fri, 22 Dec 2000 10:17:31 +0000 (GMT)
- Cc: amylaar at cambridge dot redhat dot com
When integrate creates a reg map entry for the structure value address,
it might put virtual-stack-vars in there. This causes trouble on
targets that can't allow virtual registers in move insns.
Fri Dec 22 10:11:56 2000 J"orn Rennecke <amylaar@redhat.com>
* integrate.c (expand_inline_function): Don't put a virtual
register into the reg map.
Index: integrate.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/integrate.c,v
retrieving revision 1.166
diff -p -r1.166 integrate.c
*** integrate.c 2000/11/13 22:30:34 1.166
--- integrate.c 2000/12/22 10:12:05
*************** expand_inline_function (fndecl, parms, t
*** 994,999 ****
--- 994,1008 ----
{
temp = force_operand (structure_value_addr, NULL_RTX);
temp = force_reg (Pmode, temp);
+ /* A virtual register might be invalid in an insn, because
+ it can cause trouble in reload. Since we don't have access
+ to the expanders at map translation time, make sure we have
+ a proper register now.
+ If a virtual register is actually valid, cse or combine
+ can put it into the mapped insns. */
+ if (REGNO (temp) >= FIRST_VIRTUAL_REGISTER
+ && REGNO (temp) <= LAST_VIRTUAL_REGISTER)
+ temp = copy_to_mode_reg (Pmode, temp);
map->reg_map[REGNO (XEXP (loc, 0))] = temp;
if (CONSTANT_P (structure_value_addr)