where they are defined. */
static int debug_output = 0;
-/* Holds local startup time. */
-static struct tm *timebuf = NULL;
-
/* Nonzero indicates special processing used by the pcp program. The
special effects of this mode are:
return 0;
}
\f
+static struct tm *
+timestamp ()
+{
+ static struct tm *timebuf;
+ if (!timebuf) {
+ time_t t = time (0);
+ timebuf = localtime (&t);
+ }
+ return timebuf;
+}
+
static char *monthnames[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
};
int i, len;
int true_indepth;
FILE_BUF *ip = NULL;
+ struct tm *timebuf;
int paren = 0; /* For special `defined' keyword */
case T_DATE:
case T_TIME:
buf = (char *) alloca (20);
+ timebuf = timestamp ();
if (hp->type == T_DATE)
sprintf (buf, "\"%s %2d %4d\"", monthnames[timebuf->tm_mon],
timebuf->tm_mday, timebuf->tm_year + 1900);
FILE_BUF *inp;
FILE_BUF *outp;
{
- time_t t;
-
- t = time (0);
- timebuf = localtime (&t);
-
install ("__LINE__", -1, T_SPECLINE, 0, -1);
install ("__DATE__", -1, T_DATE, 0, -1);
install ("__FILE__", -1, T_FILE, 0, -1);
{
char directive[2048];
register struct directive *dp = &directive_table[0];
+ struct tm *timebuf = timestamp ();
sprintf (directive, " __BASE_FILE__ \"%s\"\n",
instack[0].nominal_fname);
/* Integrate the procedure defined by FNDECL. Note that this function
may wind up calling itself. Since the static variables are not
reentrant, we do not assign them until after the possibility
- or recursion is eliminated.
+ of recursion is eliminated.
If IGNORE is nonzero, do not produce a value.
Otherwise store the value in TARGET if it is nonzero and that is convenient.
case CODE_LABEL:
copy = emit_label (map->label_map[CODE_LABEL_NUMBER (insn)]);
+ LABEL_NAME (copy) = LABEL_NAME (insn);
map->const_age++;
break;
/* If IN appears in OUT, we can't share any input-only reload for IN. */
if (in != 0 && out != 0 && GET_CODE (out) == MEM
&& (GET_CODE (in) == REG || GET_CODE (in) == MEM)
- && reg_overlap_mentioned_p (in, XEXP (out, 0)))
+ && reg_overlap_mentioned_for_reload_p (in, XEXP (out, 0)))
dont_share = 1;
/* Narrow down the class of register wanted if that is
/* Args reversed because the first arg seems to be
the one that we imagine being modified
while the second is the one that might be affected. */
- || (! reg_overlap_mentioned_p (reload_out[output_reload],
- reload_in[i])
+ || (! reg_overlap_mentioned_for_reload_p (reload_out[output_reload],
+ reload_in[i])
/* However, if the input is a register that appears inside
the output, then we also can't share.
Imagine (set (mem (reg 69)) (plus (reg 69) ...)).
result to be stored in memory, then that result
will clobber the address of the memory ref. */
&& ! (GET_CODE (reload_in[i]) == REG
- && reg_overlap_mentioned_p (reload_in[i],
- reload_out[output_reload])))))
+ && reg_overlap_mentioned_for_reload_p (reload_in[i],
+ reload_out[output_reload])))))
{
int j;
for (note = REG_NOTES (this_insn); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_DEAD
&& GET_CODE (XEXP (note, 0)) == REG
- && ! reg_overlap_mentioned_p (XEXP (note, 0),
- reload_out[output_reload])
+ && ! reg_overlap_mentioned_for_reload_p (XEXP (note, 0),
+ reload_out[output_reload])
&& REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER
&& HARD_REGNO_MODE_OK (REGNO (XEXP (note, 0)), reload_outmode[output_reload])
&& TEST_HARD_REG_BIT (reg_class_contents[(int) reload_reg_class[output_reload]],
}
return 0;
}
+
+/* Nonzero if modifying X will affect IN. If X is a register or a SUBREG,
+ we check if any register number in X conflicts with the relevant register
+ numbers. If X is a constant, return 0. If X is a MEM, return 1 iff IN
+ contains a MEM (we don't bother checking for memory addresses that can't
+ conflict because we expect this to be a rare case.
+
+ This function is similar to reg_overlap_mention_p in rtlanal.c except
+ that we look at equivalences for pseudos that didn't get hard registers. */
+
+int
+reg_overlap_mentioned_for_reload_p (x, in)
+ rtx x, in;
+{
+ int regno, endregno;
+
+ if (GET_CODE (x) == SUBREG)
+ {
+ regno = REGNO (SUBREG_REG (x));
+ if (regno < FIRST_PSEUDO_REGISTER)
+ regno += SUBREG_WORD (x);
+ }
+ else if (GET_CODE (x) == REG)
+ {
+ regno = REGNO (x);
+ if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] == -1
+ && ((reg_equiv_address[regno]
+ && reg_overlap_mentioned_for_reload_p (reg_equiv_address[regno],
+ in))
+ || (reg_equiv_mem[regno]
+ && reg_overlap_mentioned_for_reload_p (reg_equiv_mem[regno],
+ in))))
+ return 1;
+ }
+ else if (CONSTANT_P (x))
+ return 0;
+ else if (GET_CODE (x) == MEM)
+ {
+ char *fmt;
+ int i;
+
+ if (GET_CODE (in) == MEM)
+ return 1;
+
+ fmt = GET_RTX_FORMAT (GET_CODE (in));
+
+ for (i = GET_RTX_LENGTH (GET_CODE (in)) - 1; i >= 0; i--)
+ if (fmt[i] == 'e' && reg_overlap_mentioned_for_reload_p (x,
+ XEXP (in, i)))
+ return 1;
+
+ return 0;
+ }
+ else if (GET_CODE (x) == SCRATCH || GET_CODE (x) == PC
+ || GET_CODE (x) == CC0)
+ return reg_mentioned_p (x, in);
+ else
+ abort ();
+
+ endregno = regno + (regno < FIRST_PSEUDO_REGISTER
+ ? HARD_REGNO_NREGS (regno, GET_MODE (x)) : 1);
+
+ return refers_to_regno_for_reload_p (regno, endregno, in, 0);
+}
\f
#if 0
/* If we propose to get the value from the stack pointer or if GOAL is
a MEM based on the stack pointer, we need a stable SP. */
if (valueno == STACK_POINTER_REGNUM
- || (goal_mem && reg_overlap_mentioned_p (stack_pointer_rtx, goal)))
+ || (goal_mem && reg_overlap_mentioned_for_reload_p (stack_pointer_rtx,
+ goal)))
need_stable_sp = 1;
/* Reject VALUE if the copy-insn moved the wrong sort of datum. */
and is also a register that appears in the address of GOAL. */
if (goal_mem && value == SET_DEST (PATTERN (where))
- && refers_to_regno_p (valueno,
- valueno + HARD_REGNO_NREGS (valueno, mode),
- goal, 0))
+ && refers_to_regno_for_reload_p (valueno,
+ (valueno
+ + HARD_REGNO_NREGS (valueno, mode)),
+ goal, 0))
return 0;
/* Reject registers that overlap GOAL. */
&& xregno + xnregs > valueno)
return 0;
if (goal_mem_addr_varies
- && reg_overlap_mentioned_p (dest, goal))
+ && reg_overlap_mentioned_for_reload_p (dest, goal))
return 0;
}
else if (goal_mem && GET_CODE (dest) == MEM
&& xregno + xnregs > valueno)
return 0;
if (goal_mem_addr_varies
- && reg_overlap_mentioned_p (dest, goal))
+ && reg_overlap_mentioned_for_reload_p (dest,
+ goal))
return 0;
}
else if (goal_mem && GET_CODE (dest) == MEM
if (incno < valueno + valuenregs && incno >= valueno)
return 0;
if (goal_mem_addr_varies
- && reg_overlap_mentioned_p (XEXP (link, 0), goal))
+ && reg_overlap_mentioned_for_reload_p (XEXP (link, 0),
+ goal))
return 0;
}
}
if (equiv != 0)
for (i = 0; i < n_earlyclobbers; i++)
- if (reg_overlap_mentioned_p (equiv, reload_earlyclobbers[i]))
+ if (reg_overlap_mentioned_for_reload_p (equiv,
+ reload_earlyclobbers[i]))
{
reload_override_in[r] = equiv;
equiv = 0;
int k;
for (k = 0; k < n_reloads; k++)
if (reload_reg_rtx[k] != 0 && k != j
- && reg_overlap_mentioned_p (reload_reg_rtx[k], oldequiv))
+ && reg_overlap_mentioned_for_reload_p (reload_reg_rtx[k],
+ oldequiv))
{
oldequiv = 0;
break;
prev != PREV_INSN (this_reload_insn);
prev = PREV_INSN (prev))
if (GET_RTX_CLASS (GET_CODE (prev) == 'i')
- && reg_overlap_mentioned_p (second_reload_reg,
- PATTERN (prev)))
+ && reg_overlap_mentioned_for_reload_p (second_reload_reg,
+ PATTERN (prev)))
{
REG_NOTES (prev) = gen_rtx (EXPR_LIST, REG_DEAD,
second_reload_reg,
for (prev1 = this_reload_insn;
prev1; prev1 = PREV_INSN (prev1))
if (GET_RTX_CLASS (GET_CODE (prev1) == 'i')
- && reg_overlap_mentioned_p (oldequiv_reg,
- PATTERN (prev1)))
+ && reg_overlap_mentioned_for_reload_p (oldequiv_reg,
+ PATTERN (prev1)))
{
REG_NOTES (prev1) = gen_rtx (EXPR_LIST, REG_DEAD,
oldequiv_reg,
for (p = PREV_INSN (first_output_reload_insn);
p != prev_insn; p = PREV_INSN (p))
if (GET_RTX_CLASS (GET_CODE (p)) == 'i'
- && reg_overlap_mentioned_p (reloadreg, PATTERN (p)))
+ && reg_overlap_mentioned_for_reload_p (reloadreg,
+ PATTERN (p)))
REG_NOTES (p) = gen_rtx (EXPR_LIST, REG_DEAD,
reloadreg, REG_NOTES (p));
for (p = PREV_INSN (first_output_reload_insn);
p != prev_insn; p = PREV_INSN (p))
if (GET_RTX_CLASS (GET_CODE (p)) == 'i'
- && reg_overlap_mentioned_p (second_reloadreg, PATTERN (p)))
+ && reg_overlap_mentioned_for_reload_p (second_reloadreg,
+ PATTERN (p)))
REG_NOTES (p) = gen_rtx (EXPR_LIST, REG_DEAD,
second_reloadreg, REG_NOTES (p));
#endif
if (REG_NOTE_KIND (reg_notes) == REG_DEAD
&& GET_CODE (XEXP (reg_notes, 0)) == REG
&& ((GET_CODE (dest) != REG
- && reg_overlap_mentioned_p (XEXP (reg_notes, 0), dest))
- || reg_overlap_mentioned_p (XEXP (reg_notes, 0), source)))
+ && reg_overlap_mentioned_for_reload_p (XEXP (reg_notes, 0),
+ dest))
+ || reg_overlap_mentioned_for_reload_p (XEXP (reg_notes, 0),
+ source)))
{
*prev_reg_note = next_reg_notes;
XEXP (reg_notes, 1) = REG_NOTES (insn1);
&& !INT_CST_LT (c, TYPE_MIN_VALUE (type)));
}
-/* Return the innermost context enclosing FNDECL that is
+/* Return the innermost context enclosing DECL that is
a FUNCTION_DECL, or zero if none. */
tree
-decl_function_context (fndecl)
- tree fndecl;
+decl_function_context (decl)
+ tree decl;
{
tree context;
- if (TREE_CODE (fndecl) == ERROR_MARK)
+ if (TREE_CODE (decl) == ERROR_MARK)
return 0;
- if (TREE_CODE (fndecl) == SAVE_EXPR)
- context = SAVE_EXPR_CONTEXT (fndecl);
+ if (TREE_CODE (decl) == SAVE_EXPR)
+ context = SAVE_EXPR_CONTEXT (decl);
else
- context = DECL_CONTEXT (fndecl);
+ context = DECL_CONTEXT (decl);
while (context && TREE_CODE (context) != FUNCTION_DECL)
{
return context;
}
-/* Return the innermost context enclosing FNDECL that is
+/* Return the innermost context enclosing DECL that is
a RECORD_TYPE or UNION_TYPE, or zero if none.
TYPE_DECLs and FUNCTION_DECLs are transparent to this function. */
tree
-decl_type_context (fndecl)
- tree fndecl;
+decl_type_context (decl)
+ tree decl;
{
- tree context = DECL_CONTEXT (fndecl);
+ tree context = DECL_CONTEXT (decl);
while (context)
{