summaryrefslogtreecommitdiff
path: root/gcc/integrate.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-03 16:14:34 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2001-05-03 16:14:34 +0000
commit62b735c8b5c580f7bda1bc81e248c7d5b5e98729 (patch)
treed15e26ef2c3c3f119a14c3a43cc414d9612c5d2e /gcc/integrate.c
parentd2c1dfe0efff6d9a0128839136f00084f478c26a (diff)
downloadgcc-62b735c8b5c580f7bda1bc81e248c7d5b5e98729.tar.gz
* integrate.h (struct inline_remap): Add leaf_reg_map table.
* integrate.c (expand_inline_function): Use xcalloc to allocate memory. (copy_rtx_and_substitute): Use the leaf_reg_map for leaf registers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41791 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r--gcc/integrate.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index ba198b4c404..a4300303825 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -758,7 +758,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
/* Allocate the structures we use to remap things. */
- map = (struct inline_remap *) xmalloc (sizeof (struct inline_remap));
+ map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
map->fndecl = fndecl;
VARRAY_TREE_INIT (map->block_map, 10, "block_map");
@@ -1753,15 +1753,7 @@ copy_rtx_and_substitute (orig, map, for_lhs)
{
/* Some hard registers are also mapped,
but others are not translated. */
- if (map->reg_map[regno] != 0
- /* We shouldn't usually have reg_map set for return
- register, but it may happen if we have leaf-register
- remapping and the return register is used in one of
- the calling sequences of a call_placeholer. In this
- case, we'll end up with a reg_map set for this
- register, but we don't want to use for registers
- marked as return values. */
- && ! REG_FUNCTION_VALUE_P (orig))
+ if (map->reg_map[regno] != 0)
return map->reg_map[regno];
/* If this is the virtual frame pointer, make space in current
@@ -1879,9 +1871,9 @@ copy_rtx_and_substitute (orig, map, for_lhs)
if (map->integrating && regno < FIRST_PSEUDO_REGISTER
&& LEAF_REGISTERS[regno] && LEAF_REG_REMAP (regno) != regno)
{
- temp = gen_rtx_REG (mode, regno);
- map->reg_map[regno] = temp;
- return temp;
+ if (!map->leaf_reg_map[regno][mode])
+ map->leaf_reg_map[regno][mode] = gen_rtx_REG (mode, regno);
+ return map->leaf_reg_map[regno][mode];
}
#endif
else