return true;
}
\f
-/* Copy NODE (which must be a DECL, but not a PARM_DECL). The DECL
- originally was in the FROM_FN, but now it will be in the
- TO_FN. */
+/* Copy NODE (which must be a DECL). The DECL originally was in the FROM_FN,
+ but now it will be in the TO_FN. */
tree
copy_decl_for_inlining (tree decl, tree from_fn, tree to_fn)
/* Copy the declaration. */
if (TREE_CODE (decl) == PARM_DECL || TREE_CODE (decl) == RESULT_DECL)
{
- tree type;
- int invisiref = 0;
-
- /* See if the frontend wants to pass this by invisible reference. */
- if (TREE_CODE (decl) == PARM_DECL
- && DECL_ARG_TYPE (decl) != TREE_TYPE (decl)
- && POINTER_TYPE_P (DECL_ARG_TYPE (decl))
- && TREE_TYPE (DECL_ARG_TYPE (decl)) == TREE_TYPE (decl))
- {
- invisiref = 1;
- type = DECL_ARG_TYPE (decl);
- }
- else
- type = TREE_TYPE (decl);
+ tree type = TREE_TYPE (decl);
- /* For a parameter, we must make an equivalent VAR_DECL, not a
+ /* For a parameter or result, we must make an equivalent VAR_DECL, not a
new PARM_DECL. */
copy = build_decl (VAR_DECL, DECL_NAME (decl), type);
- if (!invisiref)
- {
- TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl);
- TREE_READONLY (copy) = TREE_READONLY (decl);
- TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl);
- }
- else
- {
- TREE_ADDRESSABLE (copy) = 0;
- TREE_READONLY (copy) = 1;
- TREE_THIS_VOLATILE (copy) = 0;
- }
+ TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl);
+ TREE_READONLY (copy) = TREE_READONLY (decl);
+ TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl);
}
else
{
if (TREE_CODE (copy) == LABEL_DECL)
{
TREE_ADDRESSABLE (copy) = 0;
- DECL_TOO_LATE (copy) = 0;
}
}
+ /* Don't generate debug information for the copy if we wouldn't have
+ generated it for the copy either. */
+ DECL_ARTIFICIAL (copy) = DECL_ARTIFICIAL (decl);
+ DECL_IGNORED_P (copy) = DECL_IGNORED_P (decl);
+
/* Set the DECL_ABSTRACT_ORIGIN so the debugging routines know what
declaration inspired this copy. */
DECL_ABSTRACT_ORIGIN (copy) = DECL_ORIGIN (decl);
rtl is ever emitted.
If FOR_LHS is nonzero, if means we are processing something that will
- be the LHS of a SET. In that case, we copy RTX_UNCHANGING_P even if
- inlining since we need to be conservative in how it is set for
- such cases.
+ be the LHS of a SET.
Handle constants that need to be placed in the constant pool by
calling `force_const_mem'. */
emit_insn_after (seq, map->insns_at_start);
return temp;
}
- else if (REG_FUNCTION_VALUE_P (orig))
- {
- if (rtx_equal_function_value_matters)
- /* This is an ignored return value. We must not
- leave it in with REG_FUNCTION_VALUE_P set, since
- that would confuse subsequent inlining of the
- current function into a later function. */
- return gen_rtx_REG (GET_MODE (orig), regno);
- else
- /* Must be unrolling loops or replicating code if we
- reach here, so return the register unchanged. */
- return orig;
- }
else
return orig;
map->reg_map[regno] = gen_reg_rtx (mode);
REG_USERVAR_P (map->reg_map[regno]) = REG_USERVAR_P (orig);
REG_LOOP_TEST_P (map->reg_map[regno]) = REG_LOOP_TEST_P (orig);
- RTX_UNCHANGING_P (map->reg_map[regno]) = RTX_UNCHANGING_P (orig);
/* A reg with REG_FUNCTION_VALUE_P true will never reach here. */
if (REG_POINTER (map->x_regno_reg_rtx[regno]))
GET_MODE (SUBREG_REG (orig)),
SUBREG_BYTE (orig));
- case ADDRESSOF:
- copy = gen_rtx_ADDRESSOF (mode,
- copy_rtx_and_substitute (XEXP (orig, 0),
- map, for_lhs),
- 0, ADDRESSOF_DECL (orig));
- regno = ADDRESSOF_REGNO (orig);
- if (map->reg_map[regno])
- regno = REGNO (map->reg_map[regno]);
- else if (regno > LAST_VIRTUAL_REGISTER)
- {
- temp = XEXP (orig, 0);
- map->reg_map[regno] = gen_reg_rtx (GET_MODE (temp));
- REG_USERVAR_P (map->reg_map[regno]) = REG_USERVAR_P (temp);
- REG_LOOP_TEST_P (map->reg_map[regno]) = REG_LOOP_TEST_P (temp);
- RTX_UNCHANGING_P (map->reg_map[regno]) = RTX_UNCHANGING_P (temp);
- /* A reg with REG_FUNCTION_VALUE_P true will never reach here. */
-
- /* Objects may initially be represented as registers, but
- but turned into a MEM if their address is taken by
- put_var_into_stack. Therefore, the register table may have
- entries which are MEMs.
-
- We briefly tried to clear such entries, but that ended up
- cascading into many changes due to the optimizers not being
- prepared for empty entries in the register table. So we've
- decided to allow the MEMs in the register table for now. */
- if (REG_P (map->x_regno_reg_rtx[regno])
- && REG_POINTER (map->x_regno_reg_rtx[regno]))
- mark_reg_pointer (map->reg_map[regno],
- map->regno_pointer_align[regno]);
- regno = REGNO (map->reg_map[regno]);
- }
- ADDRESSOF_REGNO (copy) = regno;
- return copy;
-
case USE:
case CLOBBER:
/* USE and CLOBBER are ordinary, but we convert (use (subreg foo))
to (use foo) if the original insn didn't have a subreg.
- Removing the subreg distorts the VAX movstrhi pattern
+ Removing the subreg distorts the VAX movmemhi pattern
by changing the mode of an operand. */
copy = copy_rtx_and_substitute (XEXP (orig, 0), map, code == CLOBBER);
if (GET_CODE (copy) == SUBREG && GET_CODE (XEXP (orig, 0)) != SUBREG)
/* Enforce consistency between the addresses in the regular insn flow
and the ones in CALL_INSN_FUNCTION_USAGE lists, if any. */
- if (GET_CODE (insn) == CALL_INSN && CALL_INSN_FUNCTION_USAGE (insn))
+ if (CALL_P (insn) && CALL_INSN_FUNCTION_USAGE (insn))
{
subst_constants (&CALL_INSN_FUNCTION_USAGE (insn), insn, map, 1);
apply_change_group ();
case CLOBBER:
/* The only thing we can do with a USE or CLOBBER is possibly do
some substitutions in a MEM within it. */
- if (GET_CODE (XEXP (x, 0)) == MEM)
+ if (MEM_P (XEXP (x, 0)))
subst_constants (&XEXP (XEXP (x, 0), 0), insn, map, 0);
return;
}
/* Do substitute in the address of a destination in memory. */
- if (GET_CODE (*dest_loc) == MEM)
+ if (MEM_P (*dest_loc))
subst_constants (&XEXP (*dest_loc, 0), insn, map, 0);
/* Check for the case of DEST a SUBREG, both it and the underlying
if (x == NULL_RTX || REG_N_SETS (REGNO (ivs->entries[i].pseudo)) > 1)
; /* Do nothing. */
- else if (GET_CODE (x) == MEM)
+ else if (MEM_P (x))
reg_equiv_memory_loc[regno] = x;
else if (REG_P (x))
{