Commit 48810515 by David Malcolm Committed by David Malcolm

calls.c: Use rtx_insn

gcc/
2014-08-21  David Malcolm  <dmalcolm@redhat.com>

	* calls.c (emit_call_1): Strengthen local "call_insn" from rtx to
	rtx_insn *.
	(internal_arg_pointer_exp_state): Likewise for field "scan_start".
	(internal_arg_pointer_based_exp_scan): Likewise for locals "insn",
	"scan_start".
	(load_register_parameters): Likewise for local "before_arg".
	(check_sibcall_argument_overlap): Likewise for param "insn".
	(expand_call): Likewise for locals "normal_call_insns",
	"tail_call_insns", "insns", "before_call", "after_args",
	"before_arg", "last", "prev".  Strengthen one of the "last" from
	rtx to rtx_call_insn *.
	(fixup_tail_calls): Strengthen local "insn" from rtx to
	rtx_insn *.
	(emit_library_call_value_1): Likewise for locals "before_call" and
	"last".

From-SVN: r214289
parent 58f4cf2a
2014-08-21 David Malcolm <dmalcolm@redhat.com> 2014-08-21 David Malcolm <dmalcolm@redhat.com>
* calls.c (emit_call_1): Strengthen local "call_insn" from rtx to
rtx_insn *.
(internal_arg_pointer_exp_state): Likewise for field "scan_start".
(internal_arg_pointer_based_exp_scan): Likewise for locals "insn",
"scan_start".
(load_register_parameters): Likewise for local "before_arg".
(check_sibcall_argument_overlap): Likewise for param "insn".
(expand_call): Likewise for locals "normal_call_insns",
"tail_call_insns", "insns", "before_call", "after_args",
"before_arg", "last", "prev". Strengthen one of the "last" from
rtx to rtx_call_insn *.
(fixup_tail_calls): Strengthen local "insn" from rtx to
rtx_insn *.
(emit_library_call_value_1): Likewise for locals "before_call" and
"last".
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* builtins.c (expand_builtin_longjmp): Strengthen locals "insn" * builtins.c (expand_builtin_longjmp): Strengthen locals "insn"
and "last" from rtx to rtx_insn *. and "last" from rtx to rtx_insn *.
(expand_builtin_nonlocal_goto): Likewise for local "insn". (expand_builtin_nonlocal_goto): Likewise for local "insn".
......
...@@ -153,7 +153,7 @@ static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type, ...@@ -153,7 +153,7 @@ static rtx emit_library_call_value_1 (int, rtx, rtx, enum libcall_type,
enum machine_mode, int, va_list); enum machine_mode, int, va_list);
static int special_function_p (const_tree, int); static int special_function_p (const_tree, int);
static int check_sibcall_argument_overlap_1 (rtx); static int check_sibcall_argument_overlap_1 (rtx);
static int check_sibcall_argument_overlap (rtx, struct arg_data *, int); static int check_sibcall_argument_overlap (rtx_insn *, struct arg_data *, int);
static int combine_pending_stack_adjustment_and_call (int, struct args_size *, static int combine_pending_stack_adjustment_and_call (int, struct args_size *,
unsigned int); unsigned int);
...@@ -261,7 +261,8 @@ emit_call_1 (rtx funexp, tree fntree ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNU ...@@ -261,7 +261,8 @@ emit_call_1 (rtx funexp, tree fntree ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNU
cumulative_args_t args_so_far ATTRIBUTE_UNUSED) cumulative_args_t args_so_far ATTRIBUTE_UNUSED)
{ {
rtx rounded_stack_size_rtx = GEN_INT (rounded_stack_size); rtx rounded_stack_size_rtx = GEN_INT (rounded_stack_size);
rtx call_insn, call, funmem; rtx_insn *call_insn;
rtx call, funmem;
int already_popped = 0; int already_popped = 0;
HOST_WIDE_INT n_popped HOST_WIDE_INT n_popped
= targetm.calls.return_pops_args (fndecl, funtype, stack_size); = targetm.calls.return_pops_args (fndecl, funtype, stack_size);
...@@ -1687,7 +1688,7 @@ static struct ...@@ -1687,7 +1688,7 @@ static struct
{ {
/* Last insn that has been scanned by internal_arg_pointer_based_exp_scan, /* Last insn that has been scanned by internal_arg_pointer_based_exp_scan,
or NULL_RTX if none has been scanned yet. */ or NULL_RTX if none has been scanned yet. */
rtx scan_start; rtx_insn *scan_start;
/* Vector indexed by REGNO - FIRST_PSEUDO_REGISTER, recording if a pseudo is /* Vector indexed by REGNO - FIRST_PSEUDO_REGISTER, recording if a pseudo is
based on crtl->args.internal_arg_pointer. The element is NULL_RTX if the based on crtl->args.internal_arg_pointer. The element is NULL_RTX if the
pseudo isn't based on it, a CONST_INT offset if the pseudo is based on it pseudo isn't based on it, a CONST_INT offset if the pseudo is based on it
...@@ -1706,7 +1707,7 @@ static rtx internal_arg_pointer_based_exp (rtx, bool); ...@@ -1706,7 +1707,7 @@ static rtx internal_arg_pointer_based_exp (rtx, bool);
static void static void
internal_arg_pointer_based_exp_scan (void) internal_arg_pointer_based_exp_scan (void)
{ {
rtx insn, scan_start = internal_arg_pointer_exp_state.scan_start; rtx_insn *insn, *scan_start = internal_arg_pointer_exp_state.scan_start;
if (scan_start == NULL_RTX) if (scan_start == NULL_RTX)
insn = get_insns (); insn = get_insns ();
...@@ -1872,7 +1873,7 @@ load_register_parameters (struct arg_data *args, int num_actuals, ...@@ -1872,7 +1873,7 @@ load_register_parameters (struct arg_data *args, int num_actuals,
int partial = args[i].partial; int partial = args[i].partial;
int nregs; int nregs;
int size = 0; int size = 0;
rtx before_arg = get_last_insn (); rtx_insn *before_arg = get_last_insn ();
/* Set non-negative if we must move a word at a time, even if /* Set non-negative if we must move a word at a time, even if
just one word (e.g, partial == 4 && mode == DFmode). Set just one word (e.g, partial == 4 && mode == DFmode). Set
to -1 if we just use a normal move insn. This value can be to -1 if we just use a normal move insn. This value can be
...@@ -2103,7 +2104,8 @@ check_sibcall_argument_overlap_1 (rtx x) ...@@ -2103,7 +2104,8 @@ check_sibcall_argument_overlap_1 (rtx x)
slots, zero otherwise. */ slots, zero otherwise. */
static int static int
check_sibcall_argument_overlap (rtx insn, struct arg_data *arg, int mark_stored_args_map) check_sibcall_argument_overlap (rtx_insn *insn, struct arg_data *arg,
int mark_stored_args_map)
{ {
int low, high; int low, high;
...@@ -2194,9 +2196,9 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2194,9 +2196,9 @@ expand_call (tree exp, rtx target, int ignore)
/* RTX for the function to be called. */ /* RTX for the function to be called. */
rtx funexp; rtx funexp;
/* Sequence of insns to perform a normal "call". */ /* Sequence of insns to perform a normal "call". */
rtx normal_call_insns = NULL_RTX; rtx_insn *normal_call_insns = NULL;
/* Sequence of insns to perform a tail "call". */ /* Sequence of insns to perform a tail "call". */
rtx tail_call_insns = NULL_RTX; rtx_insn *tail_call_insns = NULL;
/* Data type of the function. */ /* Data type of the function. */
tree funtype; tree funtype;
tree type_arg_types; tree type_arg_types;
...@@ -2662,8 +2664,8 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -2662,8 +2664,8 @@ expand_call (tree exp, rtx target, int ignore)
recursion call can be ignored if we indeed use the tail recursion call can be ignored if we indeed use the tail
call expansion. */ call expansion. */
saved_pending_stack_adjust save; saved_pending_stack_adjust save;
rtx insns; rtx_insn *insns, *before_call, *after_args;
rtx before_call, next_arg_reg, after_args; rtx next_arg_reg;
if (pass == 0) if (pass == 0)
{ {
...@@ -3032,7 +3034,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3032,7 +3034,7 @@ expand_call (tree exp, rtx target, int ignore)
{ {
if (args[i].reg == 0 || args[i].pass_on_stack) if (args[i].reg == 0 || args[i].pass_on_stack)
{ {
rtx before_arg = get_last_insn (); rtx_insn *before_arg = get_last_insn ();
/* We don't allow passing huge (> 2^30 B) arguments /* We don't allow passing huge (> 2^30 B) arguments
by value. It would cause an overflow later on. */ by value. It would cause an overflow later on. */
...@@ -3072,7 +3074,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3072,7 +3074,7 @@ expand_call (tree exp, rtx target, int ignore)
for (i = 0; i < num_actuals; i++) for (i = 0; i < num_actuals; i++)
if (args[i].partial != 0 && ! args[i].pass_on_stack) if (args[i].partial != 0 && ! args[i].pass_on_stack)
{ {
rtx before_arg = get_last_insn (); rtx_insn *before_arg = get_last_insn ();
if (store_one_arg (&args[i], argblock, flags, if (store_one_arg (&args[i], argblock, flags,
adjusted_args_size.var != 0, adjusted_args_size.var != 0,
...@@ -3159,7 +3161,8 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3159,7 +3161,8 @@ expand_call (tree exp, rtx target, int ignore)
if (flag_use_caller_save) if (flag_use_caller_save)
{ {
rtx last, datum = NULL_RTX; rtx_call_insn *last;
rtx datum = NULL_RTX;
if (fndecl != NULL_TREE) if (fndecl != NULL_TREE)
{ {
datum = XEXP (DECL_RTL (fndecl), 0); datum = XEXP (DECL_RTL (fndecl), 0);
...@@ -3196,7 +3199,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3196,7 +3199,7 @@ expand_call (tree exp, rtx target, int ignore)
if (pass && (flags & ECF_MALLOC)) if (pass && (flags & ECF_MALLOC))
{ {
rtx temp = gen_reg_rtx (GET_MODE (valreg)); rtx temp = gen_reg_rtx (GET_MODE (valreg));
rtx last, insns; rtx_insn *last, *insns;
/* The return value from a malloc-like function is a pointer. */ /* The return value from a malloc-like function is a pointer. */
if (TREE_CODE (rettype) == POINTER_TYPE) if (TREE_CODE (rettype) == POINTER_TYPE)
...@@ -3227,7 +3230,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3227,7 +3230,7 @@ expand_call (tree exp, rtx target, int ignore)
immediately after the CALL_INSN. Some ports emit more immediately after the CALL_INSN. Some ports emit more
than just a CALL_INSN above, so we must search for it here. */ than just a CALL_INSN above, so we must search for it here. */
rtx last = get_last_insn (); rtx_insn *last = get_last_insn ();
while (!CALL_P (last)) while (!CALL_P (last))
{ {
last = PREV_INSN (last); last = PREV_INSN (last);
...@@ -3375,7 +3378,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3375,7 +3378,7 @@ expand_call (tree exp, rtx target, int ignore)
if (old_stack_level) if (old_stack_level)
{ {
rtx prev = get_last_insn (); rtx_insn *prev = get_last_insn ();
emit_stack_restore (SAVE_BLOCK, old_stack_level); emit_stack_restore (SAVE_BLOCK, old_stack_level);
stack_pointer_delta = old_stack_pointer_delta; stack_pointer_delta = old_stack_pointer_delta;
...@@ -3451,7 +3454,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3451,7 +3454,7 @@ expand_call (tree exp, rtx target, int ignore)
} }
sbitmap_free (stored_args_map); sbitmap_free (stored_args_map);
internal_arg_pointer_exp_state.scan_start = NULL_RTX; internal_arg_pointer_exp_state.scan_start = NULL;
internal_arg_pointer_exp_state.cache.release (); internal_arg_pointer_exp_state.cache.release ();
} }
else else
...@@ -3467,7 +3470,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3467,7 +3470,7 @@ expand_call (tree exp, rtx target, int ignore)
/* If something prevents making this a sibling call, /* If something prevents making this a sibling call,
zero out the sequence. */ zero out the sequence. */
if (sibcall_failure) if (sibcall_failure)
tail_call_insns = NULL_RTX; tail_call_insns = NULL;
else else
break; break;
} }
...@@ -3504,7 +3507,7 @@ expand_call (tree exp, rtx target, int ignore) ...@@ -3504,7 +3507,7 @@ expand_call (tree exp, rtx target, int ignore)
void void
fixup_tail_calls (void) fixup_tail_calls (void)
{ {
rtx insn; rtx_insn *insn;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{ {
...@@ -3612,7 +3615,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -3612,7 +3615,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
int flags; int flags;
int reg_parm_stack_space = 0; int reg_parm_stack_space = 0;
int needed; int needed;
rtx before_call; rtx_insn *before_call;
tree tfom; /* type_for_mode (outmode, 0) */ tree tfom; /* type_for_mode (outmode, 0) */
#ifdef REG_PARM_STACK_SPACE #ifdef REG_PARM_STACK_SPACE
...@@ -4205,7 +4208,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -4205,7 +4208,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
/* The barrier note must be emitted /* The barrier note must be emitted
immediately after the CALL_INSN. Some ports emit more than immediately after the CALL_INSN. Some ports emit more than
just a CALL_INSN above, so we must search for it here. */ just a CALL_INSN above, so we must search for it here. */
rtx last = get_last_insn (); rtx_insn *last = get_last_insn ();
while (!CALL_P (last)) while (!CALL_P (last))
{ {
last = PREV_INSN (last); last = PREV_INSN (last);
...@@ -4220,7 +4223,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, ...@@ -4220,7 +4223,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
and LCT_RETURNS_TWICE, cannot perform non-local gotos. */ and LCT_RETURNS_TWICE, cannot perform non-local gotos. */
if (flags & ECF_NOTHROW) if (flags & ECF_NOTHROW)
{ {
rtx last = get_last_insn (); rtx_insn *last = get_last_insn ();
while (!CALL_P (last)) while (!CALL_P (last))
{ {
last = PREV_INSN (last); last = PREV_INSN (last);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment