aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-08-12 18:59:51 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1994-08-12 18:59:51 -0400
commitc9734bb90e64764d0dd2a305d4eebe099b869561 (patch)
tree7c0b0675a0f343546ac8ae231d3e70c75467a01a
parent426749e8af8eb4b0838ea81aaa9c41138ff160de (diff)
downloadgcc-c9734bb90e64764d0dd2a305d4eebe099b869561.zip
gcc-c9734bb90e64764d0dd2a305d4eebe099b869561.tar.gz
gcc-c9734bb90e64764d0dd2a305d4eebe099b869561.tar.bz2
(expand_inline_function): Use single_set when appropriate.
Delete insn that sets static_chain_incoming_rtx before its use. (subst_constants): Treat virtual reg as constant. From-SVN: r7910
-rw-r--r--gcc/integrate.c44
1 files changed, 31 insertions, 13 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 26d7663..1f4874c 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -1645,7 +1645,7 @@ expand_inline_function (fndecl, parms, target, ignore, type, structure_value_add
for (insn = insns; insn; insn = NEXT_INSN (insn))
{
- rtx copy, pattern;
+ rtx copy, pattern, set;
map->orig_asm_operands_vector = 0;
@@ -1653,6 +1653,7 @@ expand_inline_function (fndecl, parms, target, ignore, type, structure_value_add
{
case INSN:
pattern = PATTERN (insn);
+ set = single_set (insn);
copy = 0;
if (GET_CODE (pattern) == USE
&& GET_CODE (XEXP (pattern, 0)) == REG
@@ -1664,33 +1665,47 @@ expand_inline_function (fndecl, parms, target, ignore, type, structure_value_add
/* Ignore setting a function value that we don't want to use. */
if (map->inline_target == 0
- && GET_CODE (pattern) == SET
- && GET_CODE (SET_DEST (pattern)) == REG
- && REG_FUNCTION_VALUE_P (SET_DEST (pattern)))
+ && set != 0
+ && GET_CODE (SET_DEST (set)) == REG
+ && REG_FUNCTION_VALUE_P (SET_DEST (set)))
{
- if (volatile_refs_p (SET_SRC (pattern)))
+ if (volatile_refs_p (SET_SRC (set)))
{
+ rtx new_set;
+
/* If we must not delete the source,
load it into a new temporary. */
copy = emit_insn (copy_rtx_and_substitute (pattern, map));
- SET_DEST (PATTERN (copy))
- = gen_reg_rtx (GET_MODE (SET_DEST (PATTERN (copy))));
+
+ new_set = single_set (copy);
+ if (new_set == 0)
+ abort ();
+
+ SET_DEST (new_set)
+ = gen_reg_rtx (GET_MODE (SET_DEST (new_set)));
}
else
break;
}
+
+ /* If this is setting the static chain rtx, omit it. */
+ else if (static_chain_value != 0
+ && set != 0
+ && GET_CODE (SET_DEST (set)) == REG
+ && rtx_equal_p (SET_DEST (set),
+ static_chain_incoming_rtx))
+ break;
+
/* If this is setting the static chain pseudo, set it from
the value we want to give it instead. */
else if (static_chain_value != 0
- && GET_CODE (pattern) == SET
- && rtx_equal_p (SET_SRC (pattern),
+ && set != 0
+ && rtx_equal_p (SET_SRC (set),
static_chain_incoming_rtx))
{
- rtx newdest = copy_rtx_and_substitute (SET_DEST (pattern), map);
-
- copy = emit_insn (gen_rtx (SET, VOIDmode, newdest,
- static_chain_value));
+ rtx newdest = copy_rtx_and_substitute (SET_DEST (set), map);
+ copy = emit_move_insn (newdest, static_chain_value);
static_chain_value = 0;
}
else
@@ -2590,6 +2605,9 @@ subst_constants (loc, insn, map)
/* If storing a recognizable value save it for later recording. */
if ((map->num_sets < MAX_RECOG_OPERANDS)
&& (CONSTANT_P (src)
+ || (GET_CODE (src) == REG
+ && REGNO (src) >= FIRST_VIRTUAL_REGISTER
+ && REGNO (src) <= LAST_VIRTUAL_REGISTER)
|| (GET_CODE (src) == PLUS
&& GET_CODE (XEXP (src, 0)) == REG
&& REGNO (XEXP (src, 0)) >= FIRST_VIRTUAL_REGISTER