static void clear_by_pieces_1 PARAMS ((rtx (*) (rtx, ...),
enum machine_mode,
struct clear_by_pieces *));
+static rtx get_subtarget PARAMS ((rtx));
static int is_zeros_p PARAMS ((tree));
static int mostly_zeros_p PARAMS ((tree));
static void store_constructor_field PARAMS ((rtx, unsigned HOST_WIDE_INT,
}
/* Small sanity check that the queue is empty at the end of a function. */
+
void
finish_expr_for_function ()
{
return tgtblk;
}
-
/* Add a USE expression for REG to the (possibly empty) list pointed
to by CALL_FUSAGE. REG must denote a hard register. */
anti_adjust_stack (alignment_pad);
}
\f
+/* Return X if X can be used as a subtarget in a sequence of arithmetic
+ operations. */
+
+static rtx
+get_subtarget (x)
+ rtx x;
+{
+ return ((x == 0
+ /* Only registers can be subtargets. */
+ || GET_CODE (x) != REG
+ /* If the register is readonly, it can't be set more than once. */
+ || RTX_UNCHANGING_P (x)
+ /* Don't use hard regs to avoid extending their life. */
+ || REGNO (x) < FIRST_PSEUDO_REGISTER
+ /* Avoid subtargets inside loops,
+ since they hide some invariant expressions. */
+ || preserve_subexpressions_p ())
+ ? 0 : x);
+}
+
/* Expand an assignment that stores the value of FROM into TO.
If WANT_VALUE is nonzero, return an rtx for the value of TO.
(This may contain a QUEUED rtx;
rtx tmp;
register rtx op2;
/* Use subtarget as the target for operand 0 of a binary operation. */
- register rtx subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0);
+ register rtx subtarget = get_subtarget (target);
/* Check for a PIC address load. */
if (flag_pic
mode = TYPE_MODE (type);
/* Use subtarget as the target for operand 0 of a binary operation. */
- subtarget = (target != 0 && GET_CODE (target) == REG ? target : 0);
+ subtarget = get_subtarget (target);
original_target = target;
ignore = (target == const0_rtx
|| ((code == NON_LVALUE_EXPR || code == NOP_EXPR
else
ro_modifier = EXPAND_NORMAL;
- /* Don't use hard regs as subtargets, because the combiner
- can only handle pseudo regs. */
- if (subtarget && REGNO (subtarget) < FIRST_PSEUDO_REGISTER)
- subtarget = 0;
- /* Avoid subtargets inside loops,
- since they hide some invariant expressions. */
- if (preserve_subexpressions_p ())
- subtarget = 0;
-
/* If we are going to ignore this result, we need only do something
if there is a side-effect somewhere in the expression. If there
is, short-circuit the most common cases here. Note that we must
#endif
);
- if (subtarget == 0 || GET_CODE (subtarget) != REG
- || GET_MODE (subtarget) != operand_mode
+ if (! get_subtarget (subtarget)
|| ! safe_from_p (subtarget, inner, 1))
subtarget = 0;
}
preexpand_calls (exp);
- if (subtarget == 0 || GET_CODE (subtarget) != REG
- || GET_MODE (subtarget) != operand_mode
+ if (! get_subtarget (target)
|| ! safe_from_p (subtarget, arg1, 1))
subtarget = 0;