mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-26 12:23:59 +08:00
jump.c: Convert prototypes to ISO C90.
* jump.c: Convert prototypes to ISO C90. * langhooks-def.h: Likewise. Add extern to prototypes. * langhooks.c: Likewise. * langhooks.h: Likewise. * lcm.c: Likewise. * local-alloc.c: Likewise. * loop-init.c: Likewise. * loop-unroll.c: Likewise. * loop-unswitch.c: Likewise. * loop.c: Likewise. * loop.h: Likewise. Add extern to prototypes. * machmode.h: Likewise. * main.c: Likewise. * mbchar.c: Likewise. * mbchar.h: Likewise. * mkdeps.c: Likewise. * mkdeps.h: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * output.h: Likewise. * gccspec.c: Likwise. * postreload.c: Likewise. * prefix.c: Likewise. * prefix.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * real.h: Likewise. * recog.c: Likewise. * recog.h: Likewise. * reg-stack.c: Likewise. * regclass.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * reload.c: Likewise. * reload.h: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * resource.h: Likewise. * rtl-error.c: Likewise. * rtl.c: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. From-SVN: r68998
This commit is contained in:
parent
391cfc4689
commit
0c20a65f04
@ -20,6 +20,53 @@
|
||||
* integrate.c: Likewise.
|
||||
* input.h: Likewise.
|
||||
* ifcvt.c: Likewise.
|
||||
* jump.c: Convert prototypes to ISO C90.
|
||||
* langhooks-def.h: Likewise. Add extern to prototypes.
|
||||
* langhooks.c: Likewise.
|
||||
* langhooks.h: Likewise.
|
||||
* lcm.c: Likewise.
|
||||
* local-alloc.c: Likewise.
|
||||
* loop-init.c: Likewise.
|
||||
* loop-unroll.c: Likewise.
|
||||
* loop-unswitch.c: Likewise.
|
||||
* loop.c: Likewise.
|
||||
* loop.h: Likewise. Add extern to prototypes.
|
||||
* machmode.h: Likewise.
|
||||
* main.c: Likewise.
|
||||
* mbchar.c: Likewise.
|
||||
* mbchar.h: Likewise.
|
||||
* mkdeps.c: Likewise.
|
||||
* mkdeps.h: Likewise.
|
||||
* optabs.c: Likewise.
|
||||
* optabs.h: Likewise.
|
||||
* output.h: Likewise.
|
||||
* gccspec.c: Likwise.
|
||||
* postreload.c: Likewise.
|
||||
* prefix.c: Likewise.
|
||||
* prefix.h: Likewise.
|
||||
* print-rtl.c: Likewise.
|
||||
* print-tree.c: Likewise.
|
||||
* profile.c: Likewise.
|
||||
* read-rtl.c: Likewise.
|
||||
* real.c: Likewise.
|
||||
* real.h: Likewise.
|
||||
* recog.c: Likewise.
|
||||
* recog.h: Likewise.
|
||||
* reg-stack.c: Likewise.
|
||||
* regclass.c: Likewise.
|
||||
* regmove.c: Likewise.
|
||||
* regrename.c: Likewise.
|
||||
* regs.h: Likewise.
|
||||
* reload.c: Likewise.
|
||||
* reload.h: Likewise.
|
||||
* reload1.c: Likewise.
|
||||
* reorg.c: Likewise.
|
||||
* resource.c: Likewise.
|
||||
* resource.h: Likewise.
|
||||
* rtl-error.c: Likewise.
|
||||
* rtl.c: Likewise.
|
||||
* rtl.h: Likewise.
|
||||
* rtlanal.c: Likewise.
|
||||
|
||||
2003-07-05 Kazu Hirata <kazu@cs.umass.edu>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Specific flags and argument handling of the C front-end.
|
||||
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -26,10 +26,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
|
||||
/* Filter argc and argv before processing by the gcc driver proper. */
|
||||
void
|
||||
lang_specific_driver (in_argc, in_argv, in_added_libraries)
|
||||
int *in_argc ATTRIBUTE_UNUSED;
|
||||
const char *const **in_argv ATTRIBUTE_UNUSED;
|
||||
int *in_added_libraries ATTRIBUTE_UNUSED;
|
||||
lang_specific_driver (int *in_argc ATTRIBUTE_UNUSED,
|
||||
const char *const **in_argv ATTRIBUTE_UNUSED,
|
||||
int *in_added_libraries ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef ENABLE_SHARED_LIBGCC
|
||||
int i;
|
||||
@ -96,7 +95,7 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
|
||||
|
||||
/* Called before linking. Returns 0 on success and -1 on failure. */
|
||||
int
|
||||
lang_specific_pre_link ()
|
||||
lang_specific_pre_link (void)
|
||||
{
|
||||
return 0; /* Not used for C. */
|
||||
}
|
||||
@ -104,7 +103,7 @@ lang_specific_pre_link ()
|
||||
/* Number of extra output files that lang_specific_pre_link may generate. */
|
||||
int lang_specific_extra_outfiles = 0; /* Not used for C. */
|
||||
|
||||
/* Table of language-specific spec functions. */
|
||||
/* Table of language-specific spec functions. */
|
||||
const struct spec_function lang_specific_spec_functions[] =
|
||||
{
|
||||
{ 0, 0 }
|
||||
|
185
gcc/jump.c
185
gcc/jump.c
@ -63,24 +63,23 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
or even change what is live at any point.
|
||||
So perhaps let combiner do it. */
|
||||
|
||||
static rtx next_nonnote_insn_in_loop PARAMS ((rtx));
|
||||
static void init_label_info PARAMS ((rtx));
|
||||
static void mark_all_labels PARAMS ((rtx));
|
||||
static int duplicate_loop_exit_test PARAMS ((rtx));
|
||||
static void delete_computation PARAMS ((rtx));
|
||||
static void redirect_exp_1 PARAMS ((rtx *, rtx, rtx, rtx));
|
||||
static int redirect_exp PARAMS ((rtx, rtx, rtx));
|
||||
static void invert_exp_1 PARAMS ((rtx));
|
||||
static int invert_exp PARAMS ((rtx));
|
||||
static int returnjump_p_1 PARAMS ((rtx *, void *));
|
||||
static void delete_prior_computation PARAMS ((rtx, rtx));
|
||||
static rtx next_nonnote_insn_in_loop (rtx);
|
||||
static void init_label_info (rtx);
|
||||
static void mark_all_labels (rtx);
|
||||
static int duplicate_loop_exit_test (rtx);
|
||||
static void delete_computation (rtx);
|
||||
static void redirect_exp_1 (rtx *, rtx, rtx, rtx);
|
||||
static int redirect_exp (rtx, rtx, rtx);
|
||||
static void invert_exp_1 (rtx);
|
||||
static int invert_exp (rtx);
|
||||
static int returnjump_p_1 (rtx *, void *);
|
||||
static void delete_prior_computation (rtx, rtx);
|
||||
|
||||
/* Alternate entry into the jump optimizer. This entry point only rebuilds
|
||||
the JUMP_LABEL field in jumping insns and REG_LABEL notes in non-jumping
|
||||
instructions. */
|
||||
void
|
||||
rebuild_jump_labels (f)
|
||||
rtx f;
|
||||
rebuild_jump_labels (rtx f)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -107,7 +106,7 @@ rebuild_jump_labels (f)
|
||||
old code is happy.
|
||||
*/
|
||||
void
|
||||
cleanup_barriers ()
|
||||
cleanup_barriers (void)
|
||||
{
|
||||
rtx insn, next, prev;
|
||||
for (insn = get_insns (); insn; insn = next)
|
||||
@ -129,8 +128,7 @@ cleanup_barriers ()
|
||||
This routine does not look inside SEQUENCEs. */
|
||||
|
||||
static rtx
|
||||
next_nonnote_insn_in_loop (insn)
|
||||
rtx insn;
|
||||
next_nonnote_insn_in_loop (rtx insn)
|
||||
{
|
||||
while (insn)
|
||||
{
|
||||
@ -146,8 +144,7 @@ next_nonnote_insn_in_loop (insn)
|
||||
}
|
||||
|
||||
void
|
||||
copy_loop_headers (f)
|
||||
rtx f;
|
||||
copy_loop_headers (rtx f)
|
||||
{
|
||||
rtx insn, next;
|
||||
/* Now iterate optimizing jumps until nothing changes over one pass. */
|
||||
@ -176,8 +173,7 @@ copy_loop_headers (f)
|
||||
}
|
||||
|
||||
void
|
||||
purge_line_number_notes (f)
|
||||
rtx f;
|
||||
purge_line_number_notes (rtx f)
|
||||
{
|
||||
rtx last_note = 0;
|
||||
rtx insn;
|
||||
@ -213,8 +209,7 @@ purge_line_number_notes (f)
|
||||
notes whose labels don't occur in the insn any more. Returns the
|
||||
largest INSN_UID found. */
|
||||
static void
|
||||
init_label_info (f)
|
||||
rtx f;
|
||||
init_label_info (rtx f)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -241,8 +236,7 @@ init_label_info (f)
|
||||
Combine consecutive labels, and count uses of labels. */
|
||||
|
||||
static void
|
||||
mark_all_labels (f)
|
||||
rtx f;
|
||||
mark_all_labels (rtx f)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -306,8 +300,7 @@ mark_all_labels (f)
|
||||
values of regno_first_uid and regno_last_uid. */
|
||||
|
||||
static int
|
||||
duplicate_loop_exit_test (loop_start)
|
||||
rtx loop_start;
|
||||
duplicate_loop_exit_test (rtx loop_start)
|
||||
{
|
||||
rtx insn, set, reg, p, link;
|
||||
rtx copy = 0, first_copy = 0;
|
||||
@ -541,9 +534,7 @@ duplicate_loop_exit_test (loop_start)
|
||||
Return true if there were only such notes and no real instructions. */
|
||||
|
||||
bool
|
||||
squeeze_notes (startp, endp)
|
||||
rtx* startp;
|
||||
rtx* endp;
|
||||
squeeze_notes (rtx* startp, rtx* endp)
|
||||
{
|
||||
rtx start = *startp;
|
||||
rtx end = *endp;
|
||||
@ -595,8 +586,7 @@ squeeze_notes (startp, endp)
|
||||
/* Return the label before INSN, or put a new label there. */
|
||||
|
||||
rtx
|
||||
get_label_before (insn)
|
||||
rtx insn;
|
||||
get_label_before (rtx insn)
|
||||
{
|
||||
rtx label;
|
||||
|
||||
@ -618,8 +608,7 @@ get_label_before (insn)
|
||||
/* Return the label after INSN, or put a new label there. */
|
||||
|
||||
rtx
|
||||
get_label_after (insn)
|
||||
rtx insn;
|
||||
get_label_after (rtx insn)
|
||||
{
|
||||
rtx label;
|
||||
|
||||
@ -643,9 +632,7 @@ get_label_after (insn)
|
||||
description should define REVERSIBLE_CC_MODE and REVERSE_CONDITION macros
|
||||
to help this function avoid overhead in these cases. */
|
||||
enum rtx_code
|
||||
reversed_comparison_code_parts (code, arg0, arg1, insn)
|
||||
rtx insn, arg0, arg1;
|
||||
enum rtx_code code;
|
||||
reversed_comparison_code_parts (enum rtx_code code, rtx arg0, rtx arg1, rtx insn)
|
||||
{
|
||||
enum machine_mode mode;
|
||||
|
||||
@ -759,8 +746,7 @@ reversed_comparison_code_parts (code, arg0, arg1, insn)
|
||||
/* A wrapper around the previous function to take COMPARISON as rtx
|
||||
expression. This simplifies many callers. */
|
||||
enum rtx_code
|
||||
reversed_comparison_code (comparison, insn)
|
||||
rtx comparison, insn;
|
||||
reversed_comparison_code (rtx comparison, rtx insn)
|
||||
{
|
||||
if (GET_RTX_CLASS (GET_CODE (comparison)) != '<')
|
||||
return UNKNOWN;
|
||||
@ -778,8 +764,7 @@ reversed_comparison_code (comparison, insn)
|
||||
Use reversed_comparison_code instead. */
|
||||
|
||||
enum rtx_code
|
||||
reverse_condition (code)
|
||||
enum rtx_code code;
|
||||
reverse_condition (enum rtx_code code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
@ -826,8 +811,7 @@ reverse_condition (code)
|
||||
that the target will support them too... */
|
||||
|
||||
enum rtx_code
|
||||
reverse_condition_maybe_unordered (code)
|
||||
enum rtx_code code;
|
||||
reverse_condition_maybe_unordered (enum rtx_code code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
@ -869,8 +853,7 @@ reverse_condition_maybe_unordered (code)
|
||||
This IS safe for IEEE floating-point. */
|
||||
|
||||
enum rtx_code
|
||||
swap_condition (code)
|
||||
enum rtx_code code;
|
||||
swap_condition (enum rtx_code code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
@ -917,8 +900,7 @@ swap_condition (code)
|
||||
CODE is returned. */
|
||||
|
||||
enum rtx_code
|
||||
unsigned_condition (code)
|
||||
enum rtx_code code;
|
||||
unsigned_condition (enum rtx_code code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
@ -947,8 +929,7 @@ unsigned_condition (code)
|
||||
/* Similarly, return the signed version of a comparison. */
|
||||
|
||||
enum rtx_code
|
||||
signed_condition (code)
|
||||
enum rtx_code code;
|
||||
signed_condition (enum rtx_code code)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
@ -978,8 +959,7 @@ signed_condition (code)
|
||||
truth of CODE1 implies the truth of CODE2. */
|
||||
|
||||
int
|
||||
comparison_dominates_p (code1, code2)
|
||||
enum rtx_code code1, code2;
|
||||
comparison_dominates_p (enum rtx_code code1, enum rtx_code code2)
|
||||
{
|
||||
/* UNKNOWN comparison codes can happen as a result of trying to revert
|
||||
comparison codes.
|
||||
@ -1060,8 +1040,7 @@ comparison_dominates_p (code1, code2)
|
||||
/* Return 1 if INSN is an unconditional jump and nothing else. */
|
||||
|
||||
int
|
||||
simplejump_p (insn)
|
||||
rtx insn;
|
||||
simplejump_p (rtx insn)
|
||||
{
|
||||
return (GET_CODE (insn) == JUMP_INSN
|
||||
&& GET_CODE (PATTERN (insn)) == SET
|
||||
@ -1076,8 +1055,7 @@ simplejump_p (insn)
|
||||
branch and compare insns. Use any_condjump_p instead whenever possible. */
|
||||
|
||||
int
|
||||
condjump_p (insn)
|
||||
rtx insn;
|
||||
condjump_p (rtx insn)
|
||||
{
|
||||
rtx x = PATTERN (insn);
|
||||
|
||||
@ -1107,8 +1085,7 @@ condjump_p (insn)
|
||||
branch and compare insns. Use any_condjump_p instead whenever possible. */
|
||||
|
||||
int
|
||||
condjump_in_parallel_p (insn)
|
||||
rtx insn;
|
||||
condjump_in_parallel_p (rtx insn)
|
||||
{
|
||||
rtx x = PATTERN (insn);
|
||||
|
||||
@ -1139,8 +1116,7 @@ condjump_in_parallel_p (insn)
|
||||
/* Return set of PC, otherwise NULL. */
|
||||
|
||||
rtx
|
||||
pc_set (insn)
|
||||
rtx insn;
|
||||
pc_set (rtx insn)
|
||||
{
|
||||
rtx pat;
|
||||
if (GET_CODE (insn) != JUMP_INSN)
|
||||
@ -1161,8 +1137,7 @@ pc_set (insn)
|
||||
possibly bundled inside a PARALLEL. */
|
||||
|
||||
int
|
||||
any_uncondjump_p (insn)
|
||||
rtx insn;
|
||||
any_uncondjump_p (rtx insn)
|
||||
{
|
||||
rtx x = pc_set (insn);
|
||||
if (!x)
|
||||
@ -1180,8 +1155,7 @@ any_uncondjump_p (insn)
|
||||
Note that unlike condjump_p it returns false for unconditional jumps. */
|
||||
|
||||
int
|
||||
any_condjump_p (insn)
|
||||
rtx insn;
|
||||
any_condjump_p (rtx insn)
|
||||
{
|
||||
rtx x = pc_set (insn);
|
||||
enum rtx_code a, b;
|
||||
@ -1201,8 +1175,7 @@ any_condjump_p (insn)
|
||||
/* Return the label of a conditional jump. */
|
||||
|
||||
rtx
|
||||
condjump_label (insn)
|
||||
rtx insn;
|
||||
condjump_label (rtx insn)
|
||||
{
|
||||
rtx x = pc_set (insn);
|
||||
|
||||
@ -1223,9 +1196,7 @@ condjump_label (insn)
|
||||
/* Return true if INSN is a (possibly conditional) return insn. */
|
||||
|
||||
static int
|
||||
returnjump_p_1 (loc, data)
|
||||
rtx *loc;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
returnjump_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
rtx x = *loc;
|
||||
|
||||
@ -1234,8 +1205,7 @@ returnjump_p_1 (loc, data)
|
||||
}
|
||||
|
||||
int
|
||||
returnjump_p (insn)
|
||||
rtx insn;
|
||||
returnjump_p (rtx insn)
|
||||
{
|
||||
if (GET_CODE (insn) != JUMP_INSN)
|
||||
return 0;
|
||||
@ -1246,8 +1216,7 @@ returnjump_p (insn)
|
||||
nothing more. */
|
||||
|
||||
int
|
||||
onlyjump_p (insn)
|
||||
rtx insn;
|
||||
onlyjump_p (rtx insn)
|
||||
{
|
||||
rtx set;
|
||||
|
||||
@ -1271,8 +1240,7 @@ onlyjump_p (insn)
|
||||
and has no side effects. */
|
||||
|
||||
int
|
||||
only_sets_cc0_p (x)
|
||||
rtx x;
|
||||
only_sets_cc0_p (rtx x)
|
||||
{
|
||||
if (! x)
|
||||
return 0;
|
||||
@ -1289,8 +1257,7 @@ only_sets_cc0_p (x)
|
||||
but also does other things. */
|
||||
|
||||
int
|
||||
sets_cc0_p (x)
|
||||
rtx x;
|
||||
sets_cc0_p (rtx x)
|
||||
{
|
||||
if (! x)
|
||||
return 0;
|
||||
@ -1329,8 +1296,7 @@ sets_cc0_p (x)
|
||||
a USE or CLOBBER. */
|
||||
|
||||
rtx
|
||||
follow_jumps (label)
|
||||
rtx label;
|
||||
follow_jumps (rtx label)
|
||||
{
|
||||
rtx insn;
|
||||
rtx next;
|
||||
@ -1393,10 +1359,7 @@ follow_jumps (label)
|
||||
that loop-optimization is done with. */
|
||||
|
||||
void
|
||||
mark_jump_label (x, insn, in_mem)
|
||||
rtx x;
|
||||
rtx insn;
|
||||
int in_mem;
|
||||
mark_jump_label (rtx x, rtx insn, int in_mem)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
int i;
|
||||
@ -1501,8 +1464,7 @@ mark_jump_label (x, insn, in_mem)
|
||||
if that's what the previous thing was. */
|
||||
|
||||
void
|
||||
delete_jump (insn)
|
||||
rtx insn;
|
||||
delete_jump (rtx insn)
|
||||
{
|
||||
rtx set = single_set (insn);
|
||||
|
||||
@ -1513,8 +1475,7 @@ delete_jump (insn)
|
||||
/* Verify INSN is a BARRIER and delete it. */
|
||||
|
||||
void
|
||||
delete_barrier (insn)
|
||||
rtx insn;
|
||||
delete_barrier (rtx insn)
|
||||
{
|
||||
if (GET_CODE (insn) != BARRIER)
|
||||
abort ();
|
||||
@ -1527,9 +1488,7 @@ delete_barrier (insn)
|
||||
which is a REG_DEAD note associated with INSN. */
|
||||
|
||||
static void
|
||||
delete_prior_computation (note, insn)
|
||||
rtx note;
|
||||
rtx insn;
|
||||
delete_prior_computation (rtx note, rtx insn)
|
||||
{
|
||||
rtx our_prev;
|
||||
rtx reg = XEXP (note, 0);
|
||||
@ -1655,8 +1614,7 @@ delete_prior_computation (note, insn)
|
||||
delete the insn that set it. */
|
||||
|
||||
static void
|
||||
delete_computation (insn)
|
||||
rtx insn;
|
||||
delete_computation (rtx insn)
|
||||
{
|
||||
rtx note, next;
|
||||
|
||||
@ -1708,8 +1666,7 @@ delete_computation (insn)
|
||||
subsequent cfg_cleanup pass to delete unreachable code if needed. */
|
||||
|
||||
rtx
|
||||
delete_related_insns (insn)
|
||||
rtx insn;
|
||||
delete_related_insns (rtx insn)
|
||||
{
|
||||
int was_code_label = (GET_CODE (insn) == CODE_LABEL);
|
||||
rtx note;
|
||||
@ -1837,8 +1794,7 @@ delete_related_insns (insn)
|
||||
peephole insn that will replace them. */
|
||||
|
||||
void
|
||||
delete_for_peephole (from, to)
|
||||
rtx from, to;
|
||||
delete_for_peephole (rtx from, rtx to)
|
||||
{
|
||||
rtx insn = from;
|
||||
|
||||
@ -1882,8 +1838,7 @@ delete_for_peephole (from, to)
|
||||
spurious warnings from this. */
|
||||
|
||||
void
|
||||
never_reached_warning (avoided_insn, finish)
|
||||
rtx avoided_insn, finish;
|
||||
never_reached_warning (rtx avoided_insn, rtx finish)
|
||||
{
|
||||
rtx insn;
|
||||
rtx a_line_note = NULL;
|
||||
@ -1946,10 +1901,7 @@ never_reached_warning (avoided_insn, finish)
|
||||
NLABEL as a return. Accrue modifications into the change group. */
|
||||
|
||||
static void
|
||||
redirect_exp_1 (loc, olabel, nlabel, insn)
|
||||
rtx *loc;
|
||||
rtx olabel, nlabel;
|
||||
rtx insn;
|
||||
redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn)
|
||||
{
|
||||
rtx x = *loc;
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
@ -2004,9 +1956,7 @@ redirect_exp_1 (loc, olabel, nlabel, insn)
|
||||
/* Similar, but apply the change group and report success or failure. */
|
||||
|
||||
static int
|
||||
redirect_exp (olabel, nlabel, insn)
|
||||
rtx olabel, nlabel;
|
||||
rtx insn;
|
||||
redirect_exp (rtx olabel, rtx nlabel, rtx insn)
|
||||
{
|
||||
rtx *loc;
|
||||
|
||||
@ -2027,8 +1977,7 @@ redirect_exp (olabel, nlabel, insn)
|
||||
not see how to do that. */
|
||||
|
||||
int
|
||||
redirect_jump_1 (jump, nlabel)
|
||||
rtx jump, nlabel;
|
||||
redirect_jump_1 (rtx jump, rtx nlabel)
|
||||
{
|
||||
int ochanges = num_validated_changes ();
|
||||
rtx *loc;
|
||||
@ -2053,9 +2002,7 @@ redirect_jump_1 (jump, nlabel)
|
||||
(this can only occur for NLABEL == 0). */
|
||||
|
||||
int
|
||||
redirect_jump (jump, nlabel, delete_unused)
|
||||
rtx jump, nlabel;
|
||||
int delete_unused;
|
||||
redirect_jump (rtx jump, rtx nlabel, int delete_unused)
|
||||
{
|
||||
rtx olabel = JUMP_LABEL (jump);
|
||||
rtx note;
|
||||
@ -2113,8 +2060,7 @@ redirect_jump (jump, nlabel, delete_unused)
|
||||
Accrue the modifications into the change group. */
|
||||
|
||||
static void
|
||||
invert_exp_1 (insn)
|
||||
rtx insn;
|
||||
invert_exp_1 (rtx insn)
|
||||
{
|
||||
RTX_CODE code;
|
||||
rtx x = pc_set (insn);
|
||||
@ -2162,8 +2108,7 @@ invert_exp_1 (insn)
|
||||
matches a pattern. */
|
||||
|
||||
static int
|
||||
invert_exp (insn)
|
||||
rtx insn;
|
||||
invert_exp (rtx insn)
|
||||
{
|
||||
invert_exp_1 (insn);
|
||||
if (num_validated_changes () == 0)
|
||||
@ -2178,8 +2123,7 @@ invert_exp (insn)
|
||||
inversion and redirection. */
|
||||
|
||||
int
|
||||
invert_jump_1 (jump, nlabel)
|
||||
rtx jump, nlabel;
|
||||
invert_jump_1 (rtx jump, rtx nlabel)
|
||||
{
|
||||
int ochanges;
|
||||
|
||||
@ -2195,9 +2139,7 @@ invert_jump_1 (jump, nlabel)
|
||||
NLABEL instead of where it jumps now. Return true if successful. */
|
||||
|
||||
int
|
||||
invert_jump (jump, nlabel, delete_unused)
|
||||
rtx jump, nlabel;
|
||||
int delete_unused;
|
||||
invert_jump (rtx jump, rtx nlabel, int delete_unused)
|
||||
{
|
||||
/* We have to either invert the condition and change the label or
|
||||
do neither. Either operation could fail. We first try to invert
|
||||
@ -2241,8 +2183,7 @@ invert_jump (jump, nlabel, delete_unused)
|
||||
case when the PLUS is inside a MEM. */
|
||||
|
||||
int
|
||||
rtx_renumbered_equal_p (x, y)
|
||||
rtx x, y;
|
||||
rtx_renumbered_equal_p (rtx x, rtx y)
|
||||
{
|
||||
int i;
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
@ -2429,8 +2370,7 @@ rtx_renumbered_equal_p (x, y)
|
||||
return -1. Any rtx is valid for X. */
|
||||
|
||||
int
|
||||
true_regnum (x)
|
||||
rtx x;
|
||||
true_regnum (rtx x)
|
||||
{
|
||||
if (GET_CODE (x) == REG)
|
||||
{
|
||||
@ -2451,8 +2391,7 @@ true_regnum (x)
|
||||
|
||||
/* Return regno of the register REG and handle subregs too. */
|
||||
unsigned int
|
||||
reg_or_subregno (reg)
|
||||
rtx reg;
|
||||
reg_or_subregno (rtx reg)
|
||||
{
|
||||
if (REG_P (reg))
|
||||
return REGNO (reg);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Default macros to initialize the lang_hooks data structure.
|
||||
Copyright 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
Contributed by Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
This file is part of GCC.
|
||||
@ -28,7 +28,7 @@ struct diagnostic_context;
|
||||
|
||||
/* Provide a hook routine for alias sets that always returns 1. This is
|
||||
used by languages that haven't deal with alias sets yet. */
|
||||
extern HOST_WIDE_INT hook_get_alias_set_0 PARAMS ((tree));
|
||||
extern HOST_WIDE_INT hook_get_alias_set_0 (tree);
|
||||
|
||||
/* Note to creators of new hooks:
|
||||
|
||||
@ -39,50 +39,48 @@ extern HOST_WIDE_INT hook_get_alias_set_0 PARAMS ((tree));
|
||||
|
||||
/* See langhooks.h for the definition and documentation of each hook. */
|
||||
|
||||
extern void lhd_do_nothing PARAMS ((void));
|
||||
extern void lhd_do_nothing_t PARAMS ((tree));
|
||||
extern void lhd_do_nothing_i PARAMS ((int));
|
||||
extern void lhd_do_nothing_f PARAMS ((struct function *));
|
||||
extern bool lhd_post_options PARAMS ((const char **));
|
||||
extern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree));
|
||||
extern tree lhd_return_tree PARAMS ((tree));
|
||||
extern tree lhd_return_null_tree PARAMS ((tree));
|
||||
extern int lhd_safe_from_p PARAMS ((rtx, tree));
|
||||
extern int lhd_staticp PARAMS ((tree));
|
||||
extern int lhd_unsafe_for_reeval PARAMS ((tree));
|
||||
extern void lhd_clear_binding_stack PARAMS ((void));
|
||||
extern void lhd_print_tree_nothing PARAMS ((FILE *, tree, int));
|
||||
extern const char *lhd_decl_printable_name PARAMS ((tree, int));
|
||||
extern rtx lhd_expand_expr PARAMS ((tree, rtx, enum machine_mode, int));
|
||||
extern void lhd_print_error_function PARAMS ((struct diagnostic_context *,
|
||||
const char *));
|
||||
extern void lhd_set_decl_assembler_name PARAMS ((tree));
|
||||
extern bool lhd_can_use_bit_fields_p PARAMS ((void));
|
||||
extern bool lhd_warn_unused_global_decl PARAMS ((tree));
|
||||
extern void lhd_incomplete_type_error PARAMS ((tree, tree));
|
||||
extern tree lhd_type_promotes_to PARAMS ((tree));
|
||||
extern bool lhd_decl_ok_for_sibcall PARAMS ((tree));
|
||||
extern tree lhd_expr_size PARAMS ((tree));
|
||||
extern size_t lhd_tree_size PARAMS ((enum tree_code));
|
||||
extern void lhd_do_nothing (void);
|
||||
extern void lhd_do_nothing_t (tree);
|
||||
extern void lhd_do_nothing_i (int);
|
||||
extern void lhd_do_nothing_f (struct function *);
|
||||
extern bool lhd_post_options (const char **);
|
||||
extern HOST_WIDE_INT lhd_get_alias_set (tree);
|
||||
extern tree lhd_return_tree (tree);
|
||||
extern tree lhd_return_null_tree (tree);
|
||||
extern int lhd_safe_from_p (rtx, tree);
|
||||
extern int lhd_staticp (tree);
|
||||
extern int lhd_unsafe_for_reeval (tree);
|
||||
extern void lhd_clear_binding_stack (void);
|
||||
extern void lhd_print_tree_nothing (FILE *, tree, int);
|
||||
extern const char *lhd_decl_printable_name (tree, int);
|
||||
extern rtx lhd_expand_expr (tree, rtx, enum machine_mode, int);
|
||||
extern void lhd_print_error_function (struct diagnostic_context *,
|
||||
const char *);
|
||||
extern void lhd_set_decl_assembler_name (tree);
|
||||
extern bool lhd_can_use_bit_fields_p (void);
|
||||
extern bool lhd_warn_unused_global_decl (tree);
|
||||
extern void lhd_incomplete_type_error (tree, tree);
|
||||
extern tree lhd_type_promotes_to (tree);
|
||||
extern bool lhd_decl_ok_for_sibcall (tree);
|
||||
extern tree lhd_expr_size (tree);
|
||||
extern size_t lhd_tree_size (enum tree_code);
|
||||
|
||||
/* Declarations of default tree inlining hooks. */
|
||||
tree lhd_tree_inlining_walk_subtrees PARAMS ((tree *, int *,
|
||||
walk_tree_fn,
|
||||
void *, void *));
|
||||
int lhd_tree_inlining_cannot_inline_tree_fn PARAMS ((tree *));
|
||||
int lhd_tree_inlining_disregard_inline_limits PARAMS ((tree));
|
||||
tree lhd_tree_inlining_add_pending_fn_decls PARAMS ((void *, tree));
|
||||
int lhd_tree_inlining_tree_chain_matters_p PARAMS ((tree));
|
||||
int lhd_tree_inlining_auto_var_in_fn_p PARAMS ((tree, tree));
|
||||
tree lhd_tree_inlining_copy_res_decl_for_inlining PARAMS ((tree, tree,
|
||||
tree, void *,
|
||||
int *, tree));
|
||||
int lhd_tree_inlining_anon_aggr_type_p PARAMS ((tree));
|
||||
int lhd_tree_inlining_start_inlining PARAMS ((tree));
|
||||
void lhd_tree_inlining_end_inlining PARAMS ((tree));
|
||||
tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
|
||||
extern tree lhd_tree_inlining_walk_subtrees (tree *, int *, walk_tree_fn,
|
||||
void *, void *);
|
||||
extern int lhd_tree_inlining_cannot_inline_tree_fn (tree *);
|
||||
extern int lhd_tree_inlining_disregard_inline_limits (tree);
|
||||
extern tree lhd_tree_inlining_add_pending_fn_decls (void *, tree);
|
||||
extern int lhd_tree_inlining_tree_chain_matters_p (tree);
|
||||
extern int lhd_tree_inlining_auto_var_in_fn_p (tree, tree);
|
||||
extern tree lhd_tree_inlining_copy_res_decl_for_inlining (tree, tree, tree,
|
||||
void *, int *, tree);
|
||||
extern int lhd_tree_inlining_anon_aggr_type_p (tree);
|
||||
extern int lhd_tree_inlining_start_inlining (tree);
|
||||
extern void lhd_tree_inlining_end_inlining (tree);
|
||||
extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree);
|
||||
|
||||
void write_global_declarations PARAMS ((void));
|
||||
extern void write_global_declarations (void);
|
||||
|
||||
#define LANG_HOOKS_NAME "GNU unknown"
|
||||
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
|
||||
@ -184,8 +182,8 @@ void write_global_declarations PARAMS ((void));
|
||||
}
|
||||
|
||||
/* Tree dump hooks. */
|
||||
bool lhd_tree_dump_dump_tree PARAMS ((void *, tree));
|
||||
int lhd_tree_dump_type_quals PARAMS ((tree));
|
||||
extern bool lhd_tree_dump_dump_tree (void *, tree);
|
||||
extern int lhd_tree_dump_type_quals (tree);
|
||||
|
||||
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN lhd_tree_dump_dump_tree
|
||||
#define LANG_HOOKS_TREE_DUMP_TYPE_QUALS_FN lhd_tree_dump_type_quals
|
||||
|
144
gcc/langhooks.c
144
gcc/langhooks.c
@ -1,5 +1,5 @@
|
||||
/* Default language-specific hooks.
|
||||
Copyright 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
Contributed by Alexandre Oliva <aoliva@redhat.com>
|
||||
|
||||
This file is part of GCC.
|
||||
@ -36,39 +36,35 @@ Boston, MA 02111-1307, USA. */
|
||||
/* Do nothing; in many cases the default hook. */
|
||||
|
||||
void
|
||||
lhd_do_nothing ()
|
||||
lhd_do_nothing (void)
|
||||
{
|
||||
}
|
||||
|
||||
/* Do nothing (tree). */
|
||||
|
||||
void
|
||||
lhd_do_nothing_t (t)
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
lhd_do_nothing_t (tree t ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
/* Do nothing (int). */
|
||||
|
||||
void
|
||||
lhd_do_nothing_i (i)
|
||||
int i ATTRIBUTE_UNUSED;
|
||||
lhd_do_nothing_i (int i ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
/* Do nothing (function). */
|
||||
|
||||
void
|
||||
lhd_do_nothing_f (f)
|
||||
struct function *f ATTRIBUTE_UNUSED;
|
||||
lhd_do_nothing_f (struct function *f ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
/* Do nothing (return the tree node passed). */
|
||||
|
||||
tree
|
||||
lhd_return_tree (t)
|
||||
tree t;
|
||||
lhd_return_tree (tree t)
|
||||
{
|
||||
return t;
|
||||
}
|
||||
@ -76,8 +72,7 @@ lhd_return_tree (t)
|
||||
/* Do nothing (return NULL_TREE). */
|
||||
|
||||
tree
|
||||
lhd_return_null_tree (t)
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
lhd_return_null_tree (tree t ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return NULL_TREE;
|
||||
}
|
||||
@ -85,8 +80,7 @@ lhd_return_null_tree (t)
|
||||
/* The default post options hook. */
|
||||
|
||||
bool
|
||||
lhd_post_options (pfilename)
|
||||
const char **pfilename ATTRIBUTE_UNUSED;
|
||||
lhd_post_options (const char **pfilename ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -94,19 +88,16 @@ lhd_post_options (pfilename)
|
||||
/* Called from by print-tree.c. */
|
||||
|
||||
void
|
||||
lhd_print_tree_nothing (file, node, indent)
|
||||
FILE *file ATTRIBUTE_UNUSED;
|
||||
tree node ATTRIBUTE_UNUSED;
|
||||
int indent ATTRIBUTE_UNUSED;
|
||||
lhd_print_tree_nothing (FILE *file ATTRIBUTE_UNUSED,
|
||||
tree node ATTRIBUTE_UNUSED,
|
||||
int indent ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
/* Called from safe_from_p. */
|
||||
|
||||
int
|
||||
lhd_safe_from_p (x, exp)
|
||||
rtx x ATTRIBUTE_UNUSED;
|
||||
tree exp ATTRIBUTE_UNUSED;
|
||||
lhd_safe_from_p (rtx x ATTRIBUTE_UNUSED, tree exp ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@ -114,8 +105,7 @@ lhd_safe_from_p (x, exp)
|
||||
/* Called from unsafe_for_reeval. */
|
||||
|
||||
int
|
||||
lhd_unsafe_for_reeval (t)
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
lhd_unsafe_for_reeval (tree t ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@ -123,8 +113,7 @@ lhd_unsafe_for_reeval (t)
|
||||
/* Called from staticp. */
|
||||
|
||||
int
|
||||
lhd_staticp (exp)
|
||||
tree exp ATTRIBUTE_UNUSED;
|
||||
lhd_staticp (tree exp ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -132,8 +121,7 @@ lhd_staticp (exp)
|
||||
/* Called from check_global_declarations. */
|
||||
|
||||
bool
|
||||
lhd_warn_unused_global_decl (decl)
|
||||
tree decl;
|
||||
lhd_warn_unused_global_decl (tree decl)
|
||||
{
|
||||
/* This is what used to exist in check_global_declarations. Probably
|
||||
not many of these actually apply to non-C languages. */
|
||||
@ -150,8 +138,7 @@ lhd_warn_unused_global_decl (decl)
|
||||
|
||||
/* Set the DECL_ASSEMBLER_NAME for DECL. */
|
||||
void
|
||||
lhd_set_decl_assembler_name (decl)
|
||||
tree decl;
|
||||
lhd_set_decl_assembler_name (tree decl)
|
||||
{
|
||||
/* The language-independent code should never use the
|
||||
DECL_ASSEMBLER_NAME for lots of DECLs. Only FUNCTION_DECLs and
|
||||
@ -177,7 +164,7 @@ lhd_set_decl_assembler_name (decl)
|
||||
|
||||
/* By default we always allow bit-field based optimizations. */
|
||||
bool
|
||||
lhd_can_use_bit_fields_p ()
|
||||
lhd_can_use_bit_fields_p (void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -185,7 +172,7 @@ lhd_can_use_bit_fields_p ()
|
||||
/* Provide a default routine to clear the binding stack. This is used
|
||||
by languages that don't need to do anything special. */
|
||||
void
|
||||
lhd_clear_binding_stack ()
|
||||
lhd_clear_binding_stack (void)
|
||||
{
|
||||
while (! (*lang_hooks.decls.global_bindings_p) ())
|
||||
poplevel (0, 0, 0);
|
||||
@ -193,16 +180,14 @@ lhd_clear_binding_stack ()
|
||||
|
||||
/* Type promotion for variable arguments. */
|
||||
tree
|
||||
lhd_type_promotes_to (type)
|
||||
tree type ATTRIBUTE_UNUSED;
|
||||
lhd_type_promotes_to (tree type ATTRIBUTE_UNUSED)
|
||||
{
|
||||
abort ();
|
||||
}
|
||||
|
||||
/* Invalid use of an incomplete type. */
|
||||
void
|
||||
lhd_incomplete_type_error (value, type)
|
||||
tree value ATTRIBUTE_UNUSED, type;
|
||||
lhd_incomplete_type_error (tree value ATTRIBUTE_UNUSED, tree type)
|
||||
{
|
||||
if (TREE_CODE (type) == ERROR_MARK)
|
||||
return;
|
||||
@ -214,8 +199,7 @@ lhd_incomplete_type_error (value, type)
|
||||
is used by languages that don't need to do anything special. */
|
||||
|
||||
HOST_WIDE_INT
|
||||
lhd_get_alias_set (t)
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
lhd_get_alias_set (tree t ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
@ -224,8 +208,7 @@ lhd_get_alias_set (t)
|
||||
used by languages that haven't deal with alias sets yet. */
|
||||
|
||||
HOST_WIDE_INT
|
||||
hook_get_alias_set_0 (t)
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
hook_get_alias_set_0 (tree t ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -233,11 +216,9 @@ hook_get_alias_set_0 (t)
|
||||
/* This is the default expand_expr function. */
|
||||
|
||||
rtx
|
||||
lhd_expand_expr (t, r, mm, em)
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
rtx r ATTRIBUTE_UNUSED;
|
||||
enum machine_mode mm ATTRIBUTE_UNUSED;
|
||||
int em ATTRIBUTE_UNUSED;
|
||||
lhd_expand_expr (tree t ATTRIBUTE_UNUSED, rtx r ATTRIBUTE_UNUSED,
|
||||
enum machine_mode mm ATTRIBUTE_UNUSED,
|
||||
int em ATTRIBUTE_UNUSED)
|
||||
{
|
||||
abort ();
|
||||
}
|
||||
@ -245,9 +226,7 @@ lhd_expand_expr (t, r, mm, em)
|
||||
/* This is the default decl_printable_name function. */
|
||||
|
||||
const char *
|
||||
lhd_decl_printable_name (decl, verbosity)
|
||||
tree decl;
|
||||
int verbosity ATTRIBUTE_UNUSED;
|
||||
lhd_decl_printable_name (tree decl, int verbosity ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return IDENTIFIER_POINTER (DECL_NAME (decl));
|
||||
}
|
||||
@ -264,12 +243,11 @@ lhd_decl_printable_name (decl, verbosity)
|
||||
when the function is called. */
|
||||
|
||||
tree
|
||||
lhd_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab)
|
||||
tree *tp ATTRIBUTE_UNUSED;
|
||||
int *subtrees ATTRIBUTE_UNUSED;
|
||||
walk_tree_fn func ATTRIBUTE_UNUSED;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
void *htab ATTRIBUTE_UNUSED;
|
||||
lhd_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED,
|
||||
int *subtrees ATTRIBUTE_UNUSED,
|
||||
walk_tree_fn func ATTRIBUTE_UNUSED,
|
||||
void *data ATTRIBUTE_UNUSED,
|
||||
void *htab ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return NULL_TREE;
|
||||
}
|
||||
@ -279,8 +257,7 @@ lhd_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab)
|
||||
inlining a given function. */
|
||||
|
||||
int
|
||||
lhd_tree_inlining_cannot_inline_tree_fn (fnp)
|
||||
tree *fnp;
|
||||
lhd_tree_inlining_cannot_inline_tree_fn (tree *fnp)
|
||||
{
|
||||
if (flag_really_no_inline
|
||||
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (*fnp)) == NULL)
|
||||
@ -294,8 +271,7 @@ lhd_tree_inlining_cannot_inline_tree_fn (fnp)
|
||||
if it would exceed inlining limits. */
|
||||
|
||||
int
|
||||
lhd_tree_inlining_disregard_inline_limits (fn)
|
||||
tree fn;
|
||||
lhd_tree_inlining_disregard_inline_limits (tree fn)
|
||||
{
|
||||
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
|
||||
return 1;
|
||||
@ -311,9 +287,7 @@ lhd_tree_inlining_disregard_inline_limits (fn)
|
||||
returned. */
|
||||
|
||||
tree
|
||||
lhd_tree_inlining_add_pending_fn_decls (vafnp, pfn)
|
||||
void *vafnp ATTRIBUTE_UNUSED;
|
||||
tree pfn;
|
||||
lhd_tree_inlining_add_pending_fn_decls (void *vafnp ATTRIBUTE_UNUSED, tree pfn)
|
||||
{
|
||||
return pfn;
|
||||
}
|
||||
@ -323,8 +297,7 @@ lhd_tree_inlining_add_pending_fn_decls (vafnp, pfn)
|
||||
whether it should be walked, copied and preserved across copies. */
|
||||
|
||||
int
|
||||
lhd_tree_inlining_tree_chain_matters_p (t)
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
lhd_tree_inlining_tree_chain_matters_p (tree t ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -333,8 +306,7 @@ lhd_tree_inlining_tree_chain_matters_p (t)
|
||||
whether VT is an automatic variable defined in function FT. */
|
||||
|
||||
int
|
||||
lhd_tree_inlining_auto_var_in_fn_p (var, fn)
|
||||
tree var, fn;
|
||||
lhd_tree_inlining_auto_var_in_fn_p (tree var, tree fn)
|
||||
{
|
||||
return (DECL_P (var) && DECL_CONTEXT (var) == fn
|
||||
&& (((TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == PARM_DECL)
|
||||
@ -353,12 +325,10 @@ lhd_tree_inlining_auto_var_in_fn_p (var, fn)
|
||||
match RES. */
|
||||
|
||||
tree
|
||||
lhd_tree_inlining_copy_res_decl_for_inlining (res, fn, caller,
|
||||
dm, ndp, return_slot_addr)
|
||||
tree res, fn, caller;
|
||||
void *dm ATTRIBUTE_UNUSED;
|
||||
int *ndp ATTRIBUTE_UNUSED;
|
||||
tree return_slot_addr ATTRIBUTE_UNUSED;
|
||||
lhd_tree_inlining_copy_res_decl_for_inlining (tree res, tree fn, tree caller,
|
||||
void *dm ATTRIBUTE_UNUSED,
|
||||
int *ndp ATTRIBUTE_UNUSED,
|
||||
tree return_slot_addr ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (return_slot_addr)
|
||||
return build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (return_slot_addr)),
|
||||
@ -372,8 +342,7 @@ lhd_tree_inlining_copy_res_decl_for_inlining (res, fn, caller,
|
||||
i.e., one whose members are in the same scope as the union itself. */
|
||||
|
||||
int
|
||||
lhd_tree_inlining_anon_aggr_type_p (t)
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
lhd_tree_inlining_anon_aggr_type_p (tree t ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -387,15 +356,13 @@ lhd_tree_inlining_anon_aggr_type_p (t)
|
||||
avoid infinite recursion. */
|
||||
|
||||
int
|
||||
lhd_tree_inlining_start_inlining (fn)
|
||||
tree fn ATTRIBUTE_UNUSED;
|
||||
lhd_tree_inlining_start_inlining (tree fn ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
lhd_tree_inlining_end_inlining (fn)
|
||||
tree fn ATTRIBUTE_UNUSED;
|
||||
lhd_tree_inlining_end_inlining (tree fn ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
|
||||
@ -403,10 +370,9 @@ lhd_tree_inlining_end_inlining (fn)
|
||||
language-specific conversion before assigning VALUE to PARM. */
|
||||
|
||||
tree
|
||||
lhd_tree_inlining_convert_parm_for_inlining (parm, value, fndecl)
|
||||
tree parm ATTRIBUTE_UNUSED;
|
||||
tree value;
|
||||
tree fndecl ATTRIBUTE_UNUSED;
|
||||
lhd_tree_inlining_convert_parm_for_inlining (tree parm ATTRIBUTE_UNUSED,
|
||||
tree value,
|
||||
tree fndecl ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
@ -416,9 +382,7 @@ lhd_tree_inlining_convert_parm_for_inlining (parm, value, fndecl)
|
||||
second argument. */
|
||||
|
||||
bool
|
||||
lhd_tree_dump_dump_tree (di, t)
|
||||
void *di ATTRIBUTE_UNUSED;
|
||||
tree t ATTRIBUTE_UNUSED;
|
||||
lhd_tree_dump_dump_tree (void *di ATTRIBUTE_UNUSED, tree t ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -427,8 +391,7 @@ lhd_tree_dump_dump_tree (di, t)
|
||||
language-specific way. */
|
||||
|
||||
int
|
||||
lhd_tree_dump_type_quals (t)
|
||||
tree t;
|
||||
lhd_tree_dump_type_quals (tree t)
|
||||
{
|
||||
return TYPE_QUALS (t);
|
||||
}
|
||||
@ -437,8 +400,7 @@ lhd_tree_dump_type_quals (t)
|
||||
in a language-specific way. Returns a tree for the size in bytes. */
|
||||
|
||||
tree
|
||||
lhd_expr_size (exp)
|
||||
tree exp;
|
||||
lhd_expr_size (tree exp)
|
||||
{
|
||||
if (TREE_CODE_CLASS (TREE_CODE (exp)) == 'd'
|
||||
&& DECL_SIZE_UNIT (exp) != 0)
|
||||
@ -451,8 +413,7 @@ lhd_expr_size (exp)
|
||||
which is a language-specific tree code in category 'x'. The
|
||||
default expects never to be called. */
|
||||
size_t
|
||||
lhd_tree_size (c)
|
||||
enum tree_code c ATTRIBUTE_UNUSED;
|
||||
lhd_tree_size (enum tree_code c ATTRIBUTE_UNUSED)
|
||||
{
|
||||
abort ();
|
||||
return 0;
|
||||
@ -462,8 +423,7 @@ lhd_tree_size (c)
|
||||
sibcall. */
|
||||
|
||||
bool
|
||||
lhd_decl_ok_for_sibcall (decl)
|
||||
tree decl ATTRIBUTE_UNUSED;
|
||||
lhd_decl_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -471,7 +431,7 @@ lhd_decl_ok_for_sibcall (decl)
|
||||
/* lang_hooks.decls.final_write_globals: perform final processing on
|
||||
global variables. */
|
||||
void
|
||||
write_global_declarations ()
|
||||
write_global_declarations (void)
|
||||
{
|
||||
/* Really define vars that have had only a tentative definition.
|
||||
Really output inline functions that must actually be callable
|
||||
|
154
gcc/langhooks.h
154
gcc/langhooks.h
@ -1,5 +1,5 @@
|
||||
/* The lang_hooks data structure.
|
||||
Copyright 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -26,45 +26,42 @@ Boston, MA 02111-1307, USA. */
|
||||
struct diagnostic_context;
|
||||
|
||||
/* A print hook for print_tree (). */
|
||||
typedef void (*lang_print_tree_hook) PARAMS ((FILE *, tree, int indent));
|
||||
typedef void (*lang_print_tree_hook) (FILE *, tree, int indent);
|
||||
|
||||
/* The following hooks are documented in langhooks.c. Must not be
|
||||
NULL. */
|
||||
|
||||
struct lang_hooks_for_tree_inlining
|
||||
{
|
||||
union tree_node *(*walk_subtrees) PARAMS ((union tree_node **, int *,
|
||||
union tree_node *(*)
|
||||
(union tree_node **,
|
||||
int *, void *),
|
||||
void *, void *));
|
||||
int (*cannot_inline_tree_fn) PARAMS ((union tree_node **));
|
||||
int (*disregard_inline_limits) PARAMS ((union tree_node *));
|
||||
union tree_node *(*add_pending_fn_decls) PARAMS ((void *,
|
||||
union tree_node *));
|
||||
int (*tree_chain_matters_p) PARAMS ((union tree_node *));
|
||||
int (*auto_var_in_fn_p) PARAMS ((union tree_node *, union tree_node *));
|
||||
union tree_node *(*copy_res_decl_for_inlining) PARAMS ((union tree_node *,
|
||||
union tree_node *,
|
||||
union tree_node *,
|
||||
void *, int *,
|
||||
tree));
|
||||
int (*anon_aggr_type_p) PARAMS ((union tree_node *));
|
||||
bool (*var_mod_type_p) PARAMS ((union tree_node *));
|
||||
int (*start_inlining) PARAMS ((union tree_node *));
|
||||
void (*end_inlining) PARAMS ((union tree_node *));
|
||||
union tree_node *(*convert_parm_for_inlining) PARAMS ((union tree_node *,
|
||||
union tree_node *,
|
||||
union tree_node *));
|
||||
union tree_node *(*walk_subtrees) (union tree_node **, int *,
|
||||
union tree_node *(*)
|
||||
(union tree_node **, int *, void *),
|
||||
void *, void *);
|
||||
int (*cannot_inline_tree_fn) (union tree_node **);
|
||||
int (*disregard_inline_limits) (union tree_node *);
|
||||
union tree_node *(*add_pending_fn_decls) (void *, union tree_node *);
|
||||
int (*tree_chain_matters_p) (union tree_node *);
|
||||
int (*auto_var_in_fn_p) (union tree_node *, union tree_node *);
|
||||
union tree_node *(*copy_res_decl_for_inlining) (union tree_node *,
|
||||
union tree_node *,
|
||||
union tree_node *,
|
||||
void *, int *, tree);
|
||||
int (*anon_aggr_type_p) (union tree_node *);
|
||||
bool (*var_mod_type_p) (union tree_node *);
|
||||
int (*start_inlining) (union tree_node *);
|
||||
void (*end_inlining) (union tree_node *);
|
||||
union tree_node *(*convert_parm_for_inlining) (union tree_node *,
|
||||
union tree_node *,
|
||||
union tree_node *);
|
||||
};
|
||||
|
||||
struct lang_hooks_for_callgraph
|
||||
{
|
||||
/* Function passed as argument is needed and will be compiled.
|
||||
Lower the representation so the calls are explicit. */
|
||||
void (*lower_function) PARAMS ((union tree_node *));
|
||||
void (*lower_function) (union tree_node *);
|
||||
/* Produce RTL for function passed as argument. */
|
||||
void (*expand_function) PARAMS ((union tree_node *));
|
||||
void (*expand_function) (union tree_node *);
|
||||
};
|
||||
|
||||
/* Lang hooks for management of language-specific data or status
|
||||
@ -72,16 +69,16 @@ struct lang_hooks_for_callgraph
|
||||
struct lang_hooks_for_functions
|
||||
{
|
||||
/* Called when entering a function. */
|
||||
void (*init) PARAMS ((struct function *));
|
||||
void (*init) (struct function *);
|
||||
|
||||
/* Called when leaving a function. */
|
||||
void (*final) PARAMS ((struct function *));
|
||||
void (*final) (struct function *);
|
||||
|
||||
/* Called when entering a nested function. */
|
||||
void (*enter_nested) PARAMS ((struct function *));
|
||||
void (*enter_nested) (struct function *);
|
||||
|
||||
/* Called when leaving a nested function. */
|
||||
void (*leave_nested) PARAMS ((struct function *));
|
||||
void (*leave_nested) (struct function *);
|
||||
};
|
||||
|
||||
/* The following hooks are used by tree-dump.c. */
|
||||
@ -90,10 +87,10 @@ struct lang_hooks_for_tree_dump
|
||||
{
|
||||
/* Dump language-specific parts of tree nodes. Returns nonzero if it
|
||||
does not want the usual dumping of the second argument. */
|
||||
bool (*dump_tree) PARAMS ((void *, tree));
|
||||
bool (*dump_tree) (void *, tree);
|
||||
|
||||
/* Determine type qualifiers in a language-specific way. */
|
||||
int (*type_quals) PARAMS ((tree));
|
||||
int (*type_quals) (tree);
|
||||
};
|
||||
|
||||
/* Hooks related to types. */
|
||||
@ -102,39 +99,39 @@ struct lang_hooks_for_types
|
||||
{
|
||||
/* Return a new type (with the indicated CODE), doing whatever
|
||||
language-specific processing is required. */
|
||||
tree (*make_type) PARAMS ((enum tree_code));
|
||||
tree (*make_type) (enum tree_code);
|
||||
|
||||
/* Given MODE and UNSIGNEDP, return a suitable type-tree with that
|
||||
mode. */
|
||||
tree (*type_for_mode) PARAMS ((enum machine_mode, int));
|
||||
tree (*type_for_mode) (enum machine_mode, int);
|
||||
|
||||
/* Given PRECISION and UNSIGNEDP, return a suitable type-tree for an
|
||||
integer type with at least that precision. */
|
||||
tree (*type_for_size) PARAMS ((unsigned, int));
|
||||
tree (*type_for_size) (unsigned, int);
|
||||
|
||||
/* Given an integer type T, return a type like T but unsigned.
|
||||
If T is unsigned, the value is T. */
|
||||
tree (*unsigned_type) PARAMS ((tree));
|
||||
tree (*unsigned_type) (tree);
|
||||
|
||||
/* Given an integer type T, return a type like T but signed.
|
||||
If T is signed, the value is T. */
|
||||
tree (*signed_type) PARAMS ((tree));
|
||||
tree (*signed_type) (tree);
|
||||
|
||||
/* Return a type the same as TYPE except unsigned or signed
|
||||
according to UNSIGNEDP. */
|
||||
tree (*signed_or_unsigned_type) PARAMS ((int, tree));
|
||||
tree (*signed_or_unsigned_type) (int, tree);
|
||||
|
||||
/* Given a type, apply default promotions to unnamed function
|
||||
arguments and return the new type. Return the same type if no
|
||||
change. Required by any language that supports variadic
|
||||
arguments. The default hook aborts. */
|
||||
tree (*type_promotes_to) PARAMS ((tree));
|
||||
tree (*type_promotes_to) (tree);
|
||||
|
||||
/* This routine is called in tree.c to print an error message for
|
||||
invalid use of an incomplete type. VALUE is the expression that
|
||||
was used (or 0 if that isn't known) and TYPE is the type that was
|
||||
invalid. */
|
||||
void (*incomplete_type_error) PARAMS ((tree value, tree type));
|
||||
void (*incomplete_type_error) (tree value, tree type);
|
||||
};
|
||||
|
||||
/* Language hooks related to decls and the symbol table. */
|
||||
@ -143,49 +140,49 @@ struct lang_hooks_for_decls
|
||||
{
|
||||
/* Enter a new lexical scope. Argument is always zero when called
|
||||
from outside the front end. */
|
||||
void (*pushlevel) PARAMS ((int));
|
||||
void (*pushlevel) (int);
|
||||
|
||||
/* Exit a lexical scope and return a BINDING for that scope.
|
||||
Takes three arguments:
|
||||
KEEP -- nonzero if there were declarations in this scope.
|
||||
REVERSE -- reverse the order of decls before returning them.
|
||||
FUNCTIONBODY -- nonzero if this level is the body of a function. */
|
||||
tree (*poplevel) PARAMS ((int, int, int));
|
||||
tree (*poplevel) (int, int, int);
|
||||
|
||||
/* Returns nonzero if we are in the global binding level. Ada
|
||||
returns -1 for an undocumented reason used in stor-layout.c. */
|
||||
int (*global_bindings_p) PARAMS ((void));
|
||||
int (*global_bindings_p) (void);
|
||||
|
||||
/* Insert BLOCK at the end of the list of subblocks of the
|
||||
current binding level. This is used when a BIND_EXPR is expanded,
|
||||
to handle the BLOCK node inside the BIND_EXPR. */
|
||||
void (*insert_block) PARAMS ((tree));
|
||||
void (*insert_block) (tree);
|
||||
|
||||
/* Set the BLOCK node for the current scope level. */
|
||||
void (*set_block) PARAMS ((tree));
|
||||
void (*set_block) (tree);
|
||||
|
||||
/* Function to add a decl to the current scope level. Takes one
|
||||
argument, a decl to add. Returns that decl, or, if the same
|
||||
symbol is already declared, may return a different decl for that
|
||||
name. */
|
||||
tree (*pushdecl) PARAMS ((tree));
|
||||
tree (*pushdecl) (tree);
|
||||
|
||||
/* Returns the chain of decls so far in the current scope level. */
|
||||
tree (*getdecls) PARAMS ((void));
|
||||
tree (*getdecls) (void);
|
||||
|
||||
/* Returns true when we should warn for an unused global DECL.
|
||||
We will already have checked that it has static binding. */
|
||||
bool (*warn_unused_global) PARAMS ((tree));
|
||||
bool (*warn_unused_global) (tree);
|
||||
|
||||
/* Obtain a list of globals and do final output on them at end
|
||||
of compilation */
|
||||
void (*final_write_globals) PARAMS ((void));
|
||||
void (*final_write_globals) (void);
|
||||
|
||||
/* Do necessary preparations before assemble_variable can proceed. */
|
||||
void (*prepare_assemble_variable) PARAMS ((tree));
|
||||
void (*prepare_assemble_variable) (tree);
|
||||
|
||||
/* True if this decl may be called via a sibcall. */
|
||||
bool (*ok_for_sibcall) PARAMS ((tree));
|
||||
bool (*ok_for_sibcall) (tree);
|
||||
};
|
||||
|
||||
/* Language-specific hooks. See langhooks-def.h for defaults. */
|
||||
@ -202,7 +199,7 @@ struct lang_hooks
|
||||
/* Determines the size of any language-specific 'x' or 'c' nodes.
|
||||
Since it is called from make_node, the only information available
|
||||
is the tree code. Expected to abort on unrecognized codes. */
|
||||
size_t (*tree_size) PARAMS ((enum tree_code));
|
||||
size_t (*tree_size) (enum tree_code);
|
||||
|
||||
/* The first callback made to the front end, for simple
|
||||
initialization needed before any calls to handle_option. Return
|
||||
@ -225,38 +222,38 @@ struct lang_hooks
|
||||
|
||||
Should return true to indicate that a compiler back-end is
|
||||
not required, such as with the -E option.
|
||||
|
||||
|
||||
If errorcount is nonzero after this call the compiler exits
|
||||
immediately and the finish hook is not called. */
|
||||
bool (*post_options) PARAMS ((const char **));
|
||||
bool (*post_options) (const char **);
|
||||
|
||||
/* Called after post_options to initialize the front end. Return
|
||||
false to indicate that no further compilation be performed, in
|
||||
which case the finish hook is called immediately. */
|
||||
bool (*init) PARAMS ((void));
|
||||
bool (*init) (void);
|
||||
|
||||
/* Called at the end of compilation, as a finalizer. */
|
||||
void (*finish) PARAMS ((void));
|
||||
void (*finish) (void);
|
||||
|
||||
/* Parses the entire file. The argument is nonzero to cause bison
|
||||
parsers to dump debugging information during parsing. */
|
||||
void (*parse_file) PARAMS ((int));
|
||||
void (*parse_file) (int);
|
||||
|
||||
/* Called immediately after parsing to clear the binding stack. */
|
||||
void (*clear_binding_stack) PARAMS ((void));
|
||||
void (*clear_binding_stack) (void);
|
||||
|
||||
/* Called to obtain the alias set to be used for an expression or type.
|
||||
Returns -1 if the language does nothing special for it. */
|
||||
HOST_WIDE_INT (*get_alias_set) PARAMS ((tree));
|
||||
HOST_WIDE_INT (*get_alias_set) (tree);
|
||||
|
||||
/* Called with an expression that is to be processed as a constant.
|
||||
Returns either the same expression or a language-independent
|
||||
constant equivalent to its input. */
|
||||
tree (*expand_constant) PARAMS ((tree));
|
||||
tree (*expand_constant) (tree);
|
||||
|
||||
/* Called by expand_expr for language-specific tree codes.
|
||||
Fourth argument is actually an enum expand_modifier. */
|
||||
rtx (*expand_expr) PARAMS ((tree, rtx, enum machine_mode, int));
|
||||
rtx (*expand_expr) (tree, rtx, enum machine_mode, int);
|
||||
|
||||
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical
|
||||
operation.
|
||||
@ -269,11 +266,11 @@ struct lang_hooks
|
||||
|
||||
The result should be an expression of boolean type (if not an
|
||||
error_mark_node). */
|
||||
tree (*truthvalue_conversion) PARAMS ((tree));
|
||||
tree (*truthvalue_conversion) (tree);
|
||||
|
||||
/* Possibly apply default attributes to a function (represented by
|
||||
a FUNCTION_DECL). */
|
||||
void (*insert_default_attributes) PARAMS ((tree));
|
||||
void (*insert_default_attributes) (tree);
|
||||
|
||||
/* Hook called by safe_from_p for language-specific tree codes. It is
|
||||
up to the language front-end to install a hook if it has any such
|
||||
@ -282,48 +279,48 @@ struct lang_hooks
|
||||
should not reexamine those pieces. This routine may recursively
|
||||
call safe_from_p; it should always pass `0' as the TOP_P
|
||||
parameter. */
|
||||
int (*safe_from_p) PARAMS ((rtx, tree));
|
||||
int (*safe_from_p) (rtx, tree);
|
||||
|
||||
/* Function to finish handling an incomplete decl at the end of
|
||||
compilation. Default hook is does nothing. */
|
||||
void (*finish_incomplete_decl) PARAMS ((tree));
|
||||
void (*finish_incomplete_decl) (tree);
|
||||
|
||||
/* Function used by unsafe_for_reeval. A non-negative number is
|
||||
returned directly from unsafe_for_reeval, a negative number falls
|
||||
through. The default hook returns a negative number. */
|
||||
int (*unsafe_for_reeval) PARAMS ((tree));
|
||||
int (*unsafe_for_reeval) (tree);
|
||||
|
||||
/* Mark EXP saying that we need to be able to take the address of
|
||||
it; it should not be allocated in a register. Return true if
|
||||
successful. */
|
||||
bool (*mark_addressable) PARAMS ((tree));
|
||||
bool (*mark_addressable) (tree);
|
||||
|
||||
/* Hook called by staticp for language-specific tree codes. */
|
||||
int (*staticp) PARAMS ((tree));
|
||||
int (*staticp) (tree);
|
||||
|
||||
/* Replace the DECL_LANG_SPECIFIC data, which may be NULL, of the
|
||||
DECL_NODE with a newly GC-allocated copy. */
|
||||
void (*dup_lang_specific_decl) PARAMS ((tree));
|
||||
void (*dup_lang_specific_decl) (tree);
|
||||
|
||||
/* Called before its argument, an UNSAVE_EXPR, is to be
|
||||
unsaved. Modify it in-place so that all the evaluate only once
|
||||
things are cleared out. */
|
||||
tree (*unsave_expr_now) PARAMS ((tree));
|
||||
tree (*unsave_expr_now) (tree);
|
||||
|
||||
/* Called by expand_expr to build and return the cleanup-expression
|
||||
for the passed TARGET_EXPR. Return NULL if there is none. */
|
||||
tree (*maybe_build_cleanup) PARAMS ((tree));
|
||||
tree (*maybe_build_cleanup) (tree);
|
||||
|
||||
/* Set the DECL_ASSEMBLER_NAME for a node. If it is the sort of
|
||||
thing that the assembler should talk about, set
|
||||
DECL_ASSEMBLER_NAME to an appropriate IDENTIFIER_NODE.
|
||||
Otherwise, set it to the ERROR_MARK_NODE to ensure that the
|
||||
assembler does not talk about it. */
|
||||
void (*set_decl_assembler_name) PARAMS ((tree));
|
||||
void (*set_decl_assembler_name) (tree);
|
||||
|
||||
/* Return nonzero if fold-const is free to use bit-field
|
||||
optimizations, for instance in fold_truthop(). */
|
||||
bool (*can_use_bit_fields_p) PARAMS ((void));
|
||||
bool (*can_use_bit_fields_p) (void);
|
||||
|
||||
/* Nonzero if TYPE_READONLY and TREE_READONLY should always be honored. */
|
||||
bool honor_readonly;
|
||||
@ -335,7 +332,7 @@ struct lang_hooks
|
||||
|
||||
/* The front end can add its own statistics to -fmem-report with
|
||||
this hook. It should output to stderr. */
|
||||
void (*print_statistics) PARAMS ((void));
|
||||
void (*print_statistics) (void);
|
||||
|
||||
/* Called by print_tree when there is a tree of class 'x' that it
|
||||
doesn't know how to display. */
|
||||
@ -353,17 +350,16 @@ struct lang_hooks
|
||||
necessary. 1: and scope information. 2: and any other
|
||||
information that might be interesting, such as function parameter
|
||||
types in C++. */
|
||||
const char *(*decl_printable_name) PARAMS ((tree decl, int verbosity));
|
||||
const char *(*decl_printable_name) (tree decl, int verbosity);
|
||||
|
||||
/* Called by report_error_function to print out function name. */
|
||||
void (*print_error_function) PARAMS ((struct diagnostic_context *,
|
||||
const char *));
|
||||
void (*print_error_function) (struct diagnostic_context *, const char *);
|
||||
|
||||
/* Called from expr_size to calculate the size of the value of an
|
||||
expression in a language-dependent way. Returns a tree for the size
|
||||
in bytes. A frontend can call lhd_expr_size to get the default
|
||||
semantics in cases that it doesn't want to handle specially. */
|
||||
tree (*expr_size) PARAMS ((tree));
|
||||
tree (*expr_size) (tree);
|
||||
|
||||
/* Pointers to machine-independent attribute tables, for front ends
|
||||
using attribs.c. If one is NULL, it is ignored. Respectively, a
|
||||
|
152
gcc/lcm.c
152
gcc/lcm.c
@ -1,5 +1,6 @@
|
||||
/* Generic partial redundancy elimination with lazy code motion support.
|
||||
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -70,32 +71,22 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#include "insn-attr.h"
|
||||
|
||||
/* Edge based LCM routines. */
|
||||
static void compute_antinout_edge PARAMS ((sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap *));
|
||||
static void compute_earliest PARAMS ((struct edge_list *, int,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *));
|
||||
static void compute_laterin PARAMS ((struct edge_list *, sbitmap *,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *));
|
||||
static void compute_insert_delete PARAMS ((struct edge_list *edge_list,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *));
|
||||
static void compute_antinout_edge (sbitmap *, sbitmap *, sbitmap *, sbitmap *);
|
||||
static void compute_earliest (struct edge_list *, int, sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap *, sbitmap *);
|
||||
static void compute_laterin (struct edge_list *, sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap *);
|
||||
static void compute_insert_delete (struct edge_list *edge_list, sbitmap *,
|
||||
sbitmap *, sbitmap *, sbitmap *, sbitmap *);
|
||||
|
||||
/* Edge based LCM routines on a reverse flowgraph. */
|
||||
static void compute_farthest PARAMS ((struct edge_list *, int,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap*, sbitmap *,
|
||||
sbitmap *));
|
||||
static void compute_nearerout PARAMS ((struct edge_list *, sbitmap *,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *));
|
||||
static void compute_rev_insert_delete PARAMS ((struct edge_list *edge_list,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *));
|
||||
static void compute_farthest (struct edge_list *, int, sbitmap *, sbitmap *,
|
||||
sbitmap*, sbitmap *, sbitmap *);
|
||||
static void compute_nearerout (struct edge_list *, sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap *);
|
||||
static void compute_rev_insert_delete (struct edge_list *edge_list, sbitmap *,
|
||||
sbitmap *, sbitmap *, sbitmap *,
|
||||
sbitmap *);
|
||||
|
||||
/* Edge based lcm routines. */
|
||||
|
||||
@ -104,11 +95,8 @@ static void compute_rev_insert_delete PARAMS ((struct edge_list *edge_list,
|
||||
Other than that, its pretty much identical to compute_antinout. */
|
||||
|
||||
static void
|
||||
compute_antinout_edge (antloc, transp, antin, antout)
|
||||
sbitmap *antloc;
|
||||
sbitmap *transp;
|
||||
sbitmap *antin;
|
||||
sbitmap *antout;
|
||||
compute_antinout_edge (sbitmap *antloc, sbitmap *transp, sbitmap *antin,
|
||||
sbitmap *antout)
|
||||
{
|
||||
basic_block bb;
|
||||
edge e;
|
||||
@ -189,10 +177,9 @@ compute_antinout_edge (antloc, transp, antin, antout)
|
||||
/* Compute the earliest vector for edge based lcm. */
|
||||
|
||||
static void
|
||||
compute_earliest (edge_list, n_exprs, antin, antout, avout, kill, earliest)
|
||||
struct edge_list *edge_list;
|
||||
int n_exprs;
|
||||
sbitmap *antin, *antout, *avout, *kill, *earliest;
|
||||
compute_earliest (struct edge_list *edge_list, int n_exprs, sbitmap *antin,
|
||||
sbitmap *antout, sbitmap *avout, sbitmap *kill,
|
||||
sbitmap *earliest)
|
||||
{
|
||||
sbitmap difference, temp_bitmap;
|
||||
int x, num_edges;
|
||||
@ -258,9 +245,8 @@ compute_earliest (edge_list, n_exprs, antin, antout, avout, kill, earliest)
|
||||
to compute it. */
|
||||
|
||||
static void
|
||||
compute_laterin (edge_list, earliest, antloc, later, laterin)
|
||||
struct edge_list *edge_list;
|
||||
sbitmap *earliest, *antloc, *later, *laterin;
|
||||
compute_laterin (struct edge_list *edge_list, sbitmap *earliest,
|
||||
sbitmap *antloc, sbitmap *later, sbitmap *laterin)
|
||||
{
|
||||
int num_edges, i;
|
||||
edge e;
|
||||
@ -361,10 +347,9 @@ compute_laterin (edge_list, earliest, antloc, later, laterin)
|
||||
/* Compute the insertion and deletion points for edge based LCM. */
|
||||
|
||||
static void
|
||||
compute_insert_delete (edge_list, antloc, later, laterin,
|
||||
insert, delete)
|
||||
struct edge_list *edge_list;
|
||||
sbitmap *antloc, *later, *laterin, *insert, *delete;
|
||||
compute_insert_delete (struct edge_list *edge_list, sbitmap *antloc,
|
||||
sbitmap *later, sbitmap *laterin, sbitmap *insert,
|
||||
sbitmap *delete)
|
||||
{
|
||||
int x;
|
||||
basic_block bb;
|
||||
@ -388,15 +373,9 @@ compute_insert_delete (edge_list, antloc, later, laterin,
|
||||
map the insert vector to what edge an expression should be inserted on. */
|
||||
|
||||
struct edge_list *
|
||||
pre_edge_lcm (file, n_exprs, transp, avloc, antloc, kill, insert, delete)
|
||||
FILE *file ATTRIBUTE_UNUSED;
|
||||
int n_exprs;
|
||||
sbitmap *transp;
|
||||
sbitmap *avloc;
|
||||
sbitmap *antloc;
|
||||
sbitmap *kill;
|
||||
sbitmap **insert;
|
||||
sbitmap **delete;
|
||||
pre_edge_lcm (FILE *file ATTRIBUTE_UNUSED, int n_exprs, sbitmap *transp,
|
||||
sbitmap *avloc, sbitmap *antloc, sbitmap *kill,
|
||||
sbitmap **insert, sbitmap **delete)
|
||||
{
|
||||
sbitmap *antin, *antout, *earliest;
|
||||
sbitmap *avin, *avout;
|
||||
@ -491,8 +470,8 @@ pre_edge_lcm (file, n_exprs, transp, avloc, antloc, kill, insert, delete)
|
||||
Return the number of passes we performed to iterate to a solution. */
|
||||
|
||||
void
|
||||
compute_available (avloc, kill, avout, avin)
|
||||
sbitmap *avloc, *kill, *avout, *avin;
|
||||
compute_available (sbitmap *avloc, sbitmap *kill, sbitmap *avout,
|
||||
sbitmap *avin)
|
||||
{
|
||||
edge e;
|
||||
basic_block *worklist, *qin, *qout, *qend, bb;
|
||||
@ -573,11 +552,9 @@ compute_available (avloc, kill, avout, avin)
|
||||
/* Compute the farthest vector for edge based lcm. */
|
||||
|
||||
static void
|
||||
compute_farthest (edge_list, n_exprs, st_avout, st_avin, st_antin,
|
||||
kill, farthest)
|
||||
struct edge_list *edge_list;
|
||||
int n_exprs;
|
||||
sbitmap *st_avout, *st_avin, *st_antin, *kill, *farthest;
|
||||
compute_farthest (struct edge_list *edge_list, int n_exprs,
|
||||
sbitmap *st_avout, sbitmap *st_avin, sbitmap *st_antin,
|
||||
sbitmap *kill, sbitmap *farthest)
|
||||
{
|
||||
sbitmap difference, temp_bitmap;
|
||||
int x, num_edges;
|
||||
@ -619,9 +596,8 @@ compute_farthest (edge_list, n_exprs, st_avout, st_avin, st_antin,
|
||||
implementation can be found before compute_laterin. */
|
||||
|
||||
static void
|
||||
compute_nearerout (edge_list, farthest, st_avloc, nearer, nearerout)
|
||||
struct edge_list *edge_list;
|
||||
sbitmap *farthest, *st_avloc, *nearer, *nearerout;
|
||||
compute_nearerout (struct edge_list *edge_list, sbitmap *farthest,
|
||||
sbitmap *st_avloc, sbitmap *nearer, sbitmap *nearerout)
|
||||
{
|
||||
int num_edges, i;
|
||||
edge e;
|
||||
@ -702,10 +678,9 @@ compute_nearerout (edge_list, farthest, st_avloc, nearer, nearerout)
|
||||
/* Compute the insertion and deletion points for edge based LCM. */
|
||||
|
||||
static void
|
||||
compute_rev_insert_delete (edge_list, st_avloc, nearer, nearerout,
|
||||
insert, delete)
|
||||
struct edge_list *edge_list;
|
||||
sbitmap *st_avloc, *nearer, *nearerout, *insert, *delete;
|
||||
compute_rev_insert_delete (struct edge_list *edge_list, sbitmap *st_avloc,
|
||||
sbitmap *nearer, sbitmap *nearerout,
|
||||
sbitmap *insert, sbitmap *delete)
|
||||
{
|
||||
int x;
|
||||
basic_block bb;
|
||||
@ -729,16 +704,9 @@ compute_rev_insert_delete (edge_list, st_avloc, nearer, nearerout,
|
||||
an expression should be inserted on. */
|
||||
|
||||
struct edge_list *
|
||||
pre_edge_rev_lcm (file, n_exprs, transp, st_avloc, st_antloc, kill,
|
||||
insert, delete)
|
||||
FILE *file ATTRIBUTE_UNUSED;
|
||||
int n_exprs;
|
||||
sbitmap *transp;
|
||||
sbitmap *st_avloc;
|
||||
sbitmap *st_antloc;
|
||||
sbitmap *kill;
|
||||
sbitmap **insert;
|
||||
sbitmap **delete;
|
||||
pre_edge_rev_lcm (FILE *file ATTRIBUTE_UNUSED, int n_exprs, sbitmap *transp,
|
||||
sbitmap *st_avloc, sbitmap *st_antloc, sbitmap *kill,
|
||||
sbitmap **insert, sbitmap **delete)
|
||||
{
|
||||
sbitmap *st_antin, *st_antout;
|
||||
sbitmap *st_avout, *st_avin, *farthest;
|
||||
@ -887,11 +855,11 @@ static sbitmap *comp;
|
||||
static sbitmap *delete;
|
||||
static sbitmap *insert;
|
||||
|
||||
static struct seginfo * new_seginfo PARAMS ((int, rtx, int, HARD_REG_SET));
|
||||
static void add_seginfo PARAMS ((struct bb_info *, struct seginfo *));
|
||||
static void reg_dies PARAMS ((rtx, HARD_REG_SET));
|
||||
static void reg_becomes_live PARAMS ((rtx, rtx, void *));
|
||||
static void make_preds_opaque PARAMS ((basic_block, int));
|
||||
static struct seginfo * new_seginfo (int, rtx, int, HARD_REG_SET);
|
||||
static void add_seginfo (struct bb_info *, struct seginfo *);
|
||||
static void reg_dies (rtx, HARD_REG_SET);
|
||||
static void reg_becomes_live (rtx, rtx, void *);
|
||||
static void make_preds_opaque (basic_block, int);
|
||||
#endif
|
||||
|
||||
#ifdef OPTIMIZE_MODE_SWITCHING
|
||||
@ -900,11 +868,7 @@ static void make_preds_opaque PARAMS ((basic_block, int));
|
||||
with the MODE, INSN, and basic block BB parameters. */
|
||||
|
||||
static struct seginfo *
|
||||
new_seginfo (mode, insn, bb, regs_live)
|
||||
int mode;
|
||||
rtx insn;
|
||||
int bb;
|
||||
HARD_REG_SET regs_live;
|
||||
new_seginfo (int mode, rtx insn, int bb, HARD_REG_SET regs_live)
|
||||
{
|
||||
struct seginfo *ptr;
|
||||
ptr = xmalloc (sizeof (struct seginfo));
|
||||
@ -921,9 +885,7 @@ new_seginfo (mode, insn, bb, regs_live)
|
||||
INFO is the structure to be linked in. */
|
||||
|
||||
static void
|
||||
add_seginfo (head, info)
|
||||
struct bb_info *head;
|
||||
struct seginfo *info;
|
||||
add_seginfo (struct bb_info *head, struct seginfo *info)
|
||||
{
|
||||
struct seginfo *ptr;
|
||||
|
||||
@ -945,9 +907,7 @@ add_seginfo (head, info)
|
||||
we are currently handling mode-switching for. */
|
||||
|
||||
static void
|
||||
make_preds_opaque (b, j)
|
||||
basic_block b;
|
||||
int j;
|
||||
make_preds_opaque (basic_block b, int j)
|
||||
{
|
||||
edge e;
|
||||
|
||||
@ -966,9 +926,7 @@ make_preds_opaque (b, j)
|
||||
/* Record in LIVE that register REG died. */
|
||||
|
||||
static void
|
||||
reg_dies (reg, live)
|
||||
rtx reg;
|
||||
HARD_REG_SET live;
|
||||
reg_dies (rtx reg, HARD_REG_SET live)
|
||||
{
|
||||
int regno, nregs;
|
||||
|
||||
@ -986,10 +944,7 @@ reg_dies (reg, live)
|
||||
This is called via note_stores. */
|
||||
|
||||
static void
|
||||
reg_becomes_live (reg, setter, live)
|
||||
rtx reg;
|
||||
rtx setter ATTRIBUTE_UNUSED;
|
||||
void *live;
|
||||
reg_becomes_live (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *live)
|
||||
{
|
||||
int regno, nregs;
|
||||
|
||||
@ -1010,8 +965,7 @@ reg_becomes_live (reg, setter, live)
|
||||
necessary mode switches. Return true if we did work. */
|
||||
|
||||
int
|
||||
optimize_mode_switching (file)
|
||||
FILE *file;
|
||||
optimize_mode_switching (FILE *file)
|
||||
{
|
||||
rtx insn;
|
||||
int e;
|
||||
|
@ -271,43 +271,40 @@ static struct equivalence *reg_equiv;
|
||||
/* Nonzero if we recorded an equivalence for a LABEL_REF. */
|
||||
static int recorded_label_ref;
|
||||
|
||||
static void alloc_qty PARAMS ((int, enum machine_mode, int, int));
|
||||
static void validate_equiv_mem_from_store PARAMS ((rtx, rtx, void *));
|
||||
static int validate_equiv_mem PARAMS ((rtx, rtx, rtx));
|
||||
static int equiv_init_varies_p PARAMS ((rtx));
|
||||
static int equiv_init_movable_p PARAMS ((rtx, int));
|
||||
static int contains_replace_regs PARAMS ((rtx));
|
||||
static int memref_referenced_p PARAMS ((rtx, rtx));
|
||||
static int memref_used_between_p PARAMS ((rtx, rtx, rtx));
|
||||
static void update_equiv_regs PARAMS ((void));
|
||||
static void no_equiv PARAMS ((rtx, rtx, void *));
|
||||
static void block_alloc PARAMS ((int));
|
||||
static int qty_sugg_compare PARAMS ((int, int));
|
||||
static int qty_sugg_compare_1 PARAMS ((const void *, const void *));
|
||||
static int qty_compare PARAMS ((int, int));
|
||||
static int qty_compare_1 PARAMS ((const void *, const void *));
|
||||
static int combine_regs PARAMS ((rtx, rtx, int, int, rtx, int));
|
||||
static int reg_meets_class_p PARAMS ((int, enum reg_class));
|
||||
static void update_qty_class PARAMS ((int, int));
|
||||
static void reg_is_set PARAMS ((rtx, rtx, void *));
|
||||
static void reg_is_born PARAMS ((rtx, int));
|
||||
static void wipe_dead_reg PARAMS ((rtx, int));
|
||||
static int find_free_reg PARAMS ((enum reg_class, enum machine_mode,
|
||||
int, int, int, int, int));
|
||||
static void mark_life PARAMS ((int, enum machine_mode, int));
|
||||
static void post_mark_life PARAMS ((int, enum machine_mode, int, int, int));
|
||||
static int no_conflict_p PARAMS ((rtx, rtx, rtx));
|
||||
static int requires_inout PARAMS ((const char *));
|
||||
static void alloc_qty (int, enum machine_mode, int, int);
|
||||
static void validate_equiv_mem_from_store (rtx, rtx, void *);
|
||||
static int validate_equiv_mem (rtx, rtx, rtx);
|
||||
static int equiv_init_varies_p (rtx);
|
||||
static int equiv_init_movable_p (rtx, int);
|
||||
static int contains_replace_regs (rtx);
|
||||
static int memref_referenced_p (rtx, rtx);
|
||||
static int memref_used_between_p (rtx, rtx, rtx);
|
||||
static void update_equiv_regs (void);
|
||||
static void no_equiv (rtx, rtx, void *);
|
||||
static void block_alloc (int);
|
||||
static int qty_sugg_compare (int, int);
|
||||
static int qty_sugg_compare_1 (const void *, const void *);
|
||||
static int qty_compare (int, int);
|
||||
static int qty_compare_1 (const void *, const void *);
|
||||
static int combine_regs (rtx, rtx, int, int, rtx, int);
|
||||
static int reg_meets_class_p (int, enum reg_class);
|
||||
static void update_qty_class (int, int);
|
||||
static void reg_is_set (rtx, rtx, void *);
|
||||
static void reg_is_born (rtx, int);
|
||||
static void wipe_dead_reg (rtx, int);
|
||||
static int find_free_reg (enum reg_class, enum machine_mode, int, int, int,
|
||||
int, int);
|
||||
static void mark_life (int, enum machine_mode, int);
|
||||
static void post_mark_life (int, enum machine_mode, int, int, int);
|
||||
static int no_conflict_p (rtx, rtx, rtx);
|
||||
static int requires_inout (const char *);
|
||||
|
||||
/* Allocate a new quantity (new within current basic block)
|
||||
for register number REGNO which is born at index BIRTH
|
||||
within the block. MODE and SIZE are info on reg REGNO. */
|
||||
|
||||
static void
|
||||
alloc_qty (regno, mode, size, birth)
|
||||
int regno;
|
||||
enum machine_mode mode;
|
||||
int size, birth;
|
||||
alloc_qty (int regno, enum machine_mode mode, int size, int birth)
|
||||
{
|
||||
int qtyno = next_qty++;
|
||||
|
||||
@ -329,7 +326,7 @@ alloc_qty (regno, mode, size, birth)
|
||||
/* Main entry point of this file. */
|
||||
|
||||
int
|
||||
local_alloc ()
|
||||
local_alloc (void)
|
||||
{
|
||||
int i;
|
||||
int max_qty;
|
||||
@ -449,10 +446,8 @@ static int equiv_mem_modified;
|
||||
Called via note_stores. */
|
||||
|
||||
static void
|
||||
validate_equiv_mem_from_store (dest, set, data)
|
||||
rtx dest;
|
||||
rtx set ATTRIBUTE_UNUSED;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
validate_equiv_mem_from_store (rtx dest, rtx set ATTRIBUTE_UNUSED,
|
||||
void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if ((GET_CODE (dest) == REG
|
||||
&& reg_overlap_mentioned_p (dest, equiv_mem))
|
||||
@ -469,10 +464,7 @@ validate_equiv_mem_from_store (dest, set, data)
|
||||
Return 1 if MEMREF remains valid. */
|
||||
|
||||
static int
|
||||
validate_equiv_mem (start, reg, memref)
|
||||
rtx start;
|
||||
rtx reg;
|
||||
rtx memref;
|
||||
validate_equiv_mem (rtx start, rtx reg, rtx memref)
|
||||
{
|
||||
rtx insn;
|
||||
rtx note;
|
||||
@ -518,8 +510,7 @@ validate_equiv_mem (start, reg, memref)
|
||||
/* Returns zero if X is known to be invariant. */
|
||||
|
||||
static int
|
||||
equiv_init_varies_p (x)
|
||||
rtx x;
|
||||
equiv_init_varies_p (rtx x)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
int i;
|
||||
@ -578,9 +569,7 @@ equiv_init_varies_p (x)
|
||||
or if they are not candidates for local_alloc and don't vary. */
|
||||
|
||||
static int
|
||||
equiv_init_movable_p (x, regno)
|
||||
rtx x;
|
||||
int regno;
|
||||
equiv_init_movable_p (rtx x, int regno)
|
||||
{
|
||||
int i, j;
|
||||
const char *fmt;
|
||||
@ -642,8 +631,7 @@ equiv_init_movable_p (x, regno)
|
||||
/* TRUE if X uses any registers for which reg_equiv[REGNO].replace is true. */
|
||||
|
||||
static int
|
||||
contains_replace_regs (x)
|
||||
rtx x;
|
||||
contains_replace_regs (rtx x)
|
||||
{
|
||||
int i, j;
|
||||
const char *fmt;
|
||||
@ -691,9 +679,7 @@ contains_replace_regs (x)
|
||||
to MEMREF. */
|
||||
|
||||
static int
|
||||
memref_referenced_p (memref, x)
|
||||
rtx x;
|
||||
rtx memref;
|
||||
memref_referenced_p (rtx memref, rtx x)
|
||||
{
|
||||
int i, j;
|
||||
const char *fmt;
|
||||
@ -762,10 +748,7 @@ memref_referenced_p (memref, x)
|
||||
that would be affected by a store to MEMREF. */
|
||||
|
||||
static int
|
||||
memref_used_between_p (memref, start, end)
|
||||
rtx memref;
|
||||
rtx start;
|
||||
rtx end;
|
||||
memref_used_between_p (rtx memref, rtx start, rtx end)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -785,8 +768,7 @@ memref_used_between_p (memref, start, end)
|
||||
go to spill these things to memory. */
|
||||
|
||||
int
|
||||
function_invariant_p (x)
|
||||
rtx x;
|
||||
function_invariant_p (rtx x)
|
||||
{
|
||||
if (CONSTANT_P (x))
|
||||
return 1;
|
||||
@ -808,7 +790,7 @@ function_invariant_p (x)
|
||||
completely. */
|
||||
|
||||
static void
|
||||
update_equiv_regs ()
|
||||
update_equiv_regs (void)
|
||||
{
|
||||
rtx insn;
|
||||
basic_block bb;
|
||||
@ -1186,9 +1168,7 @@ update_equiv_regs ()
|
||||
assignment - a SET, CLOBBER or REG_INC note. It is currently not used,
|
||||
but needs to be there because this function is called from note_stores. */
|
||||
static void
|
||||
no_equiv (reg, store, data)
|
||||
rtx reg, store ATTRIBUTE_UNUSED;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
no_equiv (rtx reg, rtx store ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int regno;
|
||||
rtx list;
|
||||
@ -1212,8 +1192,7 @@ no_equiv (reg, store, data)
|
||||
Only the pseudos that die but once can be handled. */
|
||||
|
||||
static void
|
||||
block_alloc (b)
|
||||
int b;
|
||||
block_alloc (int b)
|
||||
{
|
||||
int i, q;
|
||||
rtx insn;
|
||||
@ -1693,16 +1672,13 @@ block_alloc (b)
|
||||
/ (qty[q].death - qty[q].birth)) * (10000 / REG_FREQ_MAX)))
|
||||
|
||||
static int
|
||||
qty_compare (q1, q2)
|
||||
int q1, q2;
|
||||
qty_compare (int q1, int q2)
|
||||
{
|
||||
return QTY_CMP_PRI (q2) - QTY_CMP_PRI (q1);
|
||||
}
|
||||
|
||||
static int
|
||||
qty_compare_1 (q1p, q2p)
|
||||
const void *q1p;
|
||||
const void *q2p;
|
||||
qty_compare_1 (const void *q1p, const void *q2p)
|
||||
{
|
||||
int q1 = *(const int *) q1p, q2 = *(const int *) q2p;
|
||||
int tem = QTY_CMP_PRI (q2) - QTY_CMP_PRI (q1);
|
||||
@ -1728,8 +1704,7 @@ qty_compare_1 (q1p, q2p)
|
||||
: qty_phys_num_sugg[q] * FIRST_PSEUDO_REGISTER)
|
||||
|
||||
static int
|
||||
qty_sugg_compare (q1, q2)
|
||||
int q1, q2;
|
||||
qty_sugg_compare (int q1, int q2)
|
||||
{
|
||||
int tem = QTY_CMP_SUGG (q1) - QTY_CMP_SUGG (q2);
|
||||
|
||||
@ -1740,9 +1715,7 @@ qty_sugg_compare (q1, q2)
|
||||
}
|
||||
|
||||
static int
|
||||
qty_sugg_compare_1 (q1p, q2p)
|
||||
const void *q1p;
|
||||
const void *q2p;
|
||||
qty_sugg_compare_1 (const void *q1p, const void *q2p)
|
||||
{
|
||||
int q1 = *(const int *) q1p, q2 = *(const int *) q2p;
|
||||
int tem = QTY_CMP_SUGG (q1) - QTY_CMP_SUGG (q2);
|
||||
@ -1785,12 +1758,8 @@ qty_sugg_compare_1 (q1p, q2p)
|
||||
There are elaborate checks for the validity of combining. */
|
||||
|
||||
static int
|
||||
combine_regs (usedreg, setreg, may_save_copy, insn_number, insn, already_dead)
|
||||
rtx usedreg, setreg;
|
||||
int may_save_copy;
|
||||
int insn_number;
|
||||
rtx insn;
|
||||
int already_dead;
|
||||
combine_regs (rtx usedreg, rtx setreg, int may_save_copy, int insn_number,
|
||||
rtx insn, int already_dead)
|
||||
{
|
||||
int ureg, sreg;
|
||||
int offset = 0;
|
||||
@ -1999,9 +1968,7 @@ combine_regs (usedreg, setreg, may_save_copy, insn_number, insn, already_dead)
|
||||
True if REG's reg class either contains or is contained in CLASS. */
|
||||
|
||||
static int
|
||||
reg_meets_class_p (reg, class)
|
||||
int reg;
|
||||
enum reg_class class;
|
||||
reg_meets_class_p (int reg, enum reg_class class)
|
||||
{
|
||||
enum reg_class rclass = reg_preferred_class (reg);
|
||||
return (reg_class_subset_p (rclass, class)
|
||||
@ -2011,9 +1978,7 @@ reg_meets_class_p (reg, class)
|
||||
/* Update the class of QTYNO assuming that REG is being tied to it. */
|
||||
|
||||
static void
|
||||
update_qty_class (qtyno, reg)
|
||||
int qtyno;
|
||||
int reg;
|
||||
update_qty_class (int qtyno, int reg)
|
||||
{
|
||||
enum reg_class rclass = reg_preferred_class (reg);
|
||||
if (reg_class_subset_p (rclass, qty[qtyno].min_class))
|
||||
@ -2034,10 +1999,7 @@ update_qty_class (qtyno, reg)
|
||||
carry info from `block_alloc'. */
|
||||
|
||||
static void
|
||||
reg_is_set (reg, setter, data)
|
||||
rtx reg;
|
||||
rtx setter;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
reg_is_set (rtx reg, rtx setter, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
/* Note that note_stores will only pass us a SUBREG if it is a SUBREG of
|
||||
a hard register. These may actually not exist any more. */
|
||||
@ -2057,9 +2019,7 @@ reg_is_set (reg, setter, data)
|
||||
BIRTH is the index at which this is happening. */
|
||||
|
||||
static void
|
||||
reg_is_born (reg, birth)
|
||||
rtx reg;
|
||||
int birth;
|
||||
reg_is_born (rtx reg, int birth)
|
||||
{
|
||||
int regno;
|
||||
|
||||
@ -2098,9 +2058,7 @@ reg_is_born (reg, birth)
|
||||
If OUTPUT_P is 1, then we extend the life past the end of this insn. */
|
||||
|
||||
static void
|
||||
wipe_dead_reg (reg, output_p)
|
||||
rtx reg;
|
||||
int output_p;
|
||||
wipe_dead_reg (rtx reg, int output_p)
|
||||
{
|
||||
int regno = REGNO (reg);
|
||||
|
||||
@ -2165,14 +2123,9 @@ wipe_dead_reg (reg, output_p)
|
||||
register is available. If not, return -1. */
|
||||
|
||||
static int
|
||||
find_free_reg (class, mode, qtyno, accept_call_clobbered, just_try_suggested,
|
||||
born_index, dead_index)
|
||||
enum reg_class class;
|
||||
enum machine_mode mode;
|
||||
int qtyno;
|
||||
int accept_call_clobbered;
|
||||
int just_try_suggested;
|
||||
int born_index, dead_index;
|
||||
find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno,
|
||||
int accept_call_clobbered, int just_try_suggested,
|
||||
int born_index, int dead_index)
|
||||
{
|
||||
int i, ins;
|
||||
HARD_REG_SET first_used, used;
|
||||
@ -2318,10 +2271,7 @@ find_free_reg (class, mode, qtyno, accept_call_clobbered, just_try_suggested,
|
||||
is zero). */
|
||||
|
||||
static void
|
||||
mark_life (regno, mode, life)
|
||||
int regno;
|
||||
enum machine_mode mode;
|
||||
int life;
|
||||
mark_life (int regno, enum machine_mode mode, int life)
|
||||
{
|
||||
int j = HARD_REGNO_NREGS (regno, mode);
|
||||
if (life)
|
||||
@ -2337,10 +2287,8 @@ mark_life (regno, mode, life)
|
||||
to insn number DEATH (exclusive). */
|
||||
|
||||
static void
|
||||
post_mark_life (regno, mode, life, birth, death)
|
||||
int regno;
|
||||
enum machine_mode mode;
|
||||
int life, birth, death;
|
||||
post_mark_life (int regno, enum machine_mode mode, int life, int birth,
|
||||
int death)
|
||||
{
|
||||
int j = HARD_REGNO_NREGS (regno, mode);
|
||||
#ifdef HARD_REG_SET
|
||||
@ -2377,8 +2325,7 @@ post_mark_life (regno, mode, life, birth, death)
|
||||
Otherwise, return 0. */
|
||||
|
||||
static int
|
||||
no_conflict_p (insn, r0, r1)
|
||||
rtx insn, r0 ATTRIBUTE_UNUSED, r1;
|
||||
no_conflict_p (rtx insn, rtx r0 ATTRIBUTE_UNUSED, rtx r1)
|
||||
{
|
||||
int ok = 0;
|
||||
rtx note = find_reg_note (insn, REG_LIBCALL, NULL_RTX);
|
||||
@ -2418,8 +2365,7 @@ no_conflict_p (insn, r0, r1)
|
||||
is acceptable. */
|
||||
|
||||
static int
|
||||
requires_inout (p)
|
||||
const char *p;
|
||||
requires_inout (const char *p)
|
||||
{
|
||||
char c;
|
||||
int found_zero = 0;
|
||||
@ -2483,8 +2429,7 @@ requires_inout (p)
|
||||
}
|
||||
|
||||
void
|
||||
dump_local_alloc (file)
|
||||
FILE *file;
|
||||
dump_local_alloc (FILE *file)
|
||||
{
|
||||
int i;
|
||||
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
|
||||
|
@ -31,8 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
/* Initialize loop optimizer. */
|
||||
|
||||
struct loops *
|
||||
loop_optimizer_init (dumpfile)
|
||||
FILE *dumpfile;
|
||||
loop_optimizer_init (FILE *dumpfile)
|
||||
{
|
||||
struct loops *loops = xcalloc (1, sizeof (struct loops));
|
||||
edge e;
|
||||
@ -91,9 +90,7 @@ loop_optimizer_init (dumpfile)
|
||||
|
||||
/* Finalize loop optimizer. */
|
||||
void
|
||||
loop_optimizer_finalize (loops, dumpfile)
|
||||
struct loops *loops;
|
||||
FILE *dumpfile;
|
||||
loop_optimizer_finalize (struct loops *loops, FILE *dumpfile)
|
||||
{
|
||||
basic_block bb;
|
||||
|
||||
@ -109,7 +106,7 @@ loop_optimizer_finalize (loops, dumpfile)
|
||||
/* Clean up. */
|
||||
flow_loops_free (loops);
|
||||
free (loops);
|
||||
|
||||
|
||||
/* Finalize changes. */
|
||||
cfg_layout_finalize ();
|
||||
|
||||
@ -118,4 +115,3 @@ loop_optimizer_finalize (loops, dumpfile)
|
||||
verify_flow_info ();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Loop unrolling and peeling.
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -66,27 +66,25 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
showed that this choice may affect performance in order of several %.
|
||||
*/
|
||||
|
||||
static void decide_unrolling_and_peeling PARAMS ((struct loops *, int));
|
||||
static void peel_loops_completely PARAMS ((struct loops *, int));
|
||||
static void decide_peel_simple PARAMS ((struct loops *, struct loop *, int));
|
||||
static void decide_peel_once_rolling PARAMS ((struct loops *, struct loop *, int));
|
||||
static void decide_peel_completely PARAMS ((struct loops *, struct loop *, int));
|
||||
static void decide_unroll_stupid PARAMS ((struct loops *, struct loop *, int));
|
||||
static void decide_unroll_constant_iterations PARAMS ((struct loops *, struct loop *, int));
|
||||
static void decide_unroll_runtime_iterations PARAMS ((struct loops *, struct loop *, int));
|
||||
static void peel_loop_simple PARAMS ((struct loops *, struct loop *));
|
||||
static void peel_loop_completely PARAMS ((struct loops *, struct loop *));
|
||||
static void unroll_loop_stupid PARAMS ((struct loops *, struct loop *));
|
||||
static void unroll_loop_constant_iterations PARAMS ((struct loops *,
|
||||
struct loop *));
|
||||
static void unroll_loop_runtime_iterations PARAMS ((struct loops *,
|
||||
struct loop *));
|
||||
static void decide_unrolling_and_peeling (struct loops *, int);
|
||||
static void peel_loops_completely (struct loops *, int);
|
||||
static void decide_peel_simple (struct loops *, struct loop *, int);
|
||||
static void decide_peel_once_rolling (struct loops *, struct loop *, int);
|
||||
static void decide_peel_completely (struct loops *, struct loop *, int);
|
||||
static void decide_unroll_stupid (struct loops *, struct loop *, int);
|
||||
static void decide_unroll_constant_iterations (struct loops *,
|
||||
struct loop *, int);
|
||||
static void decide_unroll_runtime_iterations (struct loops *, struct loop *,
|
||||
int);
|
||||
static void peel_loop_simple (struct loops *, struct loop *);
|
||||
static void peel_loop_completely (struct loops *, struct loop *);
|
||||
static void unroll_loop_stupid (struct loops *, struct loop *);
|
||||
static void unroll_loop_constant_iterations (struct loops *, struct loop *);
|
||||
static void unroll_loop_runtime_iterations (struct loops *, struct loop *);
|
||||
|
||||
/* Unroll and/or peel (depending on FLAGS) LOOPS. */
|
||||
void
|
||||
unroll_and_peel_loops (loops, flags)
|
||||
struct loops *loops;
|
||||
int flags;
|
||||
unroll_and_peel_loops (struct loops *loops, int flags)
|
||||
{
|
||||
struct loop *loop, *next;
|
||||
int check;
|
||||
@ -152,9 +150,7 @@ unroll_and_peel_loops (loops, flags)
|
||||
|
||||
/* Check whether to peel LOOPS (depending on FLAGS) completely and do so. */
|
||||
static void
|
||||
peel_loops_completely (loops, flags)
|
||||
struct loops *loops;
|
||||
int flags;
|
||||
peel_loops_completely (struct loops *loops, int flags)
|
||||
{
|
||||
struct loop *loop, *next;
|
||||
|
||||
@ -175,7 +171,7 @@ peel_loops_completely (loops, flags)
|
||||
|
||||
loop->lpt_decision.decision = LPT_NONE;
|
||||
loop->has_desc = 0;
|
||||
|
||||
|
||||
if (rtl_dump_file)
|
||||
fprintf (rtl_dump_file, ";; Considering loop %d for complete peeling\n",
|
||||
loop->num);
|
||||
@ -200,9 +196,7 @@ peel_loops_completely (loops, flags)
|
||||
|
||||
/* Decide whether unroll or peel LOOPS (depending on FLAGS) and how much. */
|
||||
static void
|
||||
decide_unrolling_and_peeling (loops, flags)
|
||||
struct loops *loops;
|
||||
int flags;
|
||||
decide_unrolling_and_peeling (struct loops *loops, int flags)
|
||||
{
|
||||
struct loop *loop = loops->tree_root, *next;
|
||||
|
||||
@ -275,10 +269,8 @@ decide_unrolling_and_peeling (loops, flags)
|
||||
/* Decide whether the LOOP is once rolling and suitable for complete
|
||||
peeling. */
|
||||
static void
|
||||
decide_peel_once_rolling (loops, loop, flags)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
int flags ATTRIBUTE_UNUSED;
|
||||
decide_peel_once_rolling (struct loops *loops, struct loop *loop,
|
||||
int flags ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (rtl_dump_file)
|
||||
fprintf (rtl_dump_file, ";; Considering peeling once rolling loop\n");
|
||||
@ -311,10 +303,8 @@ decide_peel_once_rolling (loops, loop, flags)
|
||||
|
||||
/* Decide whether the LOOP is suitable for complete peeling. */
|
||||
static void
|
||||
decide_peel_completely (loops, loop, flags)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
int flags ATTRIBUTE_UNUSED;
|
||||
decide_peel_completely (struct loops *loops, struct loop *loop,
|
||||
int flags ATTRIBUTE_UNUSED)
|
||||
{
|
||||
unsigned npeel;
|
||||
|
||||
@ -377,7 +367,7 @@ decide_peel_completely (loops, loop, flags)
|
||||
if (loop->desc.niter > npeel - 1)
|
||||
{
|
||||
if (rtl_dump_file)
|
||||
{
|
||||
{
|
||||
fprintf (rtl_dump_file, ";; Not peeling loop completely, rolls too much (");
|
||||
fprintf (rtl_dump_file, HOST_WIDEST_INT_PRINT_DEC,(HOST_WIDEST_INT) loop->desc.niter);
|
||||
fprintf (rtl_dump_file, " iterations > %d [maximum peelings])\n", npeel);
|
||||
@ -393,29 +383,27 @@ decide_peel_completely (loops, loop, flags)
|
||||
|
||||
/* Peel all iterations of LOOP, remove exit edges and cancel the loop
|
||||
completely. The transformation done:
|
||||
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
body;
|
||||
|
||||
==>
|
||||
|
||||
i = 0;
|
||||
|
||||
i = 0;
|
||||
body; i++;
|
||||
body; i++;
|
||||
body; i++;
|
||||
body; i++;
|
||||
*/
|
||||
static void
|
||||
peel_loop_completely (loops, loop)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
peel_loop_completely (struct loops *loops, struct loop *loop)
|
||||
{
|
||||
sbitmap wont_exit;
|
||||
unsigned HOST_WIDE_INT npeel;
|
||||
unsigned n_remove_edges, i;
|
||||
edge *remove_edges;
|
||||
struct loop_desc *desc = &loop->desc;
|
||||
|
||||
|
||||
npeel = desc->niter;
|
||||
|
||||
if (npeel)
|
||||
@ -453,10 +441,8 @@ peel_loop_completely (loops, loop)
|
||||
|
||||
/* Decide whether to unroll LOOP iterating constant number of times and how much. */
|
||||
static void
|
||||
decide_unroll_constant_iterations (loops, loop, flags)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
int flags;
|
||||
decide_unroll_constant_iterations (struct loops *loops, struct loop *loop,
|
||||
int flags)
|
||||
{
|
||||
unsigned nunroll, nunroll_by_av, best_copies, best_unroll = -1, n_copies, i;
|
||||
|
||||
@ -546,13 +532,13 @@ decide_unroll_constant_iterations (loops, loop, flags)
|
||||
}
|
||||
|
||||
/* Unroll LOOP with constant number of iterations LOOP->LPT_DECISION.TIMES + 1
|
||||
times. The transformation does this:
|
||||
|
||||
times. The transformation does this:
|
||||
|
||||
for (i = 0; i < 102; i++)
|
||||
body;
|
||||
|
||||
|
||||
==>
|
||||
|
||||
|
||||
i = 0;
|
||||
body; i++;
|
||||
body; i++;
|
||||
@ -565,9 +551,7 @@ decide_unroll_constant_iterations (loops, loop, flags)
|
||||
}
|
||||
*/
|
||||
static void
|
||||
unroll_loop_constant_iterations (loops, loop)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
unroll_loop_constant_iterations (struct loops *loops, struct loop *loop)
|
||||
{
|
||||
unsigned HOST_WIDE_INT niter;
|
||||
unsigned exit_mod;
|
||||
@ -665,10 +649,8 @@ unroll_loop_constant_iterations (loops, loop)
|
||||
/* Decide whether to unroll LOOP iterating runtime computable number of times
|
||||
and how much. */
|
||||
static void
|
||||
decide_unroll_runtime_iterations (loops, loop, flags)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
int flags;
|
||||
decide_unroll_runtime_iterations (struct loops *loops, struct loop *loop,
|
||||
int flags)
|
||||
{
|
||||
unsigned nunroll, nunroll_by_av, i;
|
||||
|
||||
@ -739,15 +721,15 @@ decide_unroll_runtime_iterations (loops, loop, flags)
|
||||
/* Unroll LOOP for that we are able to count number of iterations in runtime
|
||||
LOOP->LPT_DECISION.TIMES + 1 times. The transformation does this (with some
|
||||
extra care for case n < 0):
|
||||
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
body;
|
||||
|
||||
|
||||
==>
|
||||
|
||||
|
||||
i = 0;
|
||||
mod = n % 4;
|
||||
|
||||
|
||||
switch (mod)
|
||||
{
|
||||
case 3:
|
||||
@ -758,7 +740,7 @@ decide_unroll_runtime_iterations (loops, loop, flags)
|
||||
body; i++;
|
||||
case 0: ;
|
||||
}
|
||||
|
||||
|
||||
while (i < n)
|
||||
{
|
||||
body; i++;
|
||||
@ -768,9 +750,7 @@ decide_unroll_runtime_iterations (loops, loop, flags)
|
||||
}
|
||||
*/
|
||||
static void
|
||||
unroll_loop_runtime_iterations (loops, loop)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
|
||||
{
|
||||
rtx niter, init_code, branch_code, jump, label;
|
||||
unsigned i, j, p;
|
||||
@ -876,7 +856,7 @@ unroll_loop_runtime_iterations (loops, loop)
|
||||
loops, 1,
|
||||
wont_exit, desc->out_edge, remove_edges, &n_remove_edges,
|
||||
DLTHE_FLAG_UPDATE_FREQ))
|
||||
abort ();
|
||||
abort ();
|
||||
|
||||
/* Create item for switch. */
|
||||
j = n_peel - i - (extra_zero_check ? 0 : 1);
|
||||
@ -894,7 +874,7 @@ unroll_loop_runtime_iterations (loops, loop)
|
||||
REG_NOTES (jump)
|
||||
= gen_rtx_EXPR_LIST (REG_BR_PROB,
|
||||
GEN_INT (p), REG_NOTES (jump));
|
||||
|
||||
|
||||
LABEL_NUSES (label)++;
|
||||
branch_code = get_insns ();
|
||||
end_sequence ();
|
||||
@ -924,7 +904,7 @@ unroll_loop_runtime_iterations (loops, loop)
|
||||
REG_NOTES (jump)
|
||||
= gen_rtx_EXPR_LIST (REG_BR_PROB,
|
||||
GEN_INT (p), REG_NOTES (jump));
|
||||
|
||||
|
||||
LABEL_NUSES (label)++;
|
||||
branch_code = get_insns ();
|
||||
end_sequence ();
|
||||
@ -946,7 +926,7 @@ unroll_loop_runtime_iterations (loops, loop)
|
||||
RESET_BIT (wont_exit, may_exit_copy);
|
||||
|
||||
if (!duplicate_loop_to_header_edge (loop, loop_latch_edge (loop),
|
||||
loops, max_unroll,
|
||||
loops, max_unroll,
|
||||
wont_exit, desc->out_edge, remove_edges, &n_remove_edges,
|
||||
DLTHE_FLAG_UPDATE_FREQ))
|
||||
abort ();
|
||||
@ -963,13 +943,10 @@ unroll_loop_runtime_iterations (loops, loop)
|
||||
";; Unrolled loop %d times, counting # of iterations in runtime, %i insns\n",
|
||||
max_unroll, num_loop_insns (loop));
|
||||
}
|
||||
|
||||
|
||||
/* Decide whether to simply peel LOOP and how much. */
|
||||
static void
|
||||
decide_peel_simple (loops, loop, flags)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
int flags;
|
||||
decide_peel_simple (struct loops *loops, struct loop *loop, int flags)
|
||||
{
|
||||
unsigned npeel;
|
||||
|
||||
@ -1064,9 +1041,7 @@ decide_peel_simple (loops, loop, flags)
|
||||
end: ;
|
||||
*/
|
||||
static void
|
||||
peel_loop_simple (loops, loop)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
peel_loop_simple (struct loops *loops, struct loop *loop)
|
||||
{
|
||||
sbitmap wont_exit;
|
||||
unsigned npeel = loop->lpt_decision.times;
|
||||
@ -1078,7 +1053,7 @@ peel_loop_simple (loops, loop)
|
||||
loops, npeel, wont_exit, NULL, NULL, NULL,
|
||||
DLTHE_FLAG_UPDATE_FREQ))
|
||||
abort ();
|
||||
|
||||
|
||||
free (wont_exit);
|
||||
|
||||
if (rtl_dump_file)
|
||||
@ -1087,10 +1062,7 @@ peel_loop_simple (loops, loop)
|
||||
|
||||
/* Decide whether to unroll LOOP stupidly and how much. */
|
||||
static void
|
||||
decide_unroll_stupid (loops, loop, flags)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
int flags;
|
||||
decide_unroll_stupid (struct loops *loops, struct loop *loop, int flags)
|
||||
{
|
||||
unsigned nunroll, nunroll_by_av, i;
|
||||
|
||||
@ -1179,9 +1151,7 @@ decide_unroll_stupid (loops, loop, flags)
|
||||
}
|
||||
*/
|
||||
static void
|
||||
unroll_loop_stupid (loops, loop)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
unroll_loop_stupid (struct loops *loops, struct loop *loop)
|
||||
{
|
||||
sbitmap wont_exit;
|
||||
unsigned nunroll = loop->lpt_decision.times;
|
||||
@ -1195,7 +1165,7 @@ unroll_loop_stupid (loops, loop)
|
||||
abort ();
|
||||
|
||||
free (wont_exit);
|
||||
|
||||
|
||||
if (rtl_dump_file)
|
||||
fprintf (rtl_dump_file, ";; Unrolled loop %d times, %i insns\n",
|
||||
nunroll, num_loop_insns (loop));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Loop unswitching for GNU compiler.
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -78,25 +78,23 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
containing subloops would not be very large compared to complications
|
||||
with handling this case. */
|
||||
|
||||
static struct loop *unswitch_loop PARAMS ((struct loops *,
|
||||
struct loop *, basic_block));
|
||||
static void unswitch_single_loop PARAMS ((struct loops *, struct loop *,
|
||||
rtx, int));
|
||||
static bool may_unswitch_on_p PARAMS ((struct loops *, basic_block,
|
||||
struct loop *, basic_block *));
|
||||
static rtx reversed_condition PARAMS ((rtx));
|
||||
static struct loop *unswitch_loop (struct loops *, struct loop *,
|
||||
basic_block);
|
||||
static void unswitch_single_loop (struct loops *, struct loop *, rtx, int);
|
||||
static bool may_unswitch_on_p (struct loops *, basic_block, struct loop *,
|
||||
basic_block *);
|
||||
static rtx reversed_condition (rtx);
|
||||
|
||||
/* Main entry point. Perform loop unswitching on all suitable LOOPS. */
|
||||
void
|
||||
unswitch_loops (loops)
|
||||
struct loops *loops;
|
||||
unswitch_loops (struct loops *loops)
|
||||
{
|
||||
int i, num;
|
||||
struct loop *loop;
|
||||
|
||||
/* Go through inner loops (only original ones). */
|
||||
num = loops->num;
|
||||
|
||||
|
||||
for (i = 1; i < num; i++)
|
||||
{
|
||||
/* Removed loop? */
|
||||
@ -119,11 +117,8 @@ unswitch_loops (loops)
|
||||
basic blocks (for what it means see comments below). List of basic blocks
|
||||
inside LOOP is provided in BODY to save time. */
|
||||
static bool
|
||||
may_unswitch_on_p (loops, bb, loop, body)
|
||||
struct loops *loops;
|
||||
basic_block bb;
|
||||
struct loop *loop;
|
||||
basic_block *body;
|
||||
may_unswitch_on_p (struct loops *loops, basic_block bb, struct loop *loop,
|
||||
basic_block *body)
|
||||
{
|
||||
rtx test;
|
||||
unsigned i;
|
||||
@ -159,8 +154,7 @@ may_unswitch_on_p (loops, bb, loop, body)
|
||||
|
||||
/* Reverses CONDition; returns NULL if we cannot. */
|
||||
static rtx
|
||||
reversed_condition (cond)
|
||||
rtx cond;
|
||||
reversed_condition (rtx cond)
|
||||
{
|
||||
enum rtx_code reversed;
|
||||
reversed = reversed_comparison_code (cond, NULL);
|
||||
@ -177,11 +171,8 @@ reversed_condition (cond)
|
||||
number of unswitchings done; do not allow it to grow too much, it is too
|
||||
easy to create example on that the code would grow exponentially. */
|
||||
static void
|
||||
unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
rtx cond_checked;
|
||||
int num;
|
||||
unswitch_single_loop (struct loops *loops, struct loop *loop,
|
||||
rtx cond_checked, int num)
|
||||
{
|
||||
basic_block *bbs, bb;
|
||||
struct loop *nloop;
|
||||
@ -208,7 +199,7 @@ unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
fprintf (rtl_dump_file, ";; Not unswitching, not innermost loop\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* We must be able to duplicate loop body. */
|
||||
if (!can_duplicate_loop_p (loop))
|
||||
{
|
||||
@ -224,7 +215,7 @@ unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
fprintf (rtl_dump_file, ";; Not unswitching, loop too big\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Do not unswitch in cold areas. */
|
||||
if (!maybe_hot_bb_p (loop->header))
|
||||
{
|
||||
@ -232,7 +223,7 @@ unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
fprintf (rtl_dump_file, ";; Not unswitching, not hot area\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Nor if the loop usually does not roll. */
|
||||
if (expected_loop_iterations (loop) < 1)
|
||||
{
|
||||
@ -244,7 +235,7 @@ unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
do
|
||||
{
|
||||
repeat = 0;
|
||||
|
||||
|
||||
/* Find a bb to unswitch on. */
|
||||
bbs = get_loop_body (loop);
|
||||
for (i = 0; i < loop->num_nodes; i++)
|
||||
@ -260,7 +251,7 @@ unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
if (!(cond = get_condition (bbs[i]->end, &split_before)))
|
||||
abort ();
|
||||
rcond = reversed_condition (cond);
|
||||
|
||||
|
||||
/* Check whether the result can be predicted. */
|
||||
always_true = 0;
|
||||
always_false = 0;
|
||||
@ -281,7 +272,7 @@ unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
if (always_true)
|
||||
{
|
||||
/* Remove false path. */
|
||||
for (e = bbs[i]->succ; !(e->flags & EDGE_FALLTHRU); e = e->succ_next);
|
||||
for (e = bbs[i]->succ; !(e->flags & EDGE_FALLTHRU); e = e->succ_next);
|
||||
remove_path (loops, e);
|
||||
free (bbs);
|
||||
repeat = 1;
|
||||
@ -295,7 +286,7 @@ unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
repeat = 1;
|
||||
}
|
||||
} while (repeat);
|
||||
|
||||
|
||||
/* We found the condition we can unswitch on. */
|
||||
conds = alloc_EXPR_LIST (0, cond, cond_checked);
|
||||
if (rcond)
|
||||
@ -330,10 +321,7 @@ unswitch_single_loop (loops, loop, cond_checked, num)
|
||||
for the condition we unswitch on. Returns NULL if impossible, new
|
||||
loop otherwise. */
|
||||
static struct loop *
|
||||
unswitch_loop (loops, loop, unswitch_on)
|
||||
struct loops *loops;
|
||||
struct loop *loop;
|
||||
basic_block unswitch_on;
|
||||
unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on)
|
||||
{
|
||||
edge entry, latch_edge;
|
||||
basic_block switch_bb, unswitch_on_alt, src;
|
||||
@ -355,7 +343,7 @@ unswitch_loop (loops, loop, unswitch_on)
|
||||
abort ();
|
||||
if (!flow_bb_inside_loop_p (loop, unswitch_on->succ->succ_next->dest))
|
||||
abort ();
|
||||
|
||||
|
||||
/* Will we be able to perform redirection? */
|
||||
if (!any_condjump_p (unswitch_on->end))
|
||||
return NULL;
|
||||
@ -363,7 +351,7 @@ unswitch_loop (loops, loop, unswitch_on)
|
||||
return NULL;
|
||||
|
||||
entry = loop_preheader_edge (loop);
|
||||
|
||||
|
||||
/* Make a copy. */
|
||||
src = entry->src;
|
||||
irred_flag = entry->flags & EDGE_IRREDUCIBLE_LOOP;
|
||||
|
923
gcc/loop.c
923
gcc/loop.c
File diff suppressed because it is too large
Load Diff
53
gcc/loop.h
53
gcc/loop.h
@ -1,5 +1,5 @@
|
||||
/* Loop optimization definitions for GCC
|
||||
Copyright (C) 1991, 1995, 1998, 1999, 2000, 2001, 2002
|
||||
Copyright (C) 1991, 1995, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
@ -398,34 +398,31 @@ extern FILE *loop_dump_stream;
|
||||
|
||||
/* Forward declarations for non-static functions declared in loop.c and
|
||||
unroll.c. */
|
||||
int loop_invariant_p PARAMS ((const struct loop *, rtx));
|
||||
rtx get_condition_for_loop PARAMS ((const struct loop *, rtx));
|
||||
void loop_iv_add_mult_hoist PARAMS ((const struct loop *, rtx, rtx, rtx, rtx));
|
||||
void loop_iv_add_mult_sink PARAMS ((const struct loop *, rtx, rtx, rtx, rtx));
|
||||
void loop_iv_add_mult_emit_before PARAMS ((const struct loop *, rtx,
|
||||
rtx, rtx, rtx,
|
||||
basic_block, rtx));
|
||||
rtx express_from PARAMS ((struct induction *, struct induction *));
|
||||
rtx extend_value_for_giv PARAMS ((struct induction *, rtx));
|
||||
extern int loop_invariant_p (const struct loop *, rtx);
|
||||
extern rtx get_condition_for_loop (const struct loop *, rtx);
|
||||
extern void loop_iv_add_mult_hoist (const struct loop *, rtx, rtx, rtx, rtx);
|
||||
extern void loop_iv_add_mult_sink (const struct loop *, rtx, rtx, rtx, rtx);
|
||||
extern void loop_iv_add_mult_emit_before (const struct loop *, rtx, rtx,
|
||||
rtx, rtx, basic_block, rtx);
|
||||
extern rtx express_from (struct induction *, struct induction *);
|
||||
extern rtx extend_value_for_giv (struct induction *, rtx);
|
||||
|
||||
void unroll_loop PARAMS ((struct loop *, int, int));
|
||||
rtx biv_total_increment PARAMS ((const struct iv_class *));
|
||||
unsigned HOST_WIDE_INT loop_iterations PARAMS ((struct loop *));
|
||||
int precondition_loop_p PARAMS ((const struct loop *,
|
||||
rtx *, rtx *, rtx *,
|
||||
enum machine_mode *mode));
|
||||
rtx final_biv_value PARAMS ((const struct loop *, struct iv_class *));
|
||||
rtx final_giv_value PARAMS ((const struct loop *, struct induction *));
|
||||
void emit_unrolled_add PARAMS ((rtx, rtx, rtx));
|
||||
int back_branch_in_range_p PARAMS ((const struct loop *, rtx));
|
||||
extern void unroll_loop (struct loop *, int, int);
|
||||
extern rtx biv_total_increment (const struct iv_class *);
|
||||
extern unsigned HOST_WIDE_INT loop_iterations (struct loop *);
|
||||
extern int precondition_loop_p (const struct loop *, rtx *, rtx *, rtx *,
|
||||
enum machine_mode *mode);
|
||||
extern rtx final_biv_value (const struct loop *, struct iv_class *);
|
||||
extern rtx final_giv_value (const struct loop *, struct induction *);
|
||||
extern void emit_unrolled_add (rtx, rtx, rtx);
|
||||
extern int back_branch_in_range_p (const struct loop *, rtx);
|
||||
|
||||
int loop_insn_first_p PARAMS ((rtx, rtx));
|
||||
typedef rtx (*loop_insn_callback) PARAMS ((struct loop *, rtx, int, int));
|
||||
void for_each_insn_in_loop PARAMS ((struct loop *, loop_insn_callback));
|
||||
rtx loop_insn_emit_before PARAMS((const struct loop *, basic_block,
|
||||
rtx, rtx));
|
||||
rtx loop_insn_sink PARAMS((const struct loop *, rtx));
|
||||
rtx loop_insn_hoist PARAMS((const struct loop *, rtx));
|
||||
extern int loop_insn_first_p (rtx, rtx);
|
||||
typedef rtx (*loop_insn_callback) (struct loop *, rtx, int, int);
|
||||
extern void for_each_insn_in_loop (struct loop *, loop_insn_callback);
|
||||
extern rtx loop_insn_emit_before (const struct loop *, basic_block, rtx, rtx);
|
||||
extern rtx loop_insn_sink (const struct loop *, rtx);
|
||||
extern rtx loop_insn_hoist (const struct loop *, rtx);
|
||||
|
||||
/* Forward declarations for non-static functions declared in doloop.c. */
|
||||
int doloop_optimize PARAMS ((const struct loop *));
|
||||
extern int doloop_optimize (const struct loop *);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Machine mode definitions for GCC; included by rtl.h and tree.h.
|
||||
Copyright (C) 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2001
|
||||
Copyright (C) 1991, 1993, 1994, 1996, 1998, 1999, 2000, 2001, 2003
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
@ -136,28 +136,27 @@ extern const unsigned char mode_wider_mode[NUM_MACHINE_MODES];
|
||||
If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
|
||||
The value is BLKmode if no other mode is found. */
|
||||
|
||||
extern enum machine_mode mode_for_size PARAMS ((unsigned int,
|
||||
enum mode_class, int));
|
||||
extern enum machine_mode mode_for_size (unsigned int, enum mode_class, int);
|
||||
|
||||
/* Similar, but find the smallest mode for a given width. */
|
||||
|
||||
extern enum machine_mode smallest_mode_for_size
|
||||
PARAMS ((unsigned int, enum mode_class));
|
||||
extern enum machine_mode smallest_mode_for_size (unsigned int,
|
||||
enum mode_class);
|
||||
|
||||
|
||||
/* Return an integer mode of the exact same size as the input mode,
|
||||
or BLKmode on failure. */
|
||||
|
||||
extern enum machine_mode int_mode_for_mode PARAMS ((enum machine_mode));
|
||||
extern enum machine_mode int_mode_for_mode (enum machine_mode);
|
||||
|
||||
/* Find the best mode to use to access a bit field. */
|
||||
|
||||
extern enum machine_mode get_best_mode PARAMS ((int, int, unsigned int,
|
||||
enum machine_mode, int));
|
||||
extern enum machine_mode get_best_mode (int, int, unsigned int,
|
||||
enum machine_mode, int);
|
||||
|
||||
/* Determine alignment, 1<=result<=BIGGEST_ALIGNMENT. */
|
||||
|
||||
extern unsigned get_mode_alignment PARAMS ((enum machine_mode));
|
||||
extern unsigned get_mode_alignment (enum machine_mode);
|
||||
|
||||
#define GET_MODE_ALIGNMENT(MODE) get_mode_alignment (MODE)
|
||||
|
||||
|
@ -23,16 +23,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#include "tm.h"
|
||||
#include "toplev.h"
|
||||
|
||||
int main PARAMS ((int argc, char **argv));
|
||||
int main (int argc, char **argv);
|
||||
|
||||
/* We define main() to call toplev_main(), which is defined in toplev.c.
|
||||
We do this in a separate file in order to allow the language front-end
|
||||
to define a different main(), if it so desires. */
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
return toplev_main (argc, (const char **) argv);
|
||||
}
|
||||
|
25
gcc/mbchar.c
25
gcc/mbchar.c
@ -1,5 +1,5 @@
|
||||
/* Multibyte Character Functions.
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -41,7 +41,7 @@ typedef enum {ESCAPE, DOLLAR, BRACKET, AT, B, J, NUL, JIS_CHAR, OTHER,
|
||||
JIS_C_NUM} JIS_CHAR_TYPE;
|
||||
|
||||
typedef enum {ASCII, A_ESC, A_ESC_DL, JIS, JIS_1, JIS_2, J_ESC, J_ESC_BR,
|
||||
J2_ESC, J2_ESC_BR, INV, JIS_S_NUM} JIS_STATE;
|
||||
J2_ESC, J2_ESC_BR, INV, JIS_S_NUM} JIS_STATE;
|
||||
|
||||
typedef enum {COPYA, COPYJ, COPYJ2, MAKE_A, MAKE_J, NOOP,
|
||||
EMPTY, ERROR} JIS_ACTION;
|
||||
@ -94,10 +94,7 @@ const char *literal_codeset = NULL;
|
||||
it treats locale names of the form "C-..." specially. */
|
||||
|
||||
int
|
||||
local_mbtowc (pwc, s, n)
|
||||
wchar_t *pwc;
|
||||
const char *s;
|
||||
size_t n;
|
||||
local_mbtowc (wchar_t *pwc, const char *s, size_t n)
|
||||
{
|
||||
static JIS_STATE save_state = ASCII;
|
||||
JIS_STATE curr_state = save_state;
|
||||
@ -153,7 +150,7 @@ local_mbtowc (pwc, s, n)
|
||||
char1 = *t;
|
||||
if (ISEUCJP (char1))
|
||||
{
|
||||
int char2 = t[1];
|
||||
int char2 = t[1];
|
||||
|
||||
if (n <= 1)
|
||||
return -1;
|
||||
@ -182,7 +179,7 @@ local_mbtowc (pwc, s, n)
|
||||
JIS_CHAR_TYPE ch;
|
||||
const unsigned char *ptr;
|
||||
size_t i, curr_ch;
|
||||
|
||||
|
||||
if (s == NULL)
|
||||
{
|
||||
save_state = ASCII;
|
||||
@ -227,7 +224,7 @@ local_mbtowc (pwc, s, n)
|
||||
|
||||
action = JIS_action_table[curr_state][ch];
|
||||
curr_state = JIS_state_table[curr_state][ch];
|
||||
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case NOOP:
|
||||
@ -272,9 +269,9 @@ local_mbtowc (pwc, s, n)
|
||||
}
|
||||
|
||||
/* More than n bytes needed. */
|
||||
return -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef CROSS_COMPILE
|
||||
if (s == NULL)
|
||||
/* Not state-dependent. */
|
||||
@ -298,9 +295,7 @@ local_mbtowc (pwc, s, n)
|
||||
it treats locale names of the form "C-..." specially. */
|
||||
|
||||
int
|
||||
local_mblen (s, n)
|
||||
const char *s;
|
||||
size_t n;
|
||||
local_mblen (const char *s, size_t n)
|
||||
{
|
||||
return local_mbtowc (NULL, s, n);
|
||||
}
|
||||
@ -311,7 +306,7 @@ local_mblen (s, n)
|
||||
except it treats locale names of the form "C-..." specially. */
|
||||
|
||||
int
|
||||
local_mb_cur_max ()
|
||||
local_mb_cur_max (void)
|
||||
{
|
||||
if (literal_codeset == NULL || strlen (literal_codeset) <= 1)
|
||||
;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Various declarations for functions found in mbchar.c
|
||||
Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -31,9 +31,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#define ISEUCJP(c) ((c) >= 0xa1 && (c) <= 0xfe)
|
||||
#define ISJIS(c) ((c) >= 0x21 && (c) <= 0x7e)
|
||||
|
||||
extern int local_mbtowc PARAMS ((wchar_t *, const char *, size_t));
|
||||
extern int local_mblen PARAMS ((const char *, size_t));
|
||||
extern int local_mb_cur_max PARAMS ((void));
|
||||
extern int local_mbtowc (wchar_t *, const char *, size_t);
|
||||
extern int local_mblen (const char *, size_t);
|
||||
extern int local_mb_cur_max (void);
|
||||
|
||||
/* The locale being used for multibyte characters in string/char literals. */
|
||||
extern const char *literal_codeset;
|
||||
|
53
gcc/mkdeps.c
53
gcc/mkdeps.c
@ -1,5 +1,5 @@
|
||||
/* Dependency generator for Makefile fragments.
|
||||
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||
Contributed by Zack Weinberg, Mar 2000
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
@ -39,7 +39,7 @@ struct deps
|
||||
unsigned int deps_size;
|
||||
};
|
||||
|
||||
static const char *munge PARAMS ((const char *));
|
||||
static const char *munge (const char *);
|
||||
|
||||
/* Given a filename, quote characters in that filename which are
|
||||
significant to Make. Note that it's not possible to quote all such
|
||||
@ -47,10 +47,9 @@ static const char *munge PARAMS ((const char *));
|
||||
not properly handled. It isn't possible to get this right in any
|
||||
current version of Make. (??? Still true? Old comment referred to
|
||||
3.76.1.) */
|
||||
|
||||
|
||||
static const char *
|
||||
munge (filename)
|
||||
const char *filename;
|
||||
munge (const char *filename)
|
||||
{
|
||||
int len;
|
||||
const char *p, *q;
|
||||
@ -111,7 +110,7 @@ munge (filename)
|
||||
/* Public routines. */
|
||||
|
||||
struct deps *
|
||||
deps_init ()
|
||||
deps_init (void)
|
||||
{
|
||||
struct deps *d = (struct deps *) xmalloc (sizeof (struct deps));
|
||||
|
||||
@ -129,8 +128,7 @@ deps_init ()
|
||||
}
|
||||
|
||||
void
|
||||
deps_free (d)
|
||||
struct deps *d;
|
||||
deps_free (struct deps *d)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@ -154,10 +152,7 @@ deps_free (d)
|
||||
/* Adds a target T. We make a copy, so it need not be a permanent
|
||||
string. QUOTE is true if the string should be quoted. */
|
||||
void
|
||||
deps_add_target (d, t, quote)
|
||||
struct deps *d;
|
||||
const char *t;
|
||||
int quote;
|
||||
deps_add_target (struct deps *d, const char *t, int quote)
|
||||
{
|
||||
if (d->ntargets == d->targets_size)
|
||||
{
|
||||
@ -178,9 +173,7 @@ deps_add_target (d, t, quote)
|
||||
string as the default target in interpreted as stdin. The string
|
||||
is quoted for MAKE. */
|
||||
void
|
||||
deps_add_default_target (d, tgt)
|
||||
struct deps *d;
|
||||
const char *tgt;
|
||||
deps_add_default_target (struct deps *d, const char *tgt)
|
||||
{
|
||||
/* Only if we have no targets. */
|
||||
if (d->ntargets)
|
||||
@ -198,20 +191,18 @@ deps_add_default_target (d, tgt)
|
||||
char *suffix;
|
||||
|
||||
strcpy (o, start);
|
||||
|
||||
|
||||
suffix = strrchr (o, '.');
|
||||
if (!suffix)
|
||||
suffix = o + strlen (o);
|
||||
strcpy (suffix, TARGET_OBJECT_SUFFIX);
|
||||
|
||||
|
||||
deps_add_target (d, o, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
deps_add_dep (d, t)
|
||||
struct deps *d;
|
||||
const char *t;
|
||||
deps_add_dep (struct deps *d, const char *t)
|
||||
{
|
||||
t = munge (t); /* Also makes permanent copy. */
|
||||
|
||||
@ -225,10 +216,7 @@ deps_add_dep (d, t)
|
||||
}
|
||||
|
||||
void
|
||||
deps_write (d, fp, colmax)
|
||||
const struct deps *d;
|
||||
FILE *fp;
|
||||
unsigned int colmax;
|
||||
deps_write (const struct deps *d, FILE *fp, unsigned int colmax)
|
||||
{
|
||||
unsigned int size, i, column;
|
||||
|
||||
@ -275,11 +263,9 @@ deps_write (d, fp, colmax)
|
||||
}
|
||||
putc ('\n', fp);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
deps_phony_targets (d, fp)
|
||||
const struct deps *d;
|
||||
FILE *fp;
|
||||
deps_phony_targets (const struct deps *d, FILE *fp)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@ -297,9 +283,7 @@ deps_phony_targets (d, fp)
|
||||
error number will be in errno. */
|
||||
|
||||
int
|
||||
deps_save (deps, f)
|
||||
struct deps *deps;
|
||||
FILE *f;
|
||||
deps_save (struct deps *deps, FILE *f)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@ -328,10 +312,7 @@ deps_save (deps, f)
|
||||
in which case that filename is skipped. */
|
||||
|
||||
int
|
||||
deps_restore (deps, fd, self)
|
||||
struct deps *deps;
|
||||
FILE *fd;
|
||||
const char *self;
|
||||
deps_restore (struct deps *deps, FILE *fd, const char *self)
|
||||
{
|
||||
unsigned int i, count;
|
||||
size_t num_to_read;
|
||||
@ -357,7 +338,7 @@ deps_restore (deps, fd, self)
|
||||
return -1;
|
||||
buf[num_to_read] = '\0';
|
||||
|
||||
/* Generate makefile dependencies from .pch if -nopch-deps. */
|
||||
/* Generate makefile dependencies from .pch if -nopch-deps. */
|
||||
if (self != NULL && strcmp (buf, self) != 0)
|
||||
deps_add_dep (deps, buf);
|
||||
}
|
||||
|
21
gcc/mkdeps.h
21
gcc/mkdeps.h
@ -1,5 +1,5 @@
|
||||
/* Dependency generator for Makefile fragments.
|
||||
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||
Contributed by Zack Weinberg, Mar 2000
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
@ -29,45 +29,44 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
struct deps;
|
||||
|
||||
/* Create a deps buffer. */
|
||||
extern struct deps *deps_init PARAMS ((void));
|
||||
extern struct deps *deps_init (void);
|
||||
|
||||
/* Destroy a deps buffer. */
|
||||
extern void deps_free PARAMS ((struct deps *));
|
||||
extern void deps_free (struct deps *);
|
||||
|
||||
/* Add a target (appears on left side of the colon) to the deps list. Takes
|
||||
a boolean indicating whether to quote the target for MAKE. */
|
||||
extern void deps_add_target PARAMS ((struct deps *, const char *, int));
|
||||
extern void deps_add_target (struct deps *, const char *, int);
|
||||
|
||||
/* Sets the default target if none has been given already. An empty
|
||||
string as the default target is interpreted as stdin. */
|
||||
extern void deps_add_default_target PARAMS ((struct deps *, const char *));
|
||||
extern void deps_add_default_target (struct deps *, const char *);
|
||||
|
||||
/* Add a dependency (appears on the right side of the colon) to the
|
||||
deps list. Dependencies will be printed in the order that they
|
||||
were entered with this function. By convention, the first
|
||||
dependency entered should be the primary source file. */
|
||||
extern void deps_add_dep PARAMS ((struct deps *, const char *));
|
||||
extern void deps_add_dep (struct deps *, const char *);
|
||||
|
||||
/* Write out a deps buffer to a specified file. The third argument
|
||||
is the number of columns to word-wrap at (0 means don't wrap). */
|
||||
extern void deps_write PARAMS ((const struct deps *, FILE *,
|
||||
unsigned int));
|
||||
extern void deps_write (const struct deps *, FILE *, unsigned int);
|
||||
|
||||
/* Write out a deps buffer to a file, in a form that can be read back
|
||||
with deps_restore. Returns nonzero on error, in which case the
|
||||
error number will be in errno. */
|
||||
extern int deps_save PARAMS ((struct deps *, FILE *));
|
||||
extern int deps_save (struct deps *, FILE *);
|
||||
|
||||
/* Read back dependency information written with deps_save into
|
||||
the deps buffer. The third argument may be NULL, in which case
|
||||
the dependency information is just skipped, or it may be a filename,
|
||||
in which case that filename is skipped. */
|
||||
extern int deps_restore PARAMS ((struct deps *, FILE *, const char *));
|
||||
extern int deps_restore (struct deps *, FILE *, const char *);
|
||||
|
||||
/* For each dependency *except the first*, emit a dummy rule for that
|
||||
file, causing it to depend on nothing. This is used to work around
|
||||
the intermediate-file deletion misfeature in Make, in some
|
||||
automatic dependency schemes. */
|
||||
extern void deps_phony_targets PARAMS ((const struct deps *, FILE *));
|
||||
extern void deps_phony_targets (const struct deps *, FILE *);
|
||||
|
||||
#endif /* ! GCC_MKDEPS_H */
|
||||
|
513
gcc/optabs.c
513
gcc/optabs.c
File diff suppressed because it is too large
Load Diff
59
gcc/optabs.h
59
gcc/optabs.h
@ -93,7 +93,7 @@ enum optab_index
|
||||
/* Arithmetic shift left */
|
||||
OTI_ashl,
|
||||
/* Logical shift right */
|
||||
OTI_lshr,
|
||||
OTI_lshr,
|
||||
/* Arithmetic shift right */
|
||||
OTI_ashr,
|
||||
/* Rotate left */
|
||||
@ -168,7 +168,7 @@ enum optab_index
|
||||
OTI_cbranch,
|
||||
OTI_cmov,
|
||||
OTI_cstore,
|
||||
|
||||
|
||||
/* Push instruction. */
|
||||
OTI_push,
|
||||
|
||||
@ -269,7 +269,7 @@ extern enum insn_code reload_out_optab[NUM_MACHINE_MODES];
|
||||
extern GTY(()) optab code_to_optab[NUM_RTX_CODE + 1];
|
||||
|
||||
|
||||
typedef rtx (*rtxfun) PARAMS ((rtx));
|
||||
typedef rtx (*rtxfun) (rtx);
|
||||
|
||||
/* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
|
||||
gives the gen_function to make a branch to test that condition. */
|
||||
@ -298,43 +298,43 @@ extern enum insn_code clrstr_optab[NUM_MACHINE_MODES];
|
||||
/* Define functions given in optabs.c. */
|
||||
|
||||
/* Expand a binary operation given optab and rtx operands. */
|
||||
extern rtx expand_binop PARAMS ((enum machine_mode, optab, rtx, rtx, rtx,
|
||||
int, enum optab_methods));
|
||||
extern rtx expand_binop (enum machine_mode, optab, rtx, rtx, rtx, int,
|
||||
enum optab_methods);
|
||||
|
||||
/* Expand a binary operation with both signed and unsigned forms. */
|
||||
extern rtx sign_expand_binop PARAMS ((enum machine_mode, optab, optab, rtx,
|
||||
rtx, rtx, int, enum optab_methods));
|
||||
extern rtx sign_expand_binop (enum machine_mode, optab, optab, rtx, rtx,
|
||||
rtx, int, enum optab_methods);
|
||||
|
||||
/* Generate code to perform an operation on two operands with two results. */
|
||||
extern int expand_twoval_binop PARAMS ((optab, rtx, rtx, rtx, rtx, int));
|
||||
extern int expand_twoval_binop (optab, rtx, rtx, rtx, rtx, int);
|
||||
|
||||
/* Expand a unary arithmetic operation given optab rtx operand. */
|
||||
extern rtx expand_unop PARAMS ((enum machine_mode, optab, rtx, rtx, int));
|
||||
extern rtx expand_unop (enum machine_mode, optab, rtx, rtx, int);
|
||||
|
||||
/* Expand the absolute value operation. */
|
||||
extern rtx expand_abs_nojump PARAMS ((enum machine_mode, rtx, rtx, int));
|
||||
extern rtx expand_abs PARAMS ((enum machine_mode, rtx, rtx, int, int));
|
||||
extern rtx expand_abs_nojump (enum machine_mode, rtx, rtx, int);
|
||||
extern rtx expand_abs (enum machine_mode, rtx, rtx, int, int);
|
||||
|
||||
/* Expand the complex absolute value operation. */
|
||||
extern rtx expand_complex_abs PARAMS ((enum machine_mode, rtx, rtx, int));
|
||||
extern rtx expand_complex_abs (enum machine_mode, rtx, rtx, int);
|
||||
|
||||
/* Generate an instruction with a given INSN_CODE with an output and
|
||||
an input. */
|
||||
extern void emit_unop_insn PARAMS ((int, rtx, rtx, enum rtx_code));
|
||||
extern void emit_unop_insn (int, rtx, rtx, enum rtx_code);
|
||||
|
||||
/* Emit code to perform a series of operations on a multi-word quantity, one
|
||||
word at a time. */
|
||||
extern rtx emit_no_conflict_block PARAMS ((rtx, rtx, rtx, rtx, rtx));
|
||||
extern rtx emit_no_conflict_block (rtx, rtx, rtx, rtx, rtx);
|
||||
|
||||
/* Emit one rtl instruction to store zero in specified rtx. */
|
||||
extern void emit_clr_insn PARAMS ((rtx));
|
||||
extern void emit_clr_insn (rtx);
|
||||
|
||||
/* Emit one rtl insn to store 1 in specified rtx assuming it contains 0. */
|
||||
extern void emit_0_to_1_insn PARAMS ((rtx));
|
||||
extern void emit_0_to_1_insn (rtx);
|
||||
|
||||
/* Emit one rtl insn to compare two rtx's. */
|
||||
extern void emit_cmp_insn PARAMS ((rtx, rtx, enum rtx_code, rtx,
|
||||
enum machine_mode, int));
|
||||
extern void emit_cmp_insn (rtx, rtx, enum rtx_code, rtx, enum machine_mode,
|
||||
int);
|
||||
|
||||
/* The various uses that a comparison can have; used by can_compare_p:
|
||||
jumps, conditional moves, store flag operations. */
|
||||
@ -347,30 +347,29 @@ enum can_compare_purpose
|
||||
|
||||
/* Nonzero if a compare of mode MODE can be done straightforwardly
|
||||
(without splitting it into pieces). */
|
||||
extern int can_compare_p PARAMS ((enum rtx_code, enum machine_mode,
|
||||
enum can_compare_purpose));
|
||||
extern int can_compare_p (enum rtx_code, enum machine_mode,
|
||||
enum can_compare_purpose);
|
||||
|
||||
extern rtx prepare_operand PARAMS ((int, rtx, int, enum machine_mode,
|
||||
enum machine_mode, int));
|
||||
extern rtx prepare_operand (int, rtx, int, enum machine_mode,
|
||||
enum machine_mode, int);
|
||||
|
||||
/* Return the INSN_CODE to use for an extend operation. */
|
||||
extern enum insn_code can_extend_p PARAMS ((enum machine_mode,
|
||||
enum machine_mode, int));
|
||||
extern enum insn_code can_extend_p (enum machine_mode, enum machine_mode, int);
|
||||
|
||||
/* Generate the body of an insn to extend Y (with mode MFROM)
|
||||
into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero. */
|
||||
extern rtx gen_extend_insn PARAMS ((rtx, rtx, enum machine_mode,
|
||||
enum machine_mode, int));
|
||||
extern rtx gen_extend_insn (rtx, rtx, enum machine_mode,
|
||||
enum machine_mode, int);
|
||||
|
||||
/* Initialize the tables that control conversion between fixed and
|
||||
floating values. */
|
||||
extern void init_fixtab PARAMS ((void));
|
||||
extern void init_floattab PARAMS ((void));
|
||||
extern void init_fixtab (void);
|
||||
extern void init_floattab (void);
|
||||
|
||||
/* Generate code for a FLOAT_EXPR. */
|
||||
extern void expand_float PARAMS ((rtx, rtx, int));
|
||||
extern void expand_float (rtx, rtx, int);
|
||||
|
||||
/* Generate code for a FIX_EXPR. */
|
||||
extern void expand_fix PARAMS ((rtx, rtx, int));
|
||||
extern void expand_fix (rtx, rtx, int);
|
||||
|
||||
#endif /* GCC_OPTABS_H */
|
||||
|
273
gcc/output.h
273
gcc/output.h
@ -24,87 +24,87 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#define GCC_OUTPUT_H
|
||||
|
||||
/* Compute branch alignments based on frequency information in the CFG. */
|
||||
extern void compute_alignments PARAMS ((void));
|
||||
extern void compute_alignments (void);
|
||||
|
||||
/* Initialize data in final at the beginning of a compilation. */
|
||||
extern void init_final PARAMS ((const char *));
|
||||
extern void init_final (const char *);
|
||||
|
||||
/* Enable APP processing of subsequent output.
|
||||
Used before the output from an `asm' statement. */
|
||||
extern void app_enable PARAMS ((void));
|
||||
extern void app_enable (void);
|
||||
|
||||
/* Disable APP processing of subsequent output.
|
||||
Called from varasm.c before most kinds of output. */
|
||||
extern void app_disable PARAMS ((void));
|
||||
extern void app_disable (void);
|
||||
|
||||
/* Return the number of slots filled in the current
|
||||
delayed branch sequence (we don't count the insn needing the
|
||||
delay slot). Zero if not in a delayed branch sequence. */
|
||||
extern int dbr_sequence_length PARAMS ((void));
|
||||
extern int dbr_sequence_length (void);
|
||||
|
||||
/* Indicate that branch shortening hasn't yet been done. */
|
||||
extern void init_insn_lengths PARAMS ((void));
|
||||
extern void init_insn_lengths (void);
|
||||
|
||||
/* Obtain the current length of an insn. If branch shortening has been done,
|
||||
get its actual length. Otherwise, get its maximum length. */
|
||||
extern int get_attr_length PARAMS ((rtx));
|
||||
extern int get_attr_length (rtx);
|
||||
|
||||
/* Make a pass over all insns and compute their actual lengths by shortening
|
||||
any branches of variable length if possible. */
|
||||
extern void shorten_branches PARAMS ((rtx));
|
||||
extern void shorten_branches (rtx);
|
||||
|
||||
/* Output assembler code for the start of a function,
|
||||
and initialize some of the variables in this file
|
||||
for the new function. The label for the function and associated
|
||||
assembler pseudo-ops have already been output in
|
||||
`assemble_start_function'. */
|
||||
extern void final_start_function PARAMS ((rtx, FILE *, int));
|
||||
extern void final_start_function (rtx, FILE *, int);
|
||||
|
||||
/* Output assembler code for the end of a function.
|
||||
For clarity, args are same as those of `final_start_function'
|
||||
even though not all of them are needed. */
|
||||
extern void final_end_function PARAMS ((void));
|
||||
extern void final_end_function (void);
|
||||
|
||||
/* Output assembler code for some insns: all or part of a function. */
|
||||
extern void final PARAMS ((rtx, FILE *, int, int));
|
||||
extern void final (rtx, FILE *, int, int);
|
||||
|
||||
/* The final scan for one insn, INSN. Args are same as in `final', except
|
||||
that INSN is the insn being scanned. Value returned is the next insn to
|
||||
be scanned. */
|
||||
extern rtx final_scan_insn PARAMS ((rtx, FILE *, int, int, int));
|
||||
extern rtx final_scan_insn (rtx, FILE *, int, int, int);
|
||||
|
||||
/* Replace a SUBREG with a REG or a MEM, based on the thing it is a
|
||||
subreg of. */
|
||||
extern rtx alter_subreg PARAMS ((rtx *));
|
||||
extern rtx alter_subreg (rtx *);
|
||||
|
||||
/* Report inconsistency between the assembler template and the operands.
|
||||
In an `asm', it's the user's fault; otherwise, the compiler's fault. */
|
||||
extern void output_operand_lossage PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
|
||||
extern void output_operand_lossage (const char *, ...) ATTRIBUTE_PRINTF_1;
|
||||
|
||||
/* Output a string of assembler code, substituting insn operands.
|
||||
Defined in final.c. */
|
||||
extern void output_asm_insn PARAMS ((const char *, rtx *));
|
||||
extern void output_asm_insn (const char *, rtx *);
|
||||
|
||||
/* Compute a worst-case reference address of a branch so that it
|
||||
can be safely used in the presence of aligned labels.
|
||||
Defined in final.c. */
|
||||
extern int insn_current_reference_address PARAMS ((rtx));
|
||||
extern int insn_current_reference_address (rtx);
|
||||
|
||||
/* Find the alignment associated with a CODE_LABEL.
|
||||
Defined in final.c. */
|
||||
extern int label_to_alignment PARAMS ((rtx));
|
||||
extern int label_to_alignment (rtx);
|
||||
|
||||
/* Output a LABEL_REF, or a bare CODE_LABEL, as an assembler symbol. */
|
||||
extern void output_asm_label PARAMS ((rtx));
|
||||
extern void output_asm_label (rtx);
|
||||
|
||||
/* Print a memory reference operand for address X
|
||||
using machine-dependent assembler syntax. */
|
||||
extern void output_address PARAMS ((rtx));
|
||||
extern void output_address (rtx);
|
||||
|
||||
/* Print an integer constant expression in assembler syntax.
|
||||
Addition and subtraction are the only arithmetic
|
||||
that may appear in these expressions. */
|
||||
extern void output_addr_const PARAMS ((FILE *, rtx));
|
||||
extern void output_addr_const (FILE *, rtx);
|
||||
|
||||
/* Output a string of assembler code, substituting numbers, strings
|
||||
and fixed syntactic prefixes. */
|
||||
@ -118,116 +118,116 @@ typedef HOST_WIDE_INT __gcc_host_wide_int__;
|
||||
#define ATTRIBUTE_ASM_FPRINTF(m, n) ATTRIBUTE_NONNULL(m)
|
||||
#endif
|
||||
|
||||
extern void asm_fprintf PARAMS ((FILE *file, const char *p, ...)) ATTRIBUTE_ASM_FPRINTF(2, 3);
|
||||
extern void asm_fprintf (FILE *file, const char *p, ...)
|
||||
ATTRIBUTE_ASM_FPRINTF(2, 3);
|
||||
|
||||
/* Split up a CONST_DOUBLE or integer constant rtx into two rtx's for single
|
||||
words. */
|
||||
extern void split_double PARAMS ((rtx, rtx *, rtx *));
|
||||
extern void split_double (rtx, rtx *, rtx *);
|
||||
|
||||
/* Return nonzero if this function has no function calls. */
|
||||
extern int leaf_function_p PARAMS ((void));
|
||||
extern int leaf_function_p (void);
|
||||
|
||||
/* Return 1 if branch is a forward branch.
|
||||
Uses insn_shuid array, so it works only in the final pass. May be used by
|
||||
output templates to add branch prediction hints, for example. */
|
||||
extern int final_forward_branch_p PARAMS ((rtx));
|
||||
extern int final_forward_branch_p (rtx);
|
||||
|
||||
/* Return 1 if this function uses only the registers that can be
|
||||
safely renumbered. */
|
||||
extern int only_leaf_regs_used PARAMS ((void));
|
||||
extern int only_leaf_regs_used (void);
|
||||
|
||||
/* Scan IN_RTX and its subexpressions, and renumber all regs into those
|
||||
available in leaf functions. */
|
||||
extern void leaf_renumber_regs_insn PARAMS ((rtx));
|
||||
extern void leaf_renumber_regs_insn (rtx);
|
||||
|
||||
/* Locate the proper template for the given insn-code. */
|
||||
extern const char *get_insn_template PARAMS ((int, rtx));
|
||||
extern const char *get_insn_template (int, rtx);
|
||||
|
||||
/* Add function NAME to the weak symbols list. VALUE is a weak alias
|
||||
associated with NAME. */
|
||||
extern int add_weak PARAMS ((tree, const char *, const char *));
|
||||
extern int add_weak (tree, const char *, const char *);
|
||||
|
||||
/* Functions in flow.c */
|
||||
extern void allocate_for_life_analysis PARAMS ((void));
|
||||
extern int regno_uninitialized PARAMS ((unsigned int));
|
||||
extern int regno_clobbered_at_setjmp PARAMS ((int));
|
||||
extern void find_basic_blocks PARAMS ((rtx, int, FILE *));
|
||||
extern bool cleanup_cfg PARAMS ((int));
|
||||
extern bool delete_unreachable_blocks PARAMS ((void));
|
||||
extern void check_function_return_warnings PARAMS ((void));
|
||||
extern void allocate_for_life_analysis (void);
|
||||
extern int regno_uninitialized (unsigned int);
|
||||
extern int regno_clobbered_at_setjmp (int);
|
||||
extern void find_basic_blocks (rtx, int, FILE *);
|
||||
extern bool cleanup_cfg (int);
|
||||
extern bool delete_unreachable_blocks (void);
|
||||
extern void check_function_return_warnings (void);
|
||||
|
||||
/* Functions in varasm.c. */
|
||||
|
||||
/* Tell assembler to switch to text section. */
|
||||
extern void text_section PARAMS ((void));
|
||||
extern void text_section (void);
|
||||
|
||||
/* Tell assembler to switch to data section. */
|
||||
extern void data_section PARAMS ((void));
|
||||
extern void data_section (void);
|
||||
|
||||
/* Tell assembler to switch to read-only data section. This is normally
|
||||
the text section. */
|
||||
extern void readonly_data_section PARAMS ((void));
|
||||
extern void readonly_data_section (void);
|
||||
|
||||
/* Determine if we're in the text section. */
|
||||
extern int in_text_section PARAMS ((void));
|
||||
extern int in_text_section (void);
|
||||
|
||||
#ifdef CTORS_SECTION_ASM_OP
|
||||
extern void ctors_section PARAMS ((void));
|
||||
extern void ctors_section (void);
|
||||
#endif
|
||||
|
||||
#ifdef DTORS_SECTION_ASM_OP
|
||||
extern void dtors_section PARAMS ((void));
|
||||
extern void dtors_section (void);
|
||||
#endif
|
||||
|
||||
#ifdef BSS_SECTION_ASM_OP
|
||||
extern void bss_section PARAMS ((void));
|
||||
extern void bss_section (void);
|
||||
#endif
|
||||
|
||||
#ifdef INIT_SECTION_ASM_OP
|
||||
extern void init_section PARAMS ((void));
|
||||
extern void init_section (void);
|
||||
#endif
|
||||
|
||||
#ifdef FINI_SECTION_ASM_OP
|
||||
extern void fini_section PARAMS ((void));
|
||||
extern void fini_section (void);
|
||||
#endif
|
||||
|
||||
#ifdef EXPORTS_SECTION_ASM_OP
|
||||
extern void exports_section PARAMS ((void));
|
||||
extern void exports_section (void);
|
||||
#endif
|
||||
|
||||
#ifdef DRECTVE_SECTION_ASM_OP
|
||||
extern void drectve_section PARAMS ((void));
|
||||
extern void drectve_section (void);
|
||||
#endif
|
||||
|
||||
#ifdef SDATA_SECTION_ASM_OP
|
||||
extern void sdata_section PARAMS ((void));
|
||||
extern void sdata_section (void);
|
||||
#endif
|
||||
|
||||
/* Tell assembler to change to section NAME for DECL.
|
||||
If DECL is NULL, just switch to section NAME.
|
||||
If NAME is NULL, get the name from DECL.
|
||||
If RELOC is 1, the initializer for DECL contains relocs. */
|
||||
extern void named_section PARAMS ((tree, const char *, int));
|
||||
extern void named_section (tree, const char *, int);
|
||||
|
||||
/* Tell assembler to switch to the section for function DECL. */
|
||||
extern void function_section PARAMS ((tree));
|
||||
extern void function_section (tree);
|
||||
|
||||
/* Tell assembler to switch to the section for string merging. */
|
||||
extern void mergeable_string_section PARAMS ((tree, unsigned HOST_WIDE_INT,
|
||||
unsigned int));
|
||||
extern void mergeable_string_section (tree, unsigned HOST_WIDE_INT,
|
||||
unsigned int);
|
||||
|
||||
/* Tell assembler to switch to the section for constant merging. */
|
||||
extern void mergeable_constant_section PARAMS ((enum machine_mode,
|
||||
unsigned HOST_WIDE_INT,
|
||||
unsigned int));
|
||||
extern void mergeable_constant_section (enum machine_mode,
|
||||
unsigned HOST_WIDE_INT, unsigned int);
|
||||
|
||||
/* Declare DECL to be a weak symbol. */
|
||||
extern void declare_weak PARAMS ((tree));
|
||||
extern void declare_weak (tree);
|
||||
/* Merge weak status. */
|
||||
extern void merge_weak PARAMS ((tree, tree));
|
||||
extern void merge_weak (tree, tree);
|
||||
|
||||
/* Emit any pending weak declarations. */
|
||||
extern void weak_finish PARAMS ((void));
|
||||
extern void weak_finish (void);
|
||||
|
||||
/* Decode an `asm' spec for a declaration as a register name.
|
||||
Return the register number, or -1 if nothing specified,
|
||||
@ -236,29 +236,29 @@ extern void weak_finish PARAMS ((void));
|
||||
or -4 if ASMSPEC is `memory' and is not recognized.
|
||||
Accept an exact spelling or a decimal number.
|
||||
Prefixes such as % are optional. */
|
||||
extern int decode_reg_name PARAMS ((const char *));
|
||||
extern int decode_reg_name (const char *);
|
||||
|
||||
/* Make the rtl for variable VAR be volatile.
|
||||
Use this only for static variables. */
|
||||
extern void make_var_volatile PARAMS ((tree));
|
||||
extern void make_var_volatile (tree);
|
||||
|
||||
extern void assemble_alias PARAMS ((tree, tree));
|
||||
extern void assemble_alias (tree, tree);
|
||||
|
||||
extern void default_assemble_visibility PARAMS ((tree, int));
|
||||
extern void default_assemble_visibility (tree, int);
|
||||
|
||||
/* Output a string of literal assembler code
|
||||
for an `asm' keyword used between functions. */
|
||||
extern void assemble_asm PARAMS ((tree));
|
||||
extern void assemble_asm (tree);
|
||||
|
||||
/* Output assembler code for the constant pool of a function and associated
|
||||
with defining the name of the function. DECL describes the function.
|
||||
NAME is the function's name. For the constant pool, we use the current
|
||||
constant pool data. */
|
||||
extern void assemble_start_function PARAMS ((tree, const char *));
|
||||
extern void assemble_start_function (tree, const char *);
|
||||
|
||||
/* Output assembler code associated with defining the size of the
|
||||
function. DECL describes the function. NAME is the function's name. */
|
||||
extern void assemble_end_function PARAMS ((tree, const char *));
|
||||
extern void assemble_end_function (tree, const char *);
|
||||
|
||||
/* Assemble everything that is needed for a variable or function declaration.
|
||||
Not used for automatic variables, and not used for function definitions.
|
||||
@ -269,36 +269,36 @@ extern void assemble_end_function PARAMS ((tree, const char *));
|
||||
to define things that have had only tentative definitions.
|
||||
DONT_OUTPUT_DATA if nonzero means don't actually output the
|
||||
initial value (that will be done by the caller). */
|
||||
extern void assemble_variable PARAMS ((tree, int, int, int));
|
||||
extern void assemble_variable (tree, int, int, int);
|
||||
|
||||
/* Output something to declare an external symbol to the assembler.
|
||||
(Most assemblers don't need this, so we normally output nothing.)
|
||||
Do nothing if DECL is not external. */
|
||||
extern void assemble_external PARAMS ((tree));
|
||||
extern void assemble_external (tree);
|
||||
|
||||
/* Assemble code to leave SIZE bytes of zeros. */
|
||||
extern void assemble_zeros PARAMS ((unsigned HOST_WIDE_INT));
|
||||
extern void assemble_zeros (unsigned HOST_WIDE_INT);
|
||||
|
||||
/* Assemble an alignment pseudo op for an ALIGN-bit boundary. */
|
||||
extern void assemble_align PARAMS ((int));
|
||||
extern void assemble_eh_align PARAMS ((int));
|
||||
extern void assemble_align (int);
|
||||
extern void assemble_eh_align (int);
|
||||
|
||||
/* Assemble a string constant with the specified C string as contents. */
|
||||
extern void assemble_string PARAMS ((const char *, int));
|
||||
extern void assemble_string (const char *, int);
|
||||
|
||||
/* Similar, for calling a library function FUN. */
|
||||
extern void assemble_external_libcall PARAMS ((rtx));
|
||||
extern void assemble_external_libcall (rtx);
|
||||
|
||||
/* Assemble a label named NAME. */
|
||||
extern void assemble_label PARAMS ((const char *));
|
||||
extern void assemble_eh_label PARAMS ((const char *));
|
||||
extern void assemble_label (const char *);
|
||||
extern void assemble_eh_label (const char *);
|
||||
|
||||
/* Output to FILE a reference to the assembler name of a C-level name NAME.
|
||||
If NAME starts with a *, the rest of NAME is output verbatim.
|
||||
Otherwise NAME is transformed in an implementation-defined way
|
||||
(usually by the addition of an underscore).
|
||||
Many macros in the tm file are defined to call this function. */
|
||||
extern void assemble_name PARAMS ((FILE *, const char *));
|
||||
extern void assemble_name (FILE *, const char *);
|
||||
|
||||
/* Return the assembler directive for creating a given kind of integer
|
||||
object. SIZE is the number of bytes in the object and ALIGNED_P
|
||||
@ -307,20 +307,20 @@ extern void assemble_name PARAMS ((FILE *, const char *));
|
||||
|
||||
The returned string should be printed at the start of a new line and
|
||||
be followed immediately by the object's initial value. */
|
||||
extern const char *integer_asm_op PARAMS ((int, int));
|
||||
extern const char *integer_asm_op (int, int);
|
||||
|
||||
/* Use directive OP to assemble an integer object X. Print OP at the
|
||||
start of the line, followed immediately by the value of X. */
|
||||
extern void assemble_integer_with_op PARAMS ((const char *, rtx));
|
||||
extern void assemble_integer_with_op (const char *, rtx);
|
||||
|
||||
/* The default implementation of the asm_out.integer target hook. */
|
||||
extern bool default_assemble_integer PARAMS ((rtx, unsigned int, int));
|
||||
extern bool default_assemble_integer (rtx, unsigned int, int);
|
||||
|
||||
/* Assemble the integer constant X into an object of SIZE bytes. ALIGN is
|
||||
the alignment of the integer in bits. Return 1 if we were able to output
|
||||
the constant, otherwise 0. If FORCE is nonzero, abort if we can't output
|
||||
the constant. */
|
||||
extern bool assemble_integer PARAMS ((rtx, unsigned, unsigned, int));
|
||||
extern bool assemble_integer (rtx, unsigned, unsigned, int);
|
||||
|
||||
/* An interface to assemble_integer for the common case in which a value is
|
||||
fully aligned and must be printed. VALUE is the value of the integer
|
||||
@ -330,20 +330,18 @@ extern bool assemble_integer PARAMS ((rtx, unsigned, unsigned, int));
|
||||
|
||||
#ifdef REAL_VALUE_TYPE_SIZE
|
||||
/* Assemble the floating-point constant D into an object of size MODE. */
|
||||
extern void assemble_real PARAMS ((REAL_VALUE_TYPE,
|
||||
enum machine_mode,
|
||||
unsigned));
|
||||
extern void assemble_real (REAL_VALUE_TYPE, enum machine_mode, unsigned);
|
||||
#endif
|
||||
|
||||
/* Return the size of the constant pool. */
|
||||
extern int get_pool_size PARAMS ((void));
|
||||
extern int get_pool_size (void);
|
||||
|
||||
#ifdef HAVE_peephole
|
||||
extern rtx peephole PARAMS ((rtx));
|
||||
extern rtx peephole (rtx);
|
||||
#endif
|
||||
|
||||
/* Write all the constants in the constant pool. */
|
||||
extern void output_constant_pool PARAMS ((const char *, tree));
|
||||
extern void output_constant_pool (const char *, tree);
|
||||
|
||||
/* Return nonzero if VALUE is a valid constant-valued expression
|
||||
for use in initializing a static variable; one that can be an
|
||||
@ -354,7 +352,7 @@ extern void output_constant_pool PARAMS ((const char *, tree));
|
||||
We assume that VALUE has been folded as much as possible;
|
||||
therefore, we do not need to check for such things as
|
||||
arithmetic-combinations of integers. */
|
||||
extern tree initializer_constant_valid_p PARAMS ((tree, tree));
|
||||
extern tree initializer_constant_valid_p (tree, tree);
|
||||
|
||||
/* Output assembler code for constant EXP to FILE, with no label.
|
||||
This includes the pseudo-op such as ".int" or ".byte", and a newline.
|
||||
@ -364,8 +362,7 @@ extern tree initializer_constant_valid_p PARAMS ((tree, tree));
|
||||
with zeros if necessary. SIZE must always be specified.
|
||||
|
||||
ALIGN is the alignment in bits that may be assumed for the data. */
|
||||
extern void output_constant PARAMS ((tree, unsigned HOST_WIDE_INT,
|
||||
unsigned int));
|
||||
extern void output_constant (tree, unsigned HOST_WIDE_INT, unsigned int);
|
||||
|
||||
/* When outputting delayed branch sequences, this rtx holds the
|
||||
sequence being output. It is null when no delayed branch
|
||||
@ -437,23 +434,23 @@ extern rtx this_is_asm_operands;
|
||||
|
||||
/* Decide whether DECL needs to be in a writable section.
|
||||
RELOC is the same as for SELECT_SECTION. */
|
||||
extern bool decl_readonly_section PARAMS ((tree, int));
|
||||
extern bool decl_readonly_section_1 PARAMS ((tree, int, int));
|
||||
extern bool decl_readonly_section (tree, int);
|
||||
extern bool decl_readonly_section_1 (tree, int, int);
|
||||
|
||||
/* User label prefix in effect for this compilation. */
|
||||
extern const char *user_label_prefix;
|
||||
|
||||
/* Default target function prologue and epilogue assembler output. */
|
||||
extern void default_function_pro_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
|
||||
extern void default_function_pro_epilogue (FILE *, HOST_WIDE_INT);
|
||||
|
||||
/* Tell assembler to switch to the section for the exception table. */
|
||||
extern void default_exception_section PARAMS ((void));
|
||||
extern void default_exception_section (void);
|
||||
|
||||
/* Tell assembler to switch to the section for the EH frames. */
|
||||
extern void default_eh_frame_section PARAMS ((void));
|
||||
extern void default_eh_frame_section (void);
|
||||
|
||||
/* Default target hook that outputs nothing to a stream. */
|
||||
extern void no_asm_to_stream PARAMS ((FILE *));
|
||||
extern void no_asm_to_stream (FILE *);
|
||||
|
||||
/* Flags controlling properties of a section. */
|
||||
#define SECTION_ENTSIZE 0x000ff /* entity size in section */
|
||||
@ -472,62 +469,54 @@ extern void no_asm_to_stream PARAMS ((FILE *));
|
||||
#define SECTION_NOTYPE 0x80000 /* don't output @progbits */
|
||||
#define SECTION_MACH_DEP 0x100000 /* subsequent bits reserved for target */
|
||||
|
||||
extern unsigned int get_named_section_flags PARAMS ((const char *));
|
||||
extern bool set_named_section_flags PARAMS ((const char *, unsigned int));
|
||||
extern void named_section_flags PARAMS ((const char *, unsigned int));
|
||||
extern bool named_section_first_declaration PARAMS((const char *));
|
||||
extern unsigned int get_named_section_flags (const char *);
|
||||
extern bool set_named_section_flags (const char *, unsigned int);
|
||||
extern void named_section_flags (const char *, unsigned int);
|
||||
extern bool named_section_first_declaration (const char *);
|
||||
|
||||
union tree_node;
|
||||
extern unsigned int default_section_type_flags PARAMS ((union tree_node *,
|
||||
const char *, int));
|
||||
extern unsigned int default_section_type_flags_1 PARAMS ((union tree_node *,
|
||||
const char *,
|
||||
int, int));
|
||||
extern unsigned int default_section_type_flags (union tree_node *,
|
||||
const char *, int);
|
||||
extern unsigned int default_section_type_flags_1 (union tree_node *,
|
||||
const char *, int, int);
|
||||
|
||||
extern void default_no_named_section PARAMS ((const char *, unsigned int));
|
||||
extern void default_elf_asm_named_section PARAMS ((const char *, unsigned int));
|
||||
extern void default_coff_asm_named_section PARAMS ((const char *,
|
||||
unsigned int));
|
||||
extern void default_pe_asm_named_section PARAMS ((const char *, unsigned int));
|
||||
extern void default_no_named_section (const char *, unsigned int);
|
||||
extern void default_elf_asm_named_section (const char *, unsigned int);
|
||||
extern void default_coff_asm_named_section (const char *, unsigned int);
|
||||
extern void default_pe_asm_named_section (const char *, unsigned int);
|
||||
|
||||
extern void default_stabs_asm_out_destructor PARAMS ((struct rtx_def *, int));
|
||||
extern void default_named_section_asm_out_destructor PARAMS ((struct rtx_def *,
|
||||
int));
|
||||
extern void default_dtor_section_asm_out_destructor PARAMS ((struct rtx_def *,
|
||||
int));
|
||||
extern void default_stabs_asm_out_constructor PARAMS ((struct rtx_def *, int));
|
||||
extern void default_named_section_asm_out_constructor PARAMS ((struct rtx_def *,
|
||||
int));
|
||||
extern void default_ctor_section_asm_out_constructor PARAMS ((struct rtx_def *,
|
||||
int));
|
||||
extern void default_stabs_asm_out_destructor (struct rtx_def *, int);
|
||||
extern void default_named_section_asm_out_destructor (struct rtx_def *, int);
|
||||
extern void default_dtor_section_asm_out_destructor (struct rtx_def *, int);
|
||||
extern void default_stabs_asm_out_constructor (struct rtx_def *, int);
|
||||
extern void default_named_section_asm_out_constructor (struct rtx_def *,
|
||||
int);
|
||||
extern void default_ctor_section_asm_out_constructor (struct rtx_def *, int);
|
||||
|
||||
extern void default_select_section PARAMS ((tree, int,
|
||||
unsigned HOST_WIDE_INT));
|
||||
extern void default_elf_select_section PARAMS ((tree, int,
|
||||
unsigned HOST_WIDE_INT));
|
||||
extern void default_elf_select_section_1 PARAMS ((tree, int,
|
||||
unsigned HOST_WIDE_INT, int));
|
||||
extern void default_unique_section PARAMS ((tree, int));
|
||||
extern void default_unique_section_1 PARAMS ((tree, int, int));
|
||||
extern void default_select_rtx_section PARAMS ((enum machine_mode, rtx,
|
||||
unsigned HOST_WIDE_INT));
|
||||
extern void default_elf_select_rtx_section PARAMS ((enum machine_mode, rtx,
|
||||
unsigned HOST_WIDE_INT));
|
||||
extern void default_encode_section_info PARAMS ((tree, rtx, int));
|
||||
extern const char *default_strip_name_encoding PARAMS ((const char *));
|
||||
extern bool default_binds_local_p PARAMS ((tree));
|
||||
extern bool default_binds_local_p_1 PARAMS ((tree, int));
|
||||
extern void default_globalize_label PARAMS ((FILE *, const char *));
|
||||
extern void default_internal_label PARAMS ((FILE *, const char *, unsigned long));
|
||||
extern void default_file_start PARAMS ((void));
|
||||
extern void file_end_indicate_exec_stack PARAMS ((void));
|
||||
extern bool default_valid_pointer_mode PARAMS ((enum machine_mode));
|
||||
extern void default_select_section (tree, int, unsigned HOST_WIDE_INT);
|
||||
extern void default_elf_select_section (tree, int, unsigned HOST_WIDE_INT);
|
||||
extern void default_elf_select_section_1 (tree, int,
|
||||
unsigned HOST_WIDE_INT, int);
|
||||
extern void default_unique_section (tree, int);
|
||||
extern void default_unique_section_1 (tree, int, int);
|
||||
extern void default_select_rtx_section (enum machine_mode, rtx,
|
||||
unsigned HOST_WIDE_INT);
|
||||
extern void default_elf_select_rtx_section (enum machine_mode, rtx,
|
||||
unsigned HOST_WIDE_INT);
|
||||
extern void default_encode_section_info (tree, rtx, int);
|
||||
extern const char *default_strip_name_encoding (const char *);
|
||||
extern bool default_binds_local_p (tree);
|
||||
extern bool default_binds_local_p_1 (tree, int);
|
||||
extern void default_globalize_label (FILE *, const char *);
|
||||
extern void default_internal_label (FILE *, const char *, unsigned long);
|
||||
extern void default_file_start (void);
|
||||
extern void file_end_indicate_exec_stack (void);
|
||||
extern bool default_valid_pointer_mode (enum machine_mode);
|
||||
|
||||
/* Emit data for vtable gc for GNU binutils. */
|
||||
extern void assemble_vtable_entry PARAMS ((struct rtx_def *, HOST_WIDE_INT));
|
||||
extern void assemble_vtable_inherit PARAMS ((struct rtx_def *,
|
||||
struct rtx_def *));
|
||||
extern void assemble_vtable_entry (struct rtx_def *, HOST_WIDE_INT);
|
||||
extern void assemble_vtable_inherit (struct rtx_def *, struct rtx_def *);
|
||||
|
||||
extern int default_address_cost PARAMS ((rtx));
|
||||
extern int default_address_cost (rtx);
|
||||
|
||||
#endif /* ! GCC_OUTPUT_H */
|
||||
|
@ -45,24 +45,23 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#include "except.h"
|
||||
#include "tree.h"
|
||||
|
||||
static int reload_cse_noop_set_p PARAMS ((rtx));
|
||||
static void reload_cse_simplify PARAMS ((rtx, rtx));
|
||||
static void reload_cse_regs_1 PARAMS ((rtx));
|
||||
static int reload_cse_simplify_set PARAMS ((rtx, rtx));
|
||||
static int reload_cse_simplify_operands PARAMS ((rtx, rtx));
|
||||
static int reload_cse_noop_set_p (rtx);
|
||||
static void reload_cse_simplify (rtx, rtx);
|
||||
static void reload_cse_regs_1 (rtx);
|
||||
static int reload_cse_simplify_set (rtx, rtx);
|
||||
static int reload_cse_simplify_operands (rtx, rtx);
|
||||
|
||||
static void reload_combine PARAMS ((void));
|
||||
static void reload_combine_note_use PARAMS ((rtx *, rtx));
|
||||
static void reload_combine_note_store PARAMS ((rtx, rtx, void *));
|
||||
static void reload_combine (void);
|
||||
static void reload_combine_note_use (rtx *, rtx);
|
||||
static void reload_combine_note_store (rtx, rtx, void *);
|
||||
|
||||
static void reload_cse_move2add PARAMS ((rtx));
|
||||
static void move2add_note_store PARAMS ((rtx, rtx, void *));
|
||||
static void reload_cse_move2add (rtx);
|
||||
static void move2add_note_store (rtx, rtx, void *);
|
||||
|
||||
/* Call cse / combine like post-reload optimization phases.
|
||||
FIRST is the first instruction. */
|
||||
void
|
||||
reload_cse_regs (first)
|
||||
rtx first ATTRIBUTE_UNUSED;
|
||||
reload_cse_regs (rtx first ATTRIBUTE_UNUSED)
|
||||
{
|
||||
reload_cse_regs_1 (first);
|
||||
reload_combine ();
|
||||
@ -73,8 +72,7 @@ reload_cse_regs (first)
|
||||
|
||||
/* See whether a single set SET is a noop. */
|
||||
static int
|
||||
reload_cse_noop_set_p (set)
|
||||
rtx set;
|
||||
reload_cse_noop_set_p (rtx set)
|
||||
{
|
||||
if (cselib_reg_set_mode (SET_DEST (set)) != GET_MODE (SET_DEST (set)))
|
||||
return 0;
|
||||
@ -84,9 +82,7 @@ reload_cse_noop_set_p (set)
|
||||
|
||||
/* Try to simplify INSN. */
|
||||
static void
|
||||
reload_cse_simplify (insn, testreg)
|
||||
rtx insn;
|
||||
rtx testreg;
|
||||
reload_cse_simplify (rtx insn, rtx testreg)
|
||||
{
|
||||
rtx body = PATTERN (insn);
|
||||
|
||||
@ -180,8 +176,7 @@ reload_cse_simplify (insn, testreg)
|
||||
if possible, much like an optional reload would. */
|
||||
|
||||
static void
|
||||
reload_cse_regs_1 (first)
|
||||
rtx first;
|
||||
reload_cse_regs_1 (rtx first)
|
||||
{
|
||||
rtx insn;
|
||||
rtx testreg = gen_rtx_REG (VOIDmode, -1);
|
||||
@ -209,9 +204,7 @@ reload_cse_regs_1 (first)
|
||||
and change the set into a register copy. */
|
||||
|
||||
static int
|
||||
reload_cse_simplify_set (set, insn)
|
||||
rtx set;
|
||||
rtx insn;
|
||||
reload_cse_simplify_set (rtx set, rtx insn)
|
||||
{
|
||||
int did_change = 0;
|
||||
int dreg;
|
||||
@ -354,9 +347,7 @@ reload_cse_simplify_set (set, insn)
|
||||
hard registers. */
|
||||
|
||||
static int
|
||||
reload_cse_simplify_operands (insn, testreg)
|
||||
rtx insn;
|
||||
rtx testreg;
|
||||
reload_cse_simplify_operands (rtx insn, rtx testreg)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@ -629,7 +620,7 @@ static int reload_combine_ruid;
|
||||
(label_live[CODE_LABEL_NUMBER (LABEL) - min_labelno])
|
||||
|
||||
static void
|
||||
reload_combine ()
|
||||
reload_combine (void)
|
||||
{
|
||||
rtx insn, set;
|
||||
int first_index_reg = -1;
|
||||
@ -922,9 +913,7 @@ reload_combine ()
|
||||
accordingly. Called via note_stores from reload_combine. */
|
||||
|
||||
static void
|
||||
reload_combine_note_store (dst, set, data)
|
||||
rtx dst, set;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
reload_combine_note_store (rtx dst, rtx set, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int regno = 0;
|
||||
int i;
|
||||
@ -972,8 +961,7 @@ reload_combine_note_store (dst, set, data)
|
||||
*XP is the pattern of INSN, or a part of it.
|
||||
Called from reload_combine, and recursively by itself. */
|
||||
static void
|
||||
reload_combine_note_use (xp, insn)
|
||||
rtx *xp, insn;
|
||||
reload_combine_note_use (rtx *xp, rtx insn)
|
||||
{
|
||||
rtx x = *xp;
|
||||
enum rtx_code code = x->code;
|
||||
@ -1131,8 +1119,7 @@ static int move2add_last_label_luid;
|
||||
GET_MODE_BITSIZE (INMODE))))
|
||||
|
||||
static void
|
||||
reload_cse_move2add (first)
|
||||
rtx first;
|
||||
reload_cse_move2add (rtx first)
|
||||
{
|
||||
int i;
|
||||
rtx insn;
|
||||
@ -1374,9 +1361,7 @@ reload_cse_move2add (first)
|
||||
Called from reload_cse_move2add via note_stores. */
|
||||
|
||||
static void
|
||||
move2add_note_store (dst, set, data)
|
||||
rtx dst, set;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
move2add_note_store (rtx dst, rtx set, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
unsigned int regno = 0;
|
||||
unsigned int i;
|
||||
|
37
gcc/prefix.c
37
gcc/prefix.c
@ -1,5 +1,5 @@
|
||||
/* Utility to update paths from internal to external forms.
|
||||
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
|
||||
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
@ -76,21 +76,20 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
static const char *std_prefix = PREFIX;
|
||||
|
||||
static const char *get_key_value PARAMS ((char *));
|
||||
static char *translate_name PARAMS ((char *));
|
||||
static char *save_string PARAMS ((const char *, int));
|
||||
static void tr PARAMS ((char *, int, int));
|
||||
static const char *get_key_value (char *);
|
||||
static char *translate_name (char *);
|
||||
static char *save_string (const char *, int);
|
||||
static void tr (char *, int, int);
|
||||
|
||||
#if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
|
||||
static char *lookup_key PARAMS ((char *));
|
||||
static char *lookup_key (char *);
|
||||
static HKEY reg_key = (HKEY) INVALID_HANDLE_VALUE;
|
||||
#endif
|
||||
|
||||
/* Given KEY, as above, return its value. */
|
||||
|
||||
static const char *
|
||||
get_key_value (key)
|
||||
char *key;
|
||||
get_key_value (char *key)
|
||||
{
|
||||
const char *prefix = 0;
|
||||
char *temp = 0;
|
||||
@ -114,9 +113,7 @@ get_key_value (key)
|
||||
/* Return a copy of a string that has been placed in the heap. */
|
||||
|
||||
static char *
|
||||
save_string (s, len)
|
||||
const char *s;
|
||||
int len;
|
||||
save_string (const char *s, int len)
|
||||
{
|
||||
char *result = xmalloc (len + 1);
|
||||
|
||||
@ -130,8 +127,7 @@ save_string (s, len)
|
||||
/* Look up "key" in the registry, as above. */
|
||||
|
||||
static char *
|
||||
lookup_key (key)
|
||||
char *key;
|
||||
lookup_key (char *key)
|
||||
{
|
||||
char *dst;
|
||||
DWORD size;
|
||||
@ -183,8 +179,7 @@ lookup_key (key)
|
||||
Otherwise, return the given name. */
|
||||
|
||||
static char *
|
||||
translate_name (name)
|
||||
char *name;
|
||||
translate_name (char *name)
|
||||
{
|
||||
char code;
|
||||
char *key, *old_name;
|
||||
@ -233,9 +228,7 @@ translate_name (name)
|
||||
|
||||
/* In a NUL-terminated STRING, replace character C1 with C2 in-place. */
|
||||
static void
|
||||
tr (string, c1, c2)
|
||||
char *string;
|
||||
int c1, c2;
|
||||
tr (char *string, int c1, int c2)
|
||||
{
|
||||
do
|
||||
{
|
||||
@ -250,9 +243,7 @@ tr (string, c1, c2)
|
||||
freeing it. */
|
||||
|
||||
char *
|
||||
update_path (path, key)
|
||||
const char *path;
|
||||
const char *key;
|
||||
update_path (const char *path, const char *key)
|
||||
{
|
||||
char *result, *p;
|
||||
|
||||
@ -352,9 +343,7 @@ update_path (path, key)
|
||||
|
||||
/* Reset the standard prefix. */
|
||||
void
|
||||
set_std_prefix (prefix, len)
|
||||
const char *prefix;
|
||||
int len;
|
||||
set_std_prefix (const char *prefix, int len)
|
||||
{
|
||||
std_prefix = save_string (prefix, len);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Provide prototypes for functions exported from prefix.c.
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */
|
||||
/* Update PATH using KEY if PATH starts with PREFIX. The returned
|
||||
string is always malloc-ed, and the caller is responsible for
|
||||
freeing it. */
|
||||
extern char *update_path PARAMS ((const char *path, const char *key));
|
||||
extern void set_std_prefix PARAMS ((const char *, int));
|
||||
extern char *update_path (const char *path, const char *key);
|
||||
extern void set_std_prefix (const char *, int);
|
||||
|
||||
#endif /* ! GCC_PREFIX_H */
|
||||
|
@ -58,7 +58,7 @@ static int sawclose = 0;
|
||||
|
||||
static int indent;
|
||||
|
||||
static void print_rtx PARAMS ((rtx));
|
||||
static void print_rtx (rtx);
|
||||
|
||||
/* String printed at beginning of each RTL when it is dumped.
|
||||
This string is set to ASM_COMMENT_START when the RTL is dumped in
|
||||
@ -80,9 +80,7 @@ int dump_for_graph;
|
||||
static int debug_call_placeholder_verbose;
|
||||
|
||||
void
|
||||
print_mem_expr (outfile, expr)
|
||||
FILE *outfile;
|
||||
tree expr;
|
||||
print_mem_expr (FILE *outfile, tree expr)
|
||||
{
|
||||
if (TREE_CODE (expr) == COMPONENT_REF)
|
||||
{
|
||||
@ -111,8 +109,7 @@ print_mem_expr (outfile, expr)
|
||||
/* Print IN_RTX onto OUTFILE. This is the recursive part of printing. */
|
||||
|
||||
static void
|
||||
print_rtx (in_rtx)
|
||||
rtx in_rtx;
|
||||
print_rtx (rtx in_rtx)
|
||||
{
|
||||
int i = 0;
|
||||
int j;
|
||||
@ -638,10 +635,7 @@ print_rtx (in_rtx)
|
||||
characters. */
|
||||
|
||||
void
|
||||
print_inline_rtx (outf, x, ind)
|
||||
FILE *outf;
|
||||
rtx x;
|
||||
int ind;
|
||||
print_inline_rtx (FILE *outf, rtx x, int ind)
|
||||
{
|
||||
int oldsaw = sawclose;
|
||||
int oldindent = indent;
|
||||
@ -657,8 +651,7 @@ print_inline_rtx (outf, x, ind)
|
||||
/* Call this function from the debugger to see what X looks like. */
|
||||
|
||||
void
|
||||
debug_rtx (x)
|
||||
rtx x;
|
||||
debug_rtx (rtx x)
|
||||
{
|
||||
outfile = stderr;
|
||||
sawclose = 0;
|
||||
@ -678,9 +671,7 @@ int debug_rtx_count = 0; /* 0 is treated as equivalent to 1 */
|
||||
EG: -5 prints 2 rtx's on either side (in addition to the specified rtx). */
|
||||
|
||||
void
|
||||
debug_rtx_list (x, n)
|
||||
rtx x;
|
||||
int n;
|
||||
debug_rtx_list (rtx x, int n)
|
||||
{
|
||||
int i,count;
|
||||
rtx insn;
|
||||
@ -707,8 +698,7 @@ debug_rtx_list (x, n)
|
||||
/* Call this function to print an rtx list from START to END inclusive. */
|
||||
|
||||
void
|
||||
debug_rtx_range (start, end)
|
||||
rtx start, end;
|
||||
debug_rtx_range (rtx start, rtx end)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
@ -725,9 +715,7 @@ debug_rtx_range (start, end)
|
||||
The found insn is returned to enable further debugging analysis. */
|
||||
|
||||
rtx
|
||||
debug_rtx_find (x, uid)
|
||||
rtx x;
|
||||
int uid;
|
||||
debug_rtx_find (rtx x, int uid)
|
||||
{
|
||||
while (x != 0 && INSN_UID (x) != uid)
|
||||
x = NEXT_INSN (x);
|
||||
@ -750,9 +738,7 @@ debug_rtx_find (x, uid)
|
||||
If RTX_FIRST is not an insn, then it alone is printed, with no newline. */
|
||||
|
||||
void
|
||||
print_rtl (outf, rtx_first)
|
||||
FILE *outf;
|
||||
rtx rtx_first;
|
||||
print_rtl (FILE *outf, rtx rtx_first)
|
||||
{
|
||||
rtx tmp_rtx;
|
||||
|
||||
@ -793,9 +779,7 @@ print_rtl (outf, rtx_first)
|
||||
/* Return nonzero if we actually printed anything. */
|
||||
|
||||
int
|
||||
print_rtl_single (outf, x)
|
||||
FILE *outf;
|
||||
rtx x;
|
||||
print_rtl_single (FILE *outf, rtx x)
|
||||
{
|
||||
outfile = outf;
|
||||
sawclose = 0;
|
||||
@ -815,9 +799,7 @@ print_rtl_single (outf, x)
|
||||
if RTX is a CONST_INT then print in decimal format. */
|
||||
|
||||
void
|
||||
print_simple_rtl (outf, x)
|
||||
FILE *outf;
|
||||
rtx x;
|
||||
print_simple_rtl (FILE *outf, rtx x)
|
||||
{
|
||||
flag_simple = 1;
|
||||
print_rtl (outf, x);
|
||||
|
@ -47,8 +47,7 @@ static struct bucket **table;
|
||||
down to a depth of six. */
|
||||
|
||||
void
|
||||
debug_tree (node)
|
||||
tree node;
|
||||
debug_tree (tree node)
|
||||
{
|
||||
table = (struct bucket **) xcalloc (HASH_SIZE, sizeof (struct bucket *));
|
||||
print_node (stderr, "", node, 0);
|
||||
@ -60,11 +59,7 @@ debug_tree (node)
|
||||
/* Print a node in brief fashion, with just the code, address and name. */
|
||||
|
||||
void
|
||||
print_node_brief (file, prefix, node, indent)
|
||||
FILE *file;
|
||||
const char *prefix;
|
||||
tree node;
|
||||
int indent;
|
||||
print_node_brief (FILE *file, const char *prefix, tree node, int indent)
|
||||
{
|
||||
char class;
|
||||
|
||||
@ -141,9 +136,7 @@ print_node_brief (file, prefix, node, indent)
|
||||
}
|
||||
|
||||
void
|
||||
indent_to (file, column)
|
||||
FILE *file;
|
||||
int column;
|
||||
indent_to (FILE *file, int column)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -158,11 +151,7 @@ indent_to (file, column)
|
||||
starting in column INDENT. */
|
||||
|
||||
void
|
||||
print_node (file, prefix, node, indent)
|
||||
FILE *file;
|
||||
const char *prefix;
|
||||
tree node;
|
||||
int indent;
|
||||
print_node (FILE *file, const char *prefix, tree node, int indent)
|
||||
{
|
||||
int hash;
|
||||
struct bucket *b;
|
||||
|
111
gcc/profile.c
111
gcc/profile.c
@ -66,10 +66,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
/* Additional information about the edges we need. */
|
||||
struct edge_info {
|
||||
unsigned int count_valid : 1;
|
||||
|
||||
|
||||
/* Is on the spanning tree. */
|
||||
unsigned int on_tree : 1;
|
||||
|
||||
|
||||
/* Pretend this edge does not exist (it is abnormal and we've
|
||||
inserted a fake to compensate). */
|
||||
unsigned int ignore : 1;
|
||||
@ -105,18 +105,21 @@ static int total_num_never_executed;
|
||||
static int total_num_branches;
|
||||
|
||||
/* Forward declarations. */
|
||||
static void find_spanning_tree PARAMS ((struct edge_list *));
|
||||
static rtx gen_edge_profiler PARAMS ((int));
|
||||
static rtx gen_interval_profiler (struct histogram_value *, unsigned, unsigned);
|
||||
static void find_spanning_tree (struct edge_list *);
|
||||
static rtx gen_edge_profiler (int);
|
||||
static rtx gen_interval_profiler (struct histogram_value *, unsigned,
|
||||
unsigned);
|
||||
static rtx gen_pow2_profiler (struct histogram_value *, unsigned, unsigned);
|
||||
static rtx gen_one_value_profiler (struct histogram_value *, unsigned, unsigned);
|
||||
static rtx gen_const_delta_profiler (struct histogram_value *, unsigned, unsigned);
|
||||
static unsigned instrument_edges PARAMS ((struct edge_list *));
|
||||
static rtx gen_one_value_profiler (struct histogram_value *, unsigned,
|
||||
unsigned);
|
||||
static rtx gen_const_delta_profiler (struct histogram_value *, unsigned,
|
||||
unsigned);
|
||||
static unsigned instrument_edges (struct edge_list *);
|
||||
static void instrument_values (unsigned, struct histogram_value *);
|
||||
static void compute_branch_probabilities PARAMS ((void));
|
||||
static gcov_type * get_exec_counts PARAMS ((void));
|
||||
static basic_block find_group PARAMS ((basic_block));
|
||||
static void union_groups PARAMS ((basic_block, basic_block));
|
||||
static void compute_branch_probabilities (void);
|
||||
static gcov_type * get_exec_counts (void);
|
||||
static basic_block find_group (basic_block);
|
||||
static void union_groups (basic_block, basic_block);
|
||||
|
||||
|
||||
/* Add edge instrumentation code to the entire insn chain.
|
||||
@ -125,13 +128,12 @@ static void union_groups PARAMS ((basic_block, basic_block));
|
||||
NUM_BLOCKS is the number of basic blocks found in F. */
|
||||
|
||||
static unsigned
|
||||
instrument_edges (el)
|
||||
struct edge_list *el;
|
||||
instrument_edges (struct edge_list *el)
|
||||
{
|
||||
unsigned num_instr_edges = 0;
|
||||
int num_edges = NUM_EDGES (el);
|
||||
basic_block bb;
|
||||
|
||||
|
||||
remove_fake_edges ();
|
||||
|
||||
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
|
||||
@ -141,11 +143,11 @@ instrument_edges (el)
|
||||
for (e = bb->succ; e; e = e->succ_next)
|
||||
{
|
||||
struct edge_info *inf = EDGE_INFO (e);
|
||||
|
||||
|
||||
if (!inf->ignore && !inf->on_tree)
|
||||
{
|
||||
rtx edge_profile;
|
||||
|
||||
|
||||
if (e->flags & EDGE_ABNORMAL)
|
||||
abort ();
|
||||
if (rtl_dump_file)
|
||||
@ -172,7 +174,7 @@ instrument_values (unsigned n_values, struct histogram_value *values)
|
||||
rtx sequence;
|
||||
unsigned i, t;
|
||||
edge e;
|
||||
|
||||
|
||||
/* Emit code to generate the histograms before the insns. */
|
||||
|
||||
for (i = 0; i < n_values; i++)
|
||||
@ -233,12 +235,12 @@ instrument_values (unsigned n_values, struct histogram_value *values)
|
||||
/* Computes hybrid profile for all matching entries in da_file. */
|
||||
|
||||
static gcov_type *
|
||||
get_exec_counts ()
|
||||
get_exec_counts (void)
|
||||
{
|
||||
unsigned num_edges = 0;
|
||||
basic_block bb;
|
||||
gcov_type *counts;
|
||||
|
||||
|
||||
/* Count the edges to be (possibly) instrumented. */
|
||||
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
|
||||
{
|
||||
@ -264,7 +266,7 @@ get_exec_counts ()
|
||||
Annotate them accordingly. */
|
||||
|
||||
static void
|
||||
compute_branch_probabilities ()
|
||||
compute_branch_probabilities (void)
|
||||
{
|
||||
basic_block bb;
|
||||
int i;
|
||||
@ -616,7 +618,7 @@ compute_branch_probabilities ()
|
||||
Main entry point of this file. */
|
||||
|
||||
void
|
||||
branch_prob ()
|
||||
branch_prob (void)
|
||||
{
|
||||
basic_block bb;
|
||||
unsigned i;
|
||||
@ -716,7 +718,7 @@ branch_prob ()
|
||||
as possible to minimize number of edge splits necessary. */
|
||||
|
||||
find_spanning_tree (el);
|
||||
|
||||
|
||||
/* Fake edges that are not on the tree will not be instrumented, so
|
||||
mark them ignored. */
|
||||
for (num_instrumented = i = 0; i < num_edges; i++)
|
||||
@ -754,7 +756,7 @@ branch_prob ()
|
||||
if (coverage_begin_output ())
|
||||
{
|
||||
gcov_position_t offset;
|
||||
|
||||
|
||||
offset = gcov_write_tag (GCOV_TAG_BLOCKS);
|
||||
for (i = 0; i != (unsigned) (n_basic_blocks + 2); i++)
|
||||
gcov_write_unsigned (0);
|
||||
@ -767,7 +769,7 @@ branch_prob ()
|
||||
ENTRY_BLOCK_PTR->index = -1;
|
||||
EXIT_BLOCK_PTR->index = last_basic_block;
|
||||
#define BB_TO_GCOV_INDEX(bb) ((bb)->index + 1)
|
||||
|
||||
|
||||
/* Arcs */
|
||||
if (coverage_begin_output ())
|
||||
{
|
||||
@ -779,14 +781,14 @@ branch_prob ()
|
||||
|
||||
offset = gcov_write_tag (GCOV_TAG_ARCS);
|
||||
gcov_write_unsigned (BB_TO_GCOV_INDEX (bb));
|
||||
|
||||
|
||||
for (e = bb->succ; e; e = e->succ_next)
|
||||
{
|
||||
struct edge_info *i = EDGE_INFO (e);
|
||||
if (!i->ignore)
|
||||
{
|
||||
unsigned flag_bits = 0;
|
||||
|
||||
|
||||
if (i->on_tree)
|
||||
flag_bits |= GCOV_ARC_ON_TREE;
|
||||
if (e->flags & EDGE_FAKE)
|
||||
@ -802,20 +804,20 @@ branch_prob ()
|
||||
gcov_write_length (offset);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Line numbers. */
|
||||
if (coverage_begin_output ())
|
||||
{
|
||||
char const *prev_file_name = NULL;
|
||||
gcov_position_t offset;
|
||||
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
rtx insn = bb->head;
|
||||
int ignore_next_note = 0;
|
||||
|
||||
|
||||
offset = 0;
|
||||
|
||||
|
||||
/* We are looking for line number notes. Search backward
|
||||
before basic block to find correct ones. */
|
||||
insn = prev_nonnote_insn (insn);
|
||||
@ -823,7 +825,7 @@ branch_prob ()
|
||||
insn = get_insns ();
|
||||
else
|
||||
insn = NEXT_INSN (insn);
|
||||
|
||||
|
||||
while (insn != bb->end)
|
||||
{
|
||||
if (GET_CODE (insn) == NOTE)
|
||||
@ -846,7 +848,7 @@ branch_prob ()
|
||||
offset = gcov_write_tag (GCOV_TAG_LINES);
|
||||
gcov_write_unsigned (BB_TO_GCOV_INDEX (bb));
|
||||
}
|
||||
|
||||
|
||||
/* If this is a new source file, then output the
|
||||
file's name to the .bb file. */
|
||||
if (!prev_file_name
|
||||
@ -862,7 +864,7 @@ branch_prob ()
|
||||
}
|
||||
insn = NEXT_INSN (insn);
|
||||
}
|
||||
|
||||
|
||||
if (offset)
|
||||
{
|
||||
/* A file of NULL indicates the end of run. */
|
||||
@ -920,8 +922,7 @@ branch_prob ()
|
||||
aux fields. */
|
||||
|
||||
static basic_block
|
||||
find_group (bb)
|
||||
basic_block bb;
|
||||
find_group (basic_block bb)
|
||||
{
|
||||
basic_block group = bb, bb1;
|
||||
|
||||
@ -939,8 +940,7 @@ find_group (bb)
|
||||
}
|
||||
|
||||
static void
|
||||
union_groups (bb1, bb2)
|
||||
basic_block bb1, bb2;
|
||||
union_groups (basic_block bb1, basic_block bb2)
|
||||
{
|
||||
basic_block bb1g = find_group (bb1);
|
||||
basic_block bb2g = find_group (bb2);
|
||||
@ -961,8 +961,7 @@ union_groups (bb1, bb2)
|
||||
are more expensive to instrument. */
|
||||
|
||||
static void
|
||||
find_spanning_tree (el)
|
||||
struct edge_list *el;
|
||||
find_spanning_tree (struct edge_list *el)
|
||||
{
|
||||
int i;
|
||||
int num_edges = NUM_EDGES (el);
|
||||
@ -1031,7 +1030,7 @@ find_spanning_tree (el)
|
||||
/* Perform file-level initialization for branch-prob processing. */
|
||||
|
||||
void
|
||||
init_branch_prob ()
|
||||
init_branch_prob (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1052,7 +1051,7 @@ init_branch_prob ()
|
||||
is completed. */
|
||||
|
||||
void
|
||||
end_branch_prob ()
|
||||
end_branch_prob (void)
|
||||
{
|
||||
if (rtl_dump_file)
|
||||
{
|
||||
@ -1092,8 +1091,7 @@ end_branch_prob ()
|
||||
/* Output instructions as RTL to increment the edge execution count. */
|
||||
|
||||
static rtx
|
||||
gen_edge_profiler (edgeno)
|
||||
int edgeno;
|
||||
gen_edge_profiler (int edgeno)
|
||||
{
|
||||
rtx ref = coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno);
|
||||
rtx tmp;
|
||||
@ -1119,8 +1117,8 @@ gen_edge_profiler (edgeno)
|
||||
section for counters, BASE is offset of the counter position. */
|
||||
|
||||
static rtx
|
||||
gen_interval_profiler (struct histogram_value *value,
|
||||
unsigned tag, unsigned base)
|
||||
gen_interval_profiler (struct histogram_value *value, unsigned tag,
|
||||
unsigned base)
|
||||
{
|
||||
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
|
||||
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
|
||||
@ -1175,7 +1173,7 @@ gen_interval_profiler (struct histogram_value *value,
|
||||
emit_label (more_label);
|
||||
tmp1 = expand_simple_binop (Pmode, PLUS, copy_rtx (tmp),
|
||||
GEN_INT (per_counter * value->hdata.intvl.steps),
|
||||
mr, 0, OPTAB_WIDEN);
|
||||
mr, 0, OPTAB_WIDEN);
|
||||
if (tmp1 != mr)
|
||||
emit_move_insn (copy_rtx (mr), tmp1);
|
||||
if (value->hdata.intvl.may_be_less)
|
||||
@ -1220,8 +1218,7 @@ gen_interval_profiler (struct histogram_value *value,
|
||||
section for counters, BASE is offset of the counter position. */
|
||||
|
||||
static rtx
|
||||
gen_pow2_profiler (struct histogram_value *value,
|
||||
unsigned tag, unsigned base)
|
||||
gen_pow2_profiler (struct histogram_value *value, unsigned tag, unsigned base)
|
||||
{
|
||||
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
|
||||
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
|
||||
@ -1254,7 +1251,7 @@ gen_pow2_profiler (struct histogram_value *value,
|
||||
tmp = expand_simple_binop (value->mode, AND, copy_rtx (uval), tmp,
|
||||
NULL_RTX, 0, OPTAB_WIDEN);
|
||||
do_compare_rtx_and_jump (tmp, const0_rtx, NE, 0, value->mode, NULL_RTX,
|
||||
NULL_RTX, end_of_code_label);
|
||||
NULL_RTX, end_of_code_label);
|
||||
}
|
||||
|
||||
/* Count log_2(value). */
|
||||
@ -1294,8 +1291,8 @@ gen_pow2_profiler (struct histogram_value *value,
|
||||
section for counters, BASE is offset of the counter position. */
|
||||
|
||||
static rtx
|
||||
gen_one_value_profiler (struct histogram_value *value,
|
||||
unsigned tag, unsigned base)
|
||||
gen_one_value_profiler (struct histogram_value *value, unsigned tag,
|
||||
unsigned base)
|
||||
{
|
||||
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
|
||||
enum machine_mode mode = mode_for_size (gcov_size, MODE_INT, 0);
|
||||
@ -1324,7 +1321,7 @@ gen_one_value_profiler (struct histogram_value *value,
|
||||
/* Check if the stored value matches. */
|
||||
do_compare_rtx_and_jump (copy_rtx (uval), copy_rtx (stored_value), EQ,
|
||||
0, mode, NULL_RTX, NULL_RTX, same_label);
|
||||
|
||||
|
||||
/* Does not match; check whether the counter is zero. */
|
||||
do_compare_rtx_and_jump (copy_rtx (counter), const0_rtx, EQ, 0, mode,
|
||||
NULL_RTX, NULL_RTX, zero_label);
|
||||
@ -1338,7 +1335,7 @@ gen_one_value_profiler (struct histogram_value *value,
|
||||
|
||||
emit_jump_insn (gen_jump (end_of_code_label));
|
||||
emit_barrier ();
|
||||
|
||||
|
||||
emit_label (zero_label);
|
||||
/* Set new value. */
|
||||
emit_move_insn (copy_rtx (stored_value), copy_rtx (uval));
|
||||
@ -1350,7 +1347,7 @@ gen_one_value_profiler (struct histogram_value *value,
|
||||
|
||||
if (tmp != counter)
|
||||
emit_move_insn (copy_rtx (counter), tmp);
|
||||
|
||||
|
||||
emit_label (end_of_code_label);
|
||||
|
||||
/* Increase the counter of all executions; this seems redundant given
|
||||
@ -1375,8 +1372,8 @@ gen_one_value_profiler (struct histogram_value *value,
|
||||
section for counters, BASE is offset of the counter position. */
|
||||
|
||||
static rtx
|
||||
gen_const_delta_profiler (struct histogram_value *value,
|
||||
unsigned tag, unsigned base)
|
||||
gen_const_delta_profiler (struct histogram_value *value, unsigned tag,
|
||||
unsigned base)
|
||||
{
|
||||
struct histogram_value one_value_delta;
|
||||
unsigned gcov_size = tree_low_cst (TYPE_SIZE (GCOV_TYPE_NODE), 1);
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* RTL reader for GCC.
|
||||
Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
Copyright (C) 1987, 1988, 1991, 1994, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
2003
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
@ -29,18 +30,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
|
||||
static htab_t md_constants;
|
||||
|
||||
static void fatal_with_file_and_line PARAMS ((FILE *, const char *, ...))
|
||||
static void fatal_with_file_and_line (FILE *, const char *, ...)
|
||||
ATTRIBUTE_PRINTF_2 ATTRIBUTE_NORETURN;
|
||||
static void fatal_expected_char PARAMS ((FILE *, int, int)) ATTRIBUTE_NORETURN;
|
||||
static void read_name PARAMS ((char *, FILE *));
|
||||
static char *read_string PARAMS ((struct obstack *, FILE *, int));
|
||||
static char *read_quoted_string PARAMS ((struct obstack *, FILE *));
|
||||
static char *read_braced_string PARAMS ((struct obstack *, FILE *));
|
||||
static void read_escape PARAMS ((struct obstack *, FILE *));
|
||||
static hashval_t def_hash PARAMS ((const void *));
|
||||
static int def_name_eq_p PARAMS ((const void *, const void *));
|
||||
static void read_constants PARAMS ((FILE *infile, char *tmp_char));
|
||||
static void validate_const_int PARAMS ((FILE *, const char *));
|
||||
static void fatal_expected_char (FILE *, int, int) ATTRIBUTE_NORETURN;
|
||||
static void read_name (char *, FILE *);
|
||||
static char *read_string (struct obstack *, FILE *, int);
|
||||
static char *read_quoted_string (struct obstack *, FILE *);
|
||||
static char *read_braced_string (struct obstack *, FILE *);
|
||||
static void read_escape (struct obstack *, FILE *);
|
||||
static hashval_t def_hash (const void *);
|
||||
static int def_name_eq_p (const void *, const void *);
|
||||
static void read_constants (FILE *infile, char *tmp_char);
|
||||
static void validate_const_int (FILE *, const char *);
|
||||
|
||||
/* Subroutines of read_rtx. */
|
||||
|
||||
@ -87,9 +88,7 @@ fatal_with_file_and_line (FILE *infile, const char *msg, ...)
|
||||
invalid data. */
|
||||
|
||||
static void
|
||||
fatal_expected_char (infile, expected_c, actual_c)
|
||||
FILE *infile;
|
||||
int expected_c, actual_c;
|
||||
fatal_expected_char (FILE *infile, int expected_c, int actual_c)
|
||||
{
|
||||
fatal_with_file_and_line (infile, "expected character `%c', found `%c'",
|
||||
expected_c, actual_c);
|
||||
@ -101,8 +100,7 @@ fatal_expected_char (infile, expected_c, actual_c)
|
||||
Tools such as genflags use this function. */
|
||||
|
||||
int
|
||||
read_skip_spaces (infile)
|
||||
FILE *infile;
|
||||
read_skip_spaces (FILE *infile)
|
||||
{
|
||||
int c;
|
||||
|
||||
@ -154,9 +152,7 @@ read_skip_spaces (infile)
|
||||
It is terminated by any of the punctuation chars of rtx printed syntax. */
|
||||
|
||||
static void
|
||||
read_name (str, infile)
|
||||
char *str;
|
||||
FILE *infile;
|
||||
read_name (char *str, FILE *infile)
|
||||
{
|
||||
char *p;
|
||||
int c;
|
||||
@ -207,9 +203,7 @@ read_name (str, infile)
|
||||
/* Subroutine of the string readers. Handles backslash escapes.
|
||||
Caller has read the backslash, but not placed it into the obstack. */
|
||||
static void
|
||||
read_escape (ob, infile)
|
||||
struct obstack *ob;
|
||||
FILE *infile;
|
||||
read_escape (struct obstack *ob, FILE *infile)
|
||||
{
|
||||
int c = getc (infile);
|
||||
|
||||
@ -262,9 +256,7 @@ read_escape (ob, infile)
|
||||
/* Read a double-quoted string onto the obstack. Caller has scanned
|
||||
the leading quote. */
|
||||
static char *
|
||||
read_quoted_string (ob, infile)
|
||||
struct obstack *ob;
|
||||
FILE *infile;
|
||||
read_quoted_string (struct obstack *ob, FILE *infile)
|
||||
{
|
||||
int c;
|
||||
|
||||
@ -292,9 +284,7 @@ read_quoted_string (ob, infile)
|
||||
scanned the leading brace. Note that unlike quoted strings,
|
||||
the outermost braces _are_ included in the string constant. */
|
||||
static char *
|
||||
read_braced_string (ob, infile)
|
||||
struct obstack *ob;
|
||||
FILE *infile;
|
||||
read_braced_string (struct obstack *ob, FILE *infile)
|
||||
{
|
||||
int c;
|
||||
int brace_depth = 1; /* caller-processed */
|
||||
@ -319,7 +309,7 @@ read_braced_string (ob, infile)
|
||||
else if (c == EOF)
|
||||
fatal_with_file_and_line
|
||||
(infile, "missing closing } for opening brace on line %lu",
|
||||
starting_read_rtx_lineno);
|
||||
starting_read_rtx_lineno);
|
||||
|
||||
obstack_1grow (ob, c);
|
||||
}
|
||||
@ -333,10 +323,7 @@ read_braced_string (ob, infile)
|
||||
and dispatch to the appropriate string constant reader. */
|
||||
|
||||
static char *
|
||||
read_string (ob, infile, star_if_braced)
|
||||
struct obstack *ob;
|
||||
FILE *infile;
|
||||
int star_if_braced;
|
||||
read_string (struct obstack *ob, FILE *infile, int star_if_braced)
|
||||
{
|
||||
char *stringbuf;
|
||||
int saw_paren = 0;
|
||||
@ -373,11 +360,10 @@ read_string (ob, infile, star_if_braced)
|
||||
/* Provide a version of a function to read a long long if the system does
|
||||
not provide one. */
|
||||
#if HOST_BITS_PER_WIDE_INT > HOST_BITS_PER_LONG && !defined(HAVE_ATOLL) && !defined(HAVE_ATOQ)
|
||||
HOST_WIDE_INT atoll PARAMS ((const char *));
|
||||
HOST_WIDE_INT atoll (const char *);
|
||||
|
||||
HOST_WIDE_INT
|
||||
atoll (p)
|
||||
const char *p;
|
||||
atoll (const char *p)
|
||||
{
|
||||
int neg = 0;
|
||||
HOST_WIDE_INT tmp_wide;
|
||||
@ -411,8 +397,7 @@ atoll (p)
|
||||
|
||||
/* Given a constant definition, return a hash code for its name. */
|
||||
static hashval_t
|
||||
def_hash (def)
|
||||
const void *def;
|
||||
def_hash (const void *def)
|
||||
{
|
||||
unsigned result, i;
|
||||
const char *string = ((const struct md_constant *) def)->name;
|
||||
@ -424,8 +409,7 @@ def_hash (def)
|
||||
|
||||
/* Given two constant definitions, return true if they have the same name. */
|
||||
static int
|
||||
def_name_eq_p (def1, def2)
|
||||
const void *def1, *def2;
|
||||
def_name_eq_p (const void *def1, const void *def2)
|
||||
{
|
||||
return ! strcmp (((const struct md_constant *) def1)->name,
|
||||
((const struct md_constant *) def2)->name);
|
||||
@ -435,9 +419,7 @@ def_name_eq_p (def1, def2)
|
||||
to read a name or number into. Process a define_constants directive,
|
||||
starting with the optional space after the "define_constants". */
|
||||
static void
|
||||
read_constants (infile, tmp_char)
|
||||
FILE *infile;
|
||||
char *tmp_char;
|
||||
read_constants (FILE *infile, char *tmp_char)
|
||||
{
|
||||
int c;
|
||||
htab_t defs;
|
||||
@ -493,18 +475,14 @@ read_constants (infile, tmp_char)
|
||||
a pointer a pointer to the constant definition and INFO.
|
||||
Stops when CALLBACK returns zero. */
|
||||
void
|
||||
traverse_md_constants (callback, info)
|
||||
htab_trav callback;
|
||||
void *info;
|
||||
traverse_md_constants (htab_trav callback, void *info)
|
||||
{
|
||||
if (md_constants)
|
||||
htab_traverse (md_constants, callback, info);
|
||||
}
|
||||
|
||||
static void
|
||||
validate_const_int (infile, string)
|
||||
FILE *infile;
|
||||
const char *string;
|
||||
validate_const_int (FILE *infile, const char *string)
|
||||
{
|
||||
const char *cp;
|
||||
int valid = 1;
|
||||
@ -529,8 +507,7 @@ validate_const_int (infile, string)
|
||||
the utilities gen*.c that construct C code from machine descriptions. */
|
||||
|
||||
rtx
|
||||
read_rtx (infile)
|
||||
FILE *infile;
|
||||
read_rtx (FILE *infile)
|
||||
{
|
||||
int i, j;
|
||||
RTX_CODE tmp_code;
|
||||
|
757
gcc/real.c
757
gcc/real.c
File diff suppressed because it is too large
Load Diff
138
gcc/real.h
138
gcc/real.h
@ -106,10 +106,10 @@ extern char test_real_width
|
||||
struct real_format
|
||||
{
|
||||
/* Move to and from the target bytes. */
|
||||
void (*encode) PARAMS ((const struct real_format *, long *,
|
||||
const REAL_VALUE_TYPE *));
|
||||
void (*decode) PARAMS ((const struct real_format *, REAL_VALUE_TYPE *,
|
||||
const long *));
|
||||
void (*encode) (const struct real_format *, long *,
|
||||
const REAL_VALUE_TYPE *);
|
||||
void (*decode) (const struct real_format *, REAL_VALUE_TYPE *,
|
||||
const long *);
|
||||
|
||||
/* The radix of the exponent and digits of the significand. */
|
||||
int b;
|
||||
@ -149,82 +149,72 @@ extern const struct real_format *real_format_for_mode[TFmode - QFmode + 1];
|
||||
/* Declare functions in real.c. */
|
||||
|
||||
/* Binary or unary arithmetic on tree_code. */
|
||||
extern void real_arithmetic PARAMS ((REAL_VALUE_TYPE *, int,
|
||||
const REAL_VALUE_TYPE *,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern void real_arithmetic (REAL_VALUE_TYPE *, int, const REAL_VALUE_TYPE *,
|
||||
const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Compare reals by tree_code. */
|
||||
extern bool real_compare PARAMS ((int, const REAL_VALUE_TYPE *,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern bool real_compare (int, const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Determine whether a floating-point value X is infinite. */
|
||||
extern bool real_isinf PARAMS ((const REAL_VALUE_TYPE *));
|
||||
extern bool real_isinf (const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Determine whether a floating-point value X is a NaN. */
|
||||
extern bool real_isnan PARAMS ((const REAL_VALUE_TYPE *));
|
||||
extern bool real_isnan (const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Determine whether a floating-point value X is negative. */
|
||||
extern bool real_isneg PARAMS ((const REAL_VALUE_TYPE *));
|
||||
extern bool real_isneg (const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Determine whether a floating-point value X is minus zero. */
|
||||
extern bool real_isnegzero PARAMS ((const REAL_VALUE_TYPE *));
|
||||
extern bool real_isnegzero (const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Compare two floating-point objects for bitwise identity. */
|
||||
extern bool real_identical PARAMS ((const REAL_VALUE_TYPE *,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern bool real_identical (const REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Extend or truncate to a new mode. */
|
||||
extern void real_convert PARAMS ((REAL_VALUE_TYPE *,
|
||||
enum machine_mode,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern void real_convert (REAL_VALUE_TYPE *, enum machine_mode,
|
||||
const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Return true if truncating to NEW is exact. */
|
||||
extern bool exact_real_truncate PARAMS ((enum machine_mode,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern bool exact_real_truncate (enum machine_mode, const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Render R as a decimal floating point constant. */
|
||||
extern void real_to_decimal PARAMS ((char *, const REAL_VALUE_TYPE *,
|
||||
size_t, size_t, int));
|
||||
extern void real_to_decimal (char *, const REAL_VALUE_TYPE *, size_t,
|
||||
size_t, int);
|
||||
|
||||
/* Render R as a hexadecimal floating point constant. */
|
||||
extern void real_to_hexadecimal PARAMS ((char *, const REAL_VALUE_TYPE *,
|
||||
size_t, size_t, int));
|
||||
extern void real_to_hexadecimal (char *, const REAL_VALUE_TYPE *,
|
||||
size_t, size_t, int);
|
||||
|
||||
/* Render R as an integer. */
|
||||
extern HOST_WIDE_INT real_to_integer PARAMS ((const REAL_VALUE_TYPE *));
|
||||
extern void real_to_integer2 PARAMS ((HOST_WIDE_INT *, HOST_WIDE_INT *,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern HOST_WIDE_INT real_to_integer (const REAL_VALUE_TYPE *);
|
||||
extern void real_to_integer2 (HOST_WIDE_INT *, HOST_WIDE_INT *,
|
||||
const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Initialize R from a decimal or hexadecimal string. */
|
||||
extern void real_from_string PARAMS ((REAL_VALUE_TYPE *, const char *));
|
||||
extern void real_from_string (REAL_VALUE_TYPE *, const char *);
|
||||
|
||||
/* Initialize R from an integer pair HIGH/LOW. */
|
||||
extern void real_from_integer PARAMS ((REAL_VALUE_TYPE *,
|
||||
enum machine_mode,
|
||||
unsigned HOST_WIDE_INT,
|
||||
HOST_WIDE_INT, int));
|
||||
extern void real_from_integer (REAL_VALUE_TYPE *, enum machine_mode,
|
||||
unsigned HOST_WIDE_INT, HOST_WIDE_INT, int);
|
||||
|
||||
extern long real_to_target_fmt PARAMS ((long *, const REAL_VALUE_TYPE *,
|
||||
const struct real_format *));
|
||||
extern long real_to_target PARAMS ((long *, const REAL_VALUE_TYPE *,
|
||||
enum machine_mode));
|
||||
extern long real_to_target_fmt (long *, const REAL_VALUE_TYPE *,
|
||||
const struct real_format *);
|
||||
extern long real_to_target (long *, const REAL_VALUE_TYPE *, enum machine_mode);
|
||||
|
||||
extern void real_from_target_fmt PARAMS ((REAL_VALUE_TYPE *, const long *,
|
||||
const struct real_format *));
|
||||
extern void real_from_target PARAMS ((REAL_VALUE_TYPE *, const long *,
|
||||
enum machine_mode));
|
||||
extern void real_from_target_fmt (REAL_VALUE_TYPE *, const long *,
|
||||
const struct real_format *);
|
||||
extern void real_from_target (REAL_VALUE_TYPE *, const long *,
|
||||
enum machine_mode);
|
||||
|
||||
extern void real_inf PARAMS ((REAL_VALUE_TYPE *));
|
||||
extern void real_inf (REAL_VALUE_TYPE *);
|
||||
|
||||
extern bool real_nan PARAMS ((REAL_VALUE_TYPE *, const char *,
|
||||
int, enum machine_mode));
|
||||
extern bool real_nan (REAL_VALUE_TYPE *, const char *, int, enum machine_mode);
|
||||
|
||||
extern void real_maxval PARAMS ((REAL_VALUE_TYPE *, int,
|
||||
enum machine_mode));
|
||||
extern void real_maxval (REAL_VALUE_TYPE *, int, enum machine_mode);
|
||||
|
||||
extern void real_2expN PARAMS ((REAL_VALUE_TYPE *, int));
|
||||
extern void real_2expN (REAL_VALUE_TYPE *, int);
|
||||
|
||||
extern unsigned int real_hash PARAMS ((const REAL_VALUE_TYPE *));
|
||||
extern unsigned int real_hash (const REAL_VALUE_TYPE *);
|
||||
|
||||
|
||||
/* Target formats defined in real.c. */
|
||||
@ -290,14 +280,14 @@ extern const struct real_format real_internal_format;
|
||||
#define REAL_VALUE_FROM_UNSIGNED_INT(r, lo, hi, mode) \
|
||||
real_from_integer (&(r), mode, lo, hi, 1)
|
||||
|
||||
extern REAL_VALUE_TYPE real_value_truncate PARAMS ((enum machine_mode,
|
||||
REAL_VALUE_TYPE));
|
||||
extern REAL_VALUE_TYPE real_value_truncate (enum machine_mode,
|
||||
REAL_VALUE_TYPE);
|
||||
|
||||
#define REAL_VALUE_TO_INT(plow, phigh, r) \
|
||||
real_to_integer2 (plow, phigh, &(r))
|
||||
|
||||
extern REAL_VALUE_TYPE real_arithmetic2 PARAMS ((int, const REAL_VALUE_TYPE *,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern REAL_VALUE_TYPE real_arithmetic2 (int, const REAL_VALUE_TYPE *,
|
||||
const REAL_VALUE_TYPE *);
|
||||
|
||||
#define REAL_VALUE_NEGATE(X) \
|
||||
real_arithmetic2 (NEGATE_EXPR, &(X), NULL)
|
||||
@ -305,10 +295,9 @@ extern REAL_VALUE_TYPE real_arithmetic2 PARAMS ((int, const REAL_VALUE_TYPE *,
|
||||
#define REAL_VALUE_ABS(X) \
|
||||
real_arithmetic2 (ABS_EXPR, &(X), NULL)
|
||||
|
||||
extern int significand_size PARAMS ((enum machine_mode));
|
||||
extern int significand_size (enum machine_mode);
|
||||
|
||||
extern REAL_VALUE_TYPE real_from_string2 PARAMS ((const char *,
|
||||
enum machine_mode));
|
||||
extern REAL_VALUE_TYPE real_from_string2 (const char *, enum machine_mode);
|
||||
|
||||
#define REAL_VALUE_ATOF(s, m) \
|
||||
real_from_string2 (s, m)
|
||||
@ -326,11 +315,10 @@ extern REAL_VALUE_TYPE real_from_string2 PARAMS ((const char *,
|
||||
/* ??? These were added for Paranoia support. */
|
||||
|
||||
/* Return floor log2(R). */
|
||||
extern int real_exponent PARAMS ((const REAL_VALUE_TYPE *));
|
||||
extern int real_exponent (const REAL_VALUE_TYPE *);
|
||||
|
||||
/* R = A * 2**EXP. */
|
||||
extern void real_ldexp PARAMS ((REAL_VALUE_TYPE *,
|
||||
const REAL_VALUE_TYPE *, int));
|
||||
extern void real_ldexp (REAL_VALUE_TYPE *, const REAL_VALUE_TYPE *, int);
|
||||
|
||||
/* **** End of software floating point emulator interface macros **** */
|
||||
|
||||
@ -345,8 +333,7 @@ extern REAL_VALUE_TYPE dconsthalf;
|
||||
|
||||
/* Function to return a real value (not a tree node)
|
||||
from a given integer constant. */
|
||||
REAL_VALUE_TYPE real_value_from_int_cst PARAMS ((union tree_node *,
|
||||
union tree_node *));
|
||||
REAL_VALUE_TYPE real_value_from_int_cst (union tree_node *, union tree_node *);
|
||||
|
||||
/* Given a CONST_DOUBLE in FROM, store into TO the value it represents. */
|
||||
#define REAL_VALUE_FROM_CONST_DOUBLE(to, from) \
|
||||
@ -355,35 +342,28 @@ REAL_VALUE_TYPE real_value_from_int_cst PARAMS ((union tree_node *,
|
||||
/* Return a CONST_DOUBLE with value R and mode M. */
|
||||
#define CONST_DOUBLE_FROM_REAL_VALUE(r, m) \
|
||||
const_double_from_real_value (r, m)
|
||||
extern rtx const_double_from_real_value PARAMS ((REAL_VALUE_TYPE,
|
||||
enum machine_mode));
|
||||
extern rtx const_double_from_real_value (REAL_VALUE_TYPE, enum machine_mode);
|
||||
|
||||
/* Replace R by 1/R in the given machine mode, if the result is exact. */
|
||||
extern bool exact_real_inverse PARAMS ((enum machine_mode, REAL_VALUE_TYPE *));
|
||||
extern bool exact_real_inverse (enum machine_mode, REAL_VALUE_TYPE *);
|
||||
|
||||
/* In tree.c: wrap up a REAL_VALUE_TYPE in a tree node. */
|
||||
extern tree build_real PARAMS ((tree, REAL_VALUE_TYPE));
|
||||
extern tree build_real (tree, REAL_VALUE_TYPE);
|
||||
|
||||
/* Calculate R as the square root of X in the given machine mode. */
|
||||
extern bool real_sqrt PARAMS ((REAL_VALUE_TYPE *,
|
||||
enum machine_mode,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern bool real_sqrt (REAL_VALUE_TYPE *, enum machine_mode,
|
||||
const REAL_VALUE_TYPE *);
|
||||
|
||||
/* Calculate R as X raised to the integer exponent N in mode MODE. */
|
||||
extern bool real_powi PARAMS ((REAL_VALUE_TYPE *,
|
||||
enum machine_mode,
|
||||
const REAL_VALUE_TYPE *,
|
||||
HOST_WIDE_INT));
|
||||
extern bool real_powi (REAL_VALUE_TYPE *, enum machine_mode,
|
||||
const REAL_VALUE_TYPE *, HOST_WIDE_INT);
|
||||
|
||||
/* Standard round to integer value functions. */
|
||||
extern void real_trunc PARAMS ((REAL_VALUE_TYPE *,
|
||||
enum machine_mode,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern void real_floor PARAMS ((REAL_VALUE_TYPE *,
|
||||
enum machine_mode,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern void real_ceil PARAMS ((REAL_VALUE_TYPE *,
|
||||
enum machine_mode,
|
||||
const REAL_VALUE_TYPE *));
|
||||
extern void real_trunc (REAL_VALUE_TYPE *, enum machine_mode,
|
||||
const REAL_VALUE_TYPE *);
|
||||
extern void real_floor (REAL_VALUE_TYPE *, enum machine_mode,
|
||||
const REAL_VALUE_TYPE *);
|
||||
extern void real_ceil (REAL_VALUE_TYPE *, enum machine_mode,
|
||||
const REAL_VALUE_TYPE *);
|
||||
|
||||
#endif /* ! GCC_REAL_H */
|
||||
|
232
gcc/recog.c
232
gcc/recog.c
@ -56,10 +56,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void validate_replace_rtx_1 PARAMS ((rtx *, rtx, rtx, rtx));
|
||||
static rtx *find_single_use_1 PARAMS ((rtx, rtx *));
|
||||
static void validate_replace_src_1 PARAMS ((rtx *, void *));
|
||||
static rtx split_insn PARAMS ((rtx));
|
||||
static void validate_replace_rtx_1 (rtx *, rtx, rtx, rtx);
|
||||
static rtx *find_single_use_1 (rtx, rtx *);
|
||||
static void validate_replace_src_1 (rtx *, void *);
|
||||
static rtx split_insn (rtx);
|
||||
|
||||
/* Nonzero means allow operands to be volatile.
|
||||
This should be 0 if you are generating rtl, such as if you are calling
|
||||
@ -96,13 +96,13 @@ int epilogue_completed;
|
||||
before any insn recognition may be done in the function. */
|
||||
|
||||
void
|
||||
init_recog_no_volatile ()
|
||||
init_recog_no_volatile (void)
|
||||
{
|
||||
volatile_ok = 0;
|
||||
}
|
||||
|
||||
void
|
||||
init_recog ()
|
||||
init_recog (void)
|
||||
{
|
||||
volatile_ok = 1;
|
||||
}
|
||||
@ -117,8 +117,7 @@ init_recog ()
|
||||
through this one. (The only exception is in combine.c.) */
|
||||
|
||||
int
|
||||
recog_memoized_1 (insn)
|
||||
rtx insn;
|
||||
recog_memoized_1 (rtx insn)
|
||||
{
|
||||
if (INSN_CODE (insn) < 0)
|
||||
INSN_CODE (insn) = recog (PATTERN (insn), insn, 0);
|
||||
@ -129,8 +128,7 @@ recog_memoized_1 (insn)
|
||||
and that the operands mentioned in it are legitimate. */
|
||||
|
||||
int
|
||||
check_asm_operands (x)
|
||||
rtx x;
|
||||
check_asm_operands (rtx x)
|
||||
{
|
||||
int noperands;
|
||||
rtx *operands;
|
||||
@ -206,11 +204,7 @@ static int num_changes = 0;
|
||||
Otherwise, perform the change and return 1. */
|
||||
|
||||
int
|
||||
validate_change (object, loc, new, in_group)
|
||||
rtx object;
|
||||
rtx *loc;
|
||||
rtx new;
|
||||
int in_group;
|
||||
validate_change (rtx object, rtx *loc, rtx new, int in_group)
|
||||
{
|
||||
rtx old = *loc;
|
||||
|
||||
@ -264,8 +258,7 @@ validate_change (object, loc, new, in_group)
|
||||
were valid; i.e. whether INSN can still be recognized. */
|
||||
|
||||
int
|
||||
insn_invalid_p (insn)
|
||||
rtx insn;
|
||||
insn_invalid_p (rtx insn)
|
||||
{
|
||||
rtx pat = PATTERN (insn);
|
||||
int num_clobbers = 0;
|
||||
@ -315,7 +308,7 @@ insn_invalid_p (insn)
|
||||
|
||||
/* Return number of changes made and not validated yet. */
|
||||
int
|
||||
num_changes_pending ()
|
||||
num_changes_pending (void)
|
||||
{
|
||||
return num_changes;
|
||||
}
|
||||
@ -324,7 +317,7 @@ num_changes_pending ()
|
||||
Return 1 if all changes are valid, zero otherwise. */
|
||||
|
||||
int
|
||||
apply_change_group ()
|
||||
apply_change_group (void)
|
||||
{
|
||||
int i;
|
||||
rtx last_validated = NULL_RTX;
|
||||
@ -425,7 +418,7 @@ apply_change_group ()
|
||||
/* Return the number of changes so far in the current group. */
|
||||
|
||||
int
|
||||
num_validated_changes ()
|
||||
num_validated_changes (void)
|
||||
{
|
||||
return num_changes;
|
||||
}
|
||||
@ -433,8 +426,7 @@ num_validated_changes ()
|
||||
/* Retract the changes numbered NUM and up. */
|
||||
|
||||
void
|
||||
cancel_changes (num)
|
||||
int num;
|
||||
cancel_changes (int num)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -453,9 +445,7 @@ cancel_changes (num)
|
||||
validate_change passing OBJECT. */
|
||||
|
||||
static void
|
||||
validate_replace_rtx_1 (loc, from, to, object)
|
||||
rtx *loc;
|
||||
rtx from, to, object;
|
||||
validate_replace_rtx_1 (rtx *loc, rtx from, rtx to, rtx object)
|
||||
{
|
||||
int i, j;
|
||||
const char *fmt;
|
||||
@ -636,8 +626,7 @@ validate_replace_rtx_1 (loc, from, to, object)
|
||||
if INSN is still valid. */
|
||||
|
||||
int
|
||||
validate_replace_rtx_subexp (from, to, insn, loc)
|
||||
rtx from, to, insn, *loc;
|
||||
validate_replace_rtx_subexp (rtx from, rtx to, rtx insn, rtx *loc)
|
||||
{
|
||||
validate_replace_rtx_1 (loc, from, to, insn);
|
||||
return apply_change_group ();
|
||||
@ -647,8 +636,7 @@ validate_replace_rtx_subexp (from, to, insn, loc)
|
||||
changes have been made, validate by seeing if INSN is still valid. */
|
||||
|
||||
int
|
||||
validate_replace_rtx (from, to, insn)
|
||||
rtx from, to, insn;
|
||||
validate_replace_rtx (rtx from, rtx to, rtx insn)
|
||||
{
|
||||
validate_replace_rtx_1 (&PATTERN (insn), from, to, insn);
|
||||
return apply_change_group ();
|
||||
@ -657,8 +645,7 @@ validate_replace_rtx (from, to, insn)
|
||||
/* Try replacing every occurrence of FROM in INSN with TO. */
|
||||
|
||||
void
|
||||
validate_replace_rtx_group (from, to, insn)
|
||||
rtx from, to, insn;
|
||||
validate_replace_rtx_group (rtx from, rtx to, rtx insn)
|
||||
{
|
||||
validate_replace_rtx_1 (&PATTERN (insn), from, to, insn);
|
||||
}
|
||||
@ -672,9 +659,7 @@ struct validate_replace_src_data
|
||||
};
|
||||
|
||||
static void
|
||||
validate_replace_src_1 (x, data)
|
||||
rtx *x;
|
||||
void *data;
|
||||
validate_replace_src_1 (rtx *x, void *data)
|
||||
{
|
||||
struct validate_replace_src_data *d
|
||||
= (struct validate_replace_src_data *) data;
|
||||
@ -686,8 +671,7 @@ validate_replace_src_1 (x, data)
|
||||
SET_DESTs. */
|
||||
|
||||
void
|
||||
validate_replace_src_group (from, to, insn)
|
||||
rtx from, to, insn;
|
||||
validate_replace_src_group (rtx from, rtx to, rtx insn)
|
||||
{
|
||||
struct validate_replace_src_data d;
|
||||
|
||||
@ -700,8 +684,7 @@ validate_replace_src_group (from, to, insn)
|
||||
/* Same as validate_replace_src_group, but validate by seeing if
|
||||
INSN is still valid. */
|
||||
int
|
||||
validate_replace_src (from, to, insn)
|
||||
rtx from, to, insn;
|
||||
validate_replace_src (rtx from, rtx to, rtx insn)
|
||||
{
|
||||
validate_replace_src_group (from, to, insn);
|
||||
return apply_change_group ();
|
||||
@ -713,8 +696,7 @@ validate_replace_src (from, to, insn)
|
||||
EQ and NE tests do not count. */
|
||||
|
||||
int
|
||||
next_insn_tests_no_inequality (insn)
|
||||
rtx insn;
|
||||
next_insn_tests_no_inequality (rtx insn)
|
||||
{
|
||||
rtx next = next_cc0_user (insn);
|
||||
|
||||
@ -735,9 +717,7 @@ next_insn_tests_no_inequality (insn)
|
||||
DEST that are being used to totally replace it are not counted. */
|
||||
|
||||
static rtx *
|
||||
find_single_use_1 (dest, loc)
|
||||
rtx dest;
|
||||
rtx *loc;
|
||||
find_single_use_1 (rtx dest, rtx *loc)
|
||||
{
|
||||
rtx x = *loc;
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
@ -848,10 +828,7 @@ find_single_use_1 (dest, loc)
|
||||
and last insn referencing DEST. */
|
||||
|
||||
rtx *
|
||||
find_single_use (dest, insn, ploc)
|
||||
rtx dest;
|
||||
rtx insn;
|
||||
rtx *ploc;
|
||||
find_single_use (rtx dest, rtx insn, rtx *ploc)
|
||||
{
|
||||
rtx next;
|
||||
rtx *result;
|
||||
@ -914,9 +891,7 @@ find_single_use (dest, insn, ploc)
|
||||
class NO_REGS, see the comment for `register_operand'. */
|
||||
|
||||
int
|
||||
general_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
general_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (op);
|
||||
|
||||
@ -971,7 +946,7 @@ general_operand (op, mode)
|
||||
return 0;
|
||||
|
||||
/* FLOAT_MODE subregs can't be paradoxical. Combine will occasionally
|
||||
create such rtl, and we must reject it. */
|
||||
create such rtl, and we must reject it. */
|
||||
if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT
|
||||
&& GET_MODE_SIZE (GET_MODE (op)) > GET_MODE_SIZE (GET_MODE (sub)))
|
||||
return 0;
|
||||
@ -1018,9 +993,7 @@ general_operand (op, mode)
|
||||
expressions in the machine description. */
|
||||
|
||||
int
|
||||
address_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
address_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
return memory_address_p (mode, op);
|
||||
}
|
||||
@ -1040,9 +1013,7 @@ address_operand (op, mode)
|
||||
it is most consistent to keep this function from accepting them. */
|
||||
|
||||
int
|
||||
register_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
register_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
if (GET_MODE (op) != mode && mode != VOIDmode)
|
||||
return 0;
|
||||
@ -1093,9 +1064,7 @@ register_operand (op, mode)
|
||||
/* Return 1 for a register in Pmode; ignore the tested mode. */
|
||||
|
||||
int
|
||||
pmode_register_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
||||
pmode_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return register_operand (op, Pmode);
|
||||
}
|
||||
@ -1104,9 +1073,7 @@ pmode_register_operand (op, mode)
|
||||
or a hard register. */
|
||||
|
||||
int
|
||||
scratch_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
scratch_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
if (GET_MODE (op) != mode && mode != VOIDmode)
|
||||
return 0;
|
||||
@ -1122,9 +1089,7 @@ scratch_operand (op, mode)
|
||||
expressions in the machine description. */
|
||||
|
||||
int
|
||||
immediate_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
immediate_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
/* Don't accept CONST_INT or anything similar
|
||||
if the caller wants something floating. */
|
||||
@ -1156,9 +1121,7 @@ immediate_operand (op, mode)
|
||||
/* Returns 1 if OP is an operand that is a CONST_INT. */
|
||||
|
||||
int
|
||||
const_int_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
const_int_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
if (GET_CODE (op) != CONST_INT)
|
||||
return 0;
|
||||
@ -1174,9 +1137,7 @@ const_int_operand (op, mode)
|
||||
floating-point number. */
|
||||
|
||||
int
|
||||
const_double_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
const_double_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
/* Don't accept CONST_INT or anything similar
|
||||
if the caller wants something floating. */
|
||||
@ -1193,9 +1154,7 @@ const_double_operand (op, mode)
|
||||
/* Return 1 if OP is a general operand that is not an immediate operand. */
|
||||
|
||||
int
|
||||
nonimmediate_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
nonimmediate_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
return (general_operand (op, mode) && ! CONSTANT_P (op));
|
||||
}
|
||||
@ -1203,9 +1162,7 @@ nonimmediate_operand (op, mode)
|
||||
/* Return 1 if OP is a register reference or immediate value of mode MODE. */
|
||||
|
||||
int
|
||||
nonmemory_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
nonmemory_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
if (CONSTANT_P (op))
|
||||
{
|
||||
@ -1259,9 +1216,7 @@ nonmemory_operand (op, mode)
|
||||
expressions in the machine description. */
|
||||
|
||||
int
|
||||
push_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
push_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
unsigned int rounded_size = GET_MODE_SIZE (mode);
|
||||
|
||||
@ -1307,9 +1262,7 @@ push_operand (op, mode)
|
||||
expressions in the machine description. */
|
||||
|
||||
int
|
||||
pop_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
pop_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
if (GET_CODE (op) != MEM)
|
||||
return 0;
|
||||
@ -1328,9 +1281,7 @@ pop_operand (op, mode)
|
||||
/* Return 1 if ADDR is a valid memory address for mode MODE. */
|
||||
|
||||
int
|
||||
memory_address_p (mode, addr)
|
||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
||||
rtx addr;
|
||||
memory_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx addr)
|
||||
{
|
||||
if (GET_CODE (addr) == ADDRESSOF)
|
||||
return 1;
|
||||
@ -1349,9 +1300,7 @@ memory_address_p (mode, addr)
|
||||
expressions in the machine description. */
|
||||
|
||||
int
|
||||
memory_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
memory_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
rtx inner;
|
||||
|
||||
@ -1374,9 +1323,7 @@ memory_operand (op, mode)
|
||||
that is, a memory reference whose address is a general_operand. */
|
||||
|
||||
int
|
||||
indirect_operand (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
indirect_operand (rtx op, enum machine_mode mode)
|
||||
{
|
||||
/* Before reload, a SUBREG isn't in memory (see memory_operand, above). */
|
||||
if (! reload_completed
|
||||
@ -1409,9 +1356,7 @@ indirect_operand (op, mode)
|
||||
MATCH_OPERATOR to recognize all the branch insns. */
|
||||
|
||||
int
|
||||
comparison_operator (op, mode)
|
||||
rtx op;
|
||||
enum machine_mode mode;
|
||||
comparison_operator (rtx op, enum machine_mode mode)
|
||||
{
|
||||
return ((mode == VOIDmode || GET_MODE (op) == mode)
|
||||
&& GET_RTX_CLASS (GET_CODE (op)) == '<');
|
||||
@ -1422,8 +1367,7 @@ comparison_operator (op, mode)
|
||||
Otherwise return -1. */
|
||||
|
||||
int
|
||||
asm_noperands (body)
|
||||
rtx body;
|
||||
asm_noperands (rtx body)
|
||||
{
|
||||
switch (GET_CODE (body))
|
||||
{
|
||||
@ -1507,12 +1451,8 @@ asm_noperands (body)
|
||||
we don't store that info. */
|
||||
|
||||
const char *
|
||||
decode_asm_operands (body, operands, operand_locs, constraints, modes)
|
||||
rtx body;
|
||||
rtx *operands;
|
||||
rtx **operand_locs;
|
||||
const char **constraints;
|
||||
enum machine_mode *modes;
|
||||
decode_asm_operands (rtx body, rtx *operands, rtx **operand_locs,
|
||||
const char **constraints, enum machine_mode *modes)
|
||||
{
|
||||
int i;
|
||||
int noperands;
|
||||
@ -1644,9 +1584,7 @@ decode_asm_operands (body, operands, operand_locs, constraints, modes)
|
||||
Return > 0 if ok, = 0 if bad, < 0 if inconclusive. */
|
||||
|
||||
int
|
||||
asm_operand_ok (op, constraint)
|
||||
rtx op;
|
||||
const char *constraint;
|
||||
asm_operand_ok (rtx op, const char *constraint)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
@ -1861,8 +1799,7 @@ asm_operand_ok (op, constraint)
|
||||
Otherwise, return a null pointer. */
|
||||
|
||||
rtx *
|
||||
find_constant_term_loc (p)
|
||||
rtx *p;
|
||||
find_constant_term_loc (rtx *p)
|
||||
{
|
||||
rtx *tem;
|
||||
enum rtx_code code = GET_CODE (*p);
|
||||
@ -1915,8 +1852,7 @@ find_constant_term_loc (p)
|
||||
don't use it before reload. */
|
||||
|
||||
int
|
||||
offsettable_memref_p (op)
|
||||
rtx op;
|
||||
offsettable_memref_p (rtx op)
|
||||
{
|
||||
return ((GET_CODE (op) == MEM)
|
||||
&& offsettable_address_p (1, GET_MODE (op), XEXP (op, 0)));
|
||||
@ -1926,8 +1862,7 @@ offsettable_memref_p (op)
|
||||
consider pseudo-regs valid as index or base regs. */
|
||||
|
||||
int
|
||||
offsettable_nonstrict_memref_p (op)
|
||||
rtx op;
|
||||
offsettable_nonstrict_memref_p (rtx op)
|
||||
{
|
||||
return ((GET_CODE (op) == MEM)
|
||||
&& offsettable_address_p (0, GET_MODE (op), XEXP (op, 0)));
|
||||
@ -1944,16 +1879,13 @@ offsettable_nonstrict_memref_p (op)
|
||||
for the sake of use in reload.c. */
|
||||
|
||||
int
|
||||
offsettable_address_p (strictp, mode, y)
|
||||
int strictp;
|
||||
enum machine_mode mode;
|
||||
rtx y;
|
||||
offsettable_address_p (int strictp, enum machine_mode mode, rtx y)
|
||||
{
|
||||
enum rtx_code ycode = GET_CODE (y);
|
||||
rtx z;
|
||||
rtx y1 = y;
|
||||
rtx *y2;
|
||||
int (*addressp) PARAMS ((enum machine_mode, rtx)) =
|
||||
int (*addressp) (enum machine_mode, rtx) =
|
||||
(strictp ? strict_memory_address_p : memory_address_p);
|
||||
unsigned int mode_sz = GET_MODE_SIZE (mode);
|
||||
|
||||
@ -2019,8 +1951,7 @@ offsettable_address_p (strictp, mode, y)
|
||||
because the amount of the increment depends on the mode. */
|
||||
|
||||
int
|
||||
mode_dependent_address_p (addr)
|
||||
rtx addr ATTRIBUTE_UNUSED; /* Maybe used in GO_IF_MODE_DEPENDENT_ADDRESS. */
|
||||
mode_dependent_address_p (rtx addr ATTRIBUTE_UNUSED /* Maybe used in GO_IF_MODE_DEPENDENT_ADDRESS. */)
|
||||
{
|
||||
GO_IF_MODE_DEPENDENT_ADDRESS (addr, win);
|
||||
return 0;
|
||||
@ -2034,8 +1965,7 @@ mode_dependent_address_p (addr)
|
||||
valid information. This is used primary by gen_attr infrastructure that
|
||||
often does extract insn again and again. */
|
||||
void
|
||||
extract_insn_cached (insn)
|
||||
rtx insn;
|
||||
extract_insn_cached (rtx insn)
|
||||
{
|
||||
if (recog_data.insn == insn && INSN_CODE (insn) >= 0)
|
||||
return;
|
||||
@ -2045,8 +1975,7 @@ extract_insn_cached (insn)
|
||||
/* Do cached extract_insn, constrain_operand and complain about failures.
|
||||
Used by insn_attrtab. */
|
||||
void
|
||||
extract_constrain_insn_cached (insn)
|
||||
rtx insn;
|
||||
extract_constrain_insn_cached (rtx insn)
|
||||
{
|
||||
extract_insn_cached (insn);
|
||||
if (which_alternative == -1
|
||||
@ -2055,8 +1984,7 @@ extract_constrain_insn_cached (insn)
|
||||
}
|
||||
/* Do cached constrain_operand and complain about failures. */
|
||||
int
|
||||
constrain_operands_cached (strict)
|
||||
int strict;
|
||||
constrain_operands_cached (int strict)
|
||||
{
|
||||
if (which_alternative == -1)
|
||||
return constrain_operands (strict);
|
||||
@ -2067,8 +1995,7 @@ constrain_operands_cached (strict)
|
||||
/* Analyze INSN and fill in recog_data. */
|
||||
|
||||
void
|
||||
extract_insn (insn)
|
||||
rtx insn;
|
||||
extract_insn (rtx insn)
|
||||
{
|
||||
int i;
|
||||
int icode;
|
||||
@ -2167,7 +2094,7 @@ extract_insn (insn)
|
||||
information from the constraint strings into a more usable form.
|
||||
The collected data is stored in recog_op_alt. */
|
||||
void
|
||||
preprocess_constraints ()
|
||||
preprocess_constraints (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -2326,8 +2253,7 @@ struct funny_match
|
||||
};
|
||||
|
||||
int
|
||||
constrain_operands (strict)
|
||||
int strict;
|
||||
constrain_operands (int strict)
|
||||
{
|
||||
const char *constraints[MAX_RECOG_OPERANDS];
|
||||
int matching_operands[MAX_RECOG_OPERANDS];
|
||||
@ -2616,7 +2542,7 @@ constrain_operands (strict)
|
||||
/* Every memory operand can be reloaded to fit. */
|
||||
if (strict < 0 && GET_CODE (op) == MEM)
|
||||
win = 1;
|
||||
|
||||
|
||||
/* Before reload, accept what reload can turn into mem. */
|
||||
if (strict < 0 && CONSTANT_P (op))
|
||||
win = 1;
|
||||
@ -2704,11 +2630,8 @@ constrain_operands (strict)
|
||||
If REG occupies multiple hard regs, all of them must be in CLASS. */
|
||||
|
||||
int
|
||||
reg_fits_class_p (operand, class, offset, mode)
|
||||
rtx operand;
|
||||
enum reg_class class;
|
||||
int offset;
|
||||
enum machine_mode mode;
|
||||
reg_fits_class_p (rtx operand, enum reg_class class, int offset,
|
||||
enum machine_mode mode)
|
||||
{
|
||||
int regno = REGNO (operand);
|
||||
if (regno < FIRST_PSEUDO_REGISTER
|
||||
@ -2731,8 +2654,7 @@ reg_fits_class_p (operand, class, offset, mode)
|
||||
/* Split single instruction. Helper function for split_all_insns.
|
||||
Return last insn in the sequence if successful, or NULL if unsuccessful. */
|
||||
static rtx
|
||||
split_insn (insn)
|
||||
rtx insn;
|
||||
split_insn (rtx insn)
|
||||
{
|
||||
rtx set;
|
||||
if (!INSN_P (insn))
|
||||
@ -2787,8 +2709,7 @@ split_insn (insn)
|
||||
/* Split all insns in the function. If UPD_LIFE, update life info after. */
|
||||
|
||||
void
|
||||
split_all_insns (upd_life)
|
||||
int upd_life;
|
||||
split_all_insns (int upd_life)
|
||||
{
|
||||
sbitmap blocks;
|
||||
bool changed;
|
||||
@ -2852,7 +2773,7 @@ split_all_insns (upd_life)
|
||||
Used by machine dependent reorg passes. */
|
||||
|
||||
void
|
||||
split_all_insns_noflow ()
|
||||
split_all_insns_noflow (void)
|
||||
{
|
||||
rtx next, insn;
|
||||
|
||||
@ -2884,8 +2805,7 @@ static int peep2_current;
|
||||
in a multi-insn pattern. */
|
||||
|
||||
rtx
|
||||
peep2_next_insn (n)
|
||||
int n;
|
||||
peep2_next_insn (int n)
|
||||
{
|
||||
if (n >= MAX_INSNS_PER_PEEP2 + 1)
|
||||
abort ();
|
||||
@ -2903,9 +2823,7 @@ peep2_next_insn (n)
|
||||
after `current'. */
|
||||
|
||||
int
|
||||
peep2_regno_dead_p (ofs, regno)
|
||||
int ofs;
|
||||
int regno;
|
||||
peep2_regno_dead_p (int ofs, int regno)
|
||||
{
|
||||
if (ofs >= MAX_INSNS_PER_PEEP2 + 1)
|
||||
abort ();
|
||||
@ -2923,9 +2841,7 @@ peep2_regno_dead_p (ofs, regno)
|
||||
/* Similarly for a REG. */
|
||||
|
||||
int
|
||||
peep2_reg_dead_p (ofs, reg)
|
||||
int ofs;
|
||||
rtx reg;
|
||||
peep2_reg_dead_p (int ofs, rtx reg)
|
||||
{
|
||||
int regno, n;
|
||||
|
||||
@ -2959,11 +2875,8 @@ peep2_reg_dead_p (ofs, reg)
|
||||
returned. */
|
||||
|
||||
rtx
|
||||
peep2_find_free_register (from, to, class_str, mode, reg_set)
|
||||
int from, to;
|
||||
const char *class_str;
|
||||
enum machine_mode mode;
|
||||
HARD_REG_SET *reg_set;
|
||||
peep2_find_free_register (int from, int to, const char *class_str,
|
||||
enum machine_mode mode, HARD_REG_SET *reg_set)
|
||||
{
|
||||
static int search_ofs;
|
||||
enum reg_class class;
|
||||
@ -3061,8 +2974,7 @@ peep2_find_free_register (from, to, class_str, mode, reg_set)
|
||||
/* Perform the peephole2 optimization pass. */
|
||||
|
||||
void
|
||||
peephole2_optimize (dump_file)
|
||||
FILE *dump_file ATTRIBUTE_UNUSED;
|
||||
peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
|
||||
{
|
||||
regset_head rs_heads[MAX_INSNS_PER_PEEP2 + 2];
|
||||
rtx insn, prev;
|
||||
@ -3352,8 +3264,7 @@ peephole2_optimize (dump_file)
|
||||
SETs inside. */
|
||||
|
||||
int
|
||||
store_data_bypass_p (out_insn, in_insn)
|
||||
rtx out_insn, in_insn;
|
||||
store_data_bypass_p (rtx out_insn, rtx in_insn)
|
||||
{
|
||||
rtx out_set, in_set;
|
||||
|
||||
@ -3403,8 +3314,7 @@ store_data_bypass_p (out_insn, in_insn)
|
||||
of insn categorization may be any JUMP or CALL insn. */
|
||||
|
||||
int
|
||||
if_test_bypass_p (out_insn, in_insn)
|
||||
rtx out_insn, in_insn;
|
||||
if_test_bypass_p (rtx out_insn, rtx in_insn)
|
||||
{
|
||||
rtx out_set, in_set;
|
||||
|
||||
|
134
gcc/recog.h
134
gcc/recog.h
@ -1,5 +1,5 @@
|
||||
/* Declarations for interface to insn recognizer and insn-output.c.
|
||||
Copyright (C) 1987, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
Copyright (C) 1987, 1996, 1997, 1998, 1999, 2000, 2001, 2003
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
@ -54,9 +54,9 @@ struct operand_alternative
|
||||
/* Nonzero if '&' was found in the constraint string. */
|
||||
unsigned int earlyclobber:1;
|
||||
/* Nonzero if 'm' was found in the constraint string. */
|
||||
unsigned int memory_ok:1;
|
||||
unsigned int memory_ok:1;
|
||||
/* Nonzero if 'o' was found in the constraint string. */
|
||||
unsigned int offmem_ok:1;
|
||||
unsigned int offmem_ok:1;
|
||||
/* Nonzero if 'V' was found in the constraint string. */
|
||||
unsigned int nonoffmem_ok:1;
|
||||
/* Nonzero if '<' was found in the constraint string. */
|
||||
@ -71,75 +71,73 @@ struct operand_alternative
|
||||
};
|
||||
|
||||
|
||||
extern void init_recog PARAMS ((void));
|
||||
extern void init_recog_no_volatile PARAMS ((void));
|
||||
extern int recog_memoized_1 PARAMS ((rtx));
|
||||
extern int check_asm_operands PARAMS ((rtx));
|
||||
extern int asm_operand_ok PARAMS ((rtx, const char *));
|
||||
extern int validate_change PARAMS ((rtx, rtx *, rtx, int));
|
||||
extern int insn_invalid_p PARAMS ((rtx));
|
||||
extern int apply_change_group PARAMS ((void));
|
||||
extern int num_validated_changes PARAMS ((void));
|
||||
extern void cancel_changes PARAMS ((int));
|
||||
extern int constrain_operands PARAMS ((int));
|
||||
extern int constrain_operands_cached PARAMS ((int));
|
||||
extern int memory_address_p PARAMS ((enum machine_mode, rtx));
|
||||
extern int strict_memory_address_p PARAMS ((enum machine_mode, rtx));
|
||||
extern int validate_replace_rtx_subexp PARAMS ((rtx, rtx, rtx, rtx *));
|
||||
extern int validate_replace_rtx PARAMS ((rtx, rtx, rtx));
|
||||
extern void validate_replace_rtx_group PARAMS ((rtx, rtx, rtx));
|
||||
extern int validate_replace_src PARAMS ((rtx, rtx, rtx));
|
||||
extern void validate_replace_src_group PARAMS ((rtx, rtx, rtx));
|
||||
extern int num_changes_pending PARAMS ((void));
|
||||
extern void init_recog (void);
|
||||
extern void init_recog_no_volatile (void);
|
||||
extern int recog_memoized_1 (rtx);
|
||||
extern int check_asm_operands (rtx);
|
||||
extern int asm_operand_ok (rtx, const char *);
|
||||
extern int validate_change (rtx, rtx *, rtx, int);
|
||||
extern int insn_invalid_p (rtx);
|
||||
extern int apply_change_group (void);
|
||||
extern int num_validated_changes (void);
|
||||
extern void cancel_changes (int);
|
||||
extern int constrain_operands (int);
|
||||
extern int constrain_operands_cached (int);
|
||||
extern int memory_address_p (enum machine_mode, rtx);
|
||||
extern int strict_memory_address_p (enum machine_mode, rtx);
|
||||
extern int validate_replace_rtx_subexp (rtx, rtx, rtx, rtx *);
|
||||
extern int validate_replace_rtx (rtx, rtx, rtx);
|
||||
extern void validate_replace_rtx_group (rtx, rtx, rtx);
|
||||
extern int validate_replace_src (rtx, rtx, rtx);
|
||||
extern void validate_replace_src_group (rtx, rtx, rtx);
|
||||
extern int num_changes_pending (void);
|
||||
#ifdef HAVE_cc0
|
||||
extern int next_insn_tests_no_inequality PARAMS ((rtx));
|
||||
extern int next_insn_tests_no_inequality (rtx);
|
||||
#endif
|
||||
extern int reg_fits_class_p PARAMS ((rtx, enum reg_class, int,
|
||||
enum machine_mode));
|
||||
extern rtx *find_single_use PARAMS ((rtx, rtx, rtx *));
|
||||
extern int reg_fits_class_p (rtx, enum reg_class, int, enum machine_mode);
|
||||
extern rtx *find_single_use (rtx, rtx, rtx *);
|
||||
|
||||
extern int general_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int address_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int register_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int pmode_register_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int scratch_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int immediate_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int const_int_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int const_double_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int nonimmediate_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int nonmemory_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int push_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int pop_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int memory_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int indirect_operand PARAMS ((rtx, enum machine_mode));
|
||||
extern int comparison_operator PARAMS ((rtx, enum machine_mode));
|
||||
extern int general_operand (rtx, enum machine_mode);
|
||||
extern int address_operand (rtx, enum machine_mode);
|
||||
extern int register_operand (rtx, enum machine_mode);
|
||||
extern int pmode_register_operand (rtx, enum machine_mode);
|
||||
extern int scratch_operand (rtx, enum machine_mode);
|
||||
extern int immediate_operand (rtx, enum machine_mode);
|
||||
extern int const_int_operand (rtx, enum machine_mode);
|
||||
extern int const_double_operand (rtx, enum machine_mode);
|
||||
extern int nonimmediate_operand (rtx, enum machine_mode);
|
||||
extern int nonmemory_operand (rtx, enum machine_mode);
|
||||
extern int push_operand (rtx, enum machine_mode);
|
||||
extern int pop_operand (rtx, enum machine_mode);
|
||||
extern int memory_operand (rtx, enum machine_mode);
|
||||
extern int indirect_operand (rtx, enum machine_mode);
|
||||
extern int comparison_operator (rtx, enum machine_mode);
|
||||
|
||||
extern int offsettable_memref_p PARAMS ((rtx));
|
||||
extern int offsettable_nonstrict_memref_p PARAMS ((rtx));
|
||||
extern int offsettable_address_p PARAMS ((int, enum machine_mode, rtx));
|
||||
extern int mode_dependent_address_p PARAMS ((rtx));
|
||||
extern int offsettable_memref_p (rtx);
|
||||
extern int offsettable_nonstrict_memref_p (rtx);
|
||||
extern int offsettable_address_p (int, enum machine_mode, rtx);
|
||||
extern int mode_dependent_address_p (rtx);
|
||||
|
||||
extern int recog PARAMS ((rtx, rtx, int *));
|
||||
extern void add_clobbers PARAMS ((rtx, int));
|
||||
extern int added_clobbers_hard_reg_p PARAMS ((int));
|
||||
extern void insn_extract PARAMS ((rtx));
|
||||
extern void extract_insn PARAMS ((rtx));
|
||||
extern void extract_constrain_insn_cached PARAMS ((rtx));
|
||||
extern void extract_insn_cached PARAMS ((rtx));
|
||||
extern void preprocess_constraints PARAMS ((void));
|
||||
extern rtx peep2_next_insn PARAMS ((int));
|
||||
extern int peep2_regno_dead_p PARAMS ((int, int));
|
||||
extern int peep2_reg_dead_p PARAMS ((int, rtx));
|
||||
extern int recog (rtx, rtx, int *);
|
||||
extern void add_clobbers (rtx, int);
|
||||
extern int added_clobbers_hard_reg_p (int);
|
||||
extern void insn_extract (rtx);
|
||||
extern void extract_insn (rtx);
|
||||
extern void extract_constrain_insn_cached (rtx);
|
||||
extern void extract_insn_cached (rtx);
|
||||
extern void preprocess_constraints (void);
|
||||
extern rtx peep2_next_insn (int);
|
||||
extern int peep2_regno_dead_p (int, int);
|
||||
extern int peep2_reg_dead_p (int, rtx);
|
||||
#ifdef CLEAR_HARD_REG_SET
|
||||
extern rtx peep2_find_free_register PARAMS ((int, int, const char *,
|
||||
enum machine_mode,
|
||||
HARD_REG_SET *));
|
||||
extern rtx peep2_find_free_register (int, int, const char *,
|
||||
enum machine_mode, HARD_REG_SET *);
|
||||
#endif
|
||||
extern void peephole2_optimize PARAMS ((FILE *));
|
||||
extern rtx peephole2_insns PARAMS ((rtx, rtx, int *));
|
||||
extern void peephole2_optimize (FILE *);
|
||||
extern rtx peephole2_insns (rtx, rtx, int *);
|
||||
|
||||
extern int store_data_bypass_p PARAMS ((rtx, rtx));
|
||||
extern int if_test_bypass_p PARAMS ((rtx, rtx));
|
||||
extern int store_data_bypass_p (rtx, rtx);
|
||||
extern int if_test_bypass_p (rtx, rtx);
|
||||
|
||||
/* Nonzero means volatile operands are recognized. */
|
||||
extern int volatile_ok;
|
||||
@ -182,7 +180,7 @@ struct recog_data
|
||||
char dup_num[MAX_DUP_OPERANDS];
|
||||
|
||||
/* ??? Note that these are `char' instead of `unsigned char' to (try to)
|
||||
avoid certain lossage from K&R C, wherein `unsigned char' default
|
||||
avoid certain lossage from K&R C, wherein `unsigned char' default
|
||||
promotes to `unsigned int' instead of `int' as in ISO C. As of 1999,
|
||||
the most common places to bootstrap from K&R C are SunOS and HPUX,
|
||||
both of which have signed characters by default. The only other
|
||||
@ -213,9 +211,9 @@ extern struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALT
|
||||
/* A table defined in insn-output.c that give information about
|
||||
each insn-code value. */
|
||||
|
||||
typedef int (*insn_operand_predicate_fn) PARAMS ((rtx, enum machine_mode));
|
||||
typedef const char * (*insn_output_fn) PARAMS ((rtx *, rtx));
|
||||
typedef rtx (*insn_gen_fn) PARAMS ((rtx, ...));
|
||||
typedef int (*insn_operand_predicate_fn) (rtx, enum machine_mode);
|
||||
typedef const char * (*insn_output_fn) (rtx *, rtx);
|
||||
typedef rtx (*insn_gen_fn) (rtx, ...);
|
||||
|
||||
struct insn_operand_data
|
||||
{
|
||||
|
183
gcc/reg-stack.c
183
gcc/reg-stack.c
@ -236,45 +236,41 @@ static rtx nan;
|
||||
|
||||
/* Forward declarations */
|
||||
|
||||
static int stack_regs_mentioned_p PARAMS ((rtx pat));
|
||||
static void straighten_stack PARAMS ((rtx, stack));
|
||||
static void pop_stack PARAMS ((stack, int));
|
||||
static rtx *get_true_reg PARAMS ((rtx *));
|
||||
static int stack_regs_mentioned_p (rtx pat);
|
||||
static void straighten_stack (rtx, stack);
|
||||
static void pop_stack (stack, int);
|
||||
static rtx *get_true_reg (rtx *);
|
||||
|
||||
static int check_asm_stack_operands PARAMS ((rtx));
|
||||
static int get_asm_operand_n_inputs PARAMS ((rtx));
|
||||
static rtx stack_result PARAMS ((tree));
|
||||
static void replace_reg PARAMS ((rtx *, int));
|
||||
static void remove_regno_note PARAMS ((rtx, enum reg_note,
|
||||
unsigned int));
|
||||
static int get_hard_regnum PARAMS ((stack, rtx));
|
||||
static rtx emit_pop_insn PARAMS ((rtx, stack, rtx,
|
||||
enum emit_where));
|
||||
static void emit_swap_insn PARAMS ((rtx, stack, rtx));
|
||||
static void move_for_stack_reg PARAMS ((rtx, stack, rtx));
|
||||
static int swap_rtx_condition_1 PARAMS ((rtx));
|
||||
static int swap_rtx_condition PARAMS ((rtx));
|
||||
static void compare_for_stack_reg PARAMS ((rtx, stack, rtx));
|
||||
static void subst_stack_regs_pat PARAMS ((rtx, stack, rtx));
|
||||
static void subst_asm_stack_regs PARAMS ((rtx, stack));
|
||||
static void subst_stack_regs PARAMS ((rtx, stack));
|
||||
static void change_stack PARAMS ((rtx, stack, stack,
|
||||
enum emit_where));
|
||||
static int convert_regs_entry PARAMS ((void));
|
||||
static void convert_regs_exit PARAMS ((void));
|
||||
static int convert_regs_1 PARAMS ((FILE *, basic_block));
|
||||
static int convert_regs_2 PARAMS ((FILE *, basic_block));
|
||||
static int convert_regs PARAMS ((FILE *));
|
||||
static void print_stack PARAMS ((FILE *, stack));
|
||||
static rtx next_flags_user PARAMS ((rtx));
|
||||
static void record_label_references PARAMS ((rtx, rtx));
|
||||
static bool compensate_edge PARAMS ((edge, FILE *));
|
||||
static int check_asm_stack_operands (rtx);
|
||||
static int get_asm_operand_n_inputs (rtx);
|
||||
static rtx stack_result (tree);
|
||||
static void replace_reg (rtx *, int);
|
||||
static void remove_regno_note (rtx, enum reg_note, unsigned int);
|
||||
static int get_hard_regnum (stack, rtx);
|
||||
static rtx emit_pop_insn (rtx, stack, rtx, enum emit_where);
|
||||
static void emit_swap_insn (rtx, stack, rtx);
|
||||
static void move_for_stack_reg (rtx, stack, rtx);
|
||||
static int swap_rtx_condition_1 (rtx);
|
||||
static int swap_rtx_condition (rtx);
|
||||
static void compare_for_stack_reg (rtx, stack, rtx);
|
||||
static void subst_stack_regs_pat (rtx, stack, rtx);
|
||||
static void subst_asm_stack_regs (rtx, stack);
|
||||
static void subst_stack_regs (rtx, stack);
|
||||
static void change_stack (rtx, stack, stack, enum emit_where);
|
||||
static int convert_regs_entry (void);
|
||||
static void convert_regs_exit (void);
|
||||
static int convert_regs_1 (FILE *, basic_block);
|
||||
static int convert_regs_2 (FILE *, basic_block);
|
||||
static int convert_regs (FILE *);
|
||||
static void print_stack (FILE *, stack);
|
||||
static rtx next_flags_user (rtx);
|
||||
static void record_label_references (rtx, rtx);
|
||||
static bool compensate_edge (edge, FILE *);
|
||||
|
||||
/* Return nonzero if any stack register is mentioned somewhere within PAT. */
|
||||
|
||||
static int
|
||||
stack_regs_mentioned_p (pat)
|
||||
rtx pat;
|
||||
stack_regs_mentioned_p (rtx pat)
|
||||
{
|
||||
const char *fmt;
|
||||
int i;
|
||||
@ -303,8 +299,7 @@ stack_regs_mentioned_p (pat)
|
||||
/* Return nonzero if INSN mentions stacked registers, else return zero. */
|
||||
|
||||
int
|
||||
stack_regs_mentioned (insn)
|
||||
rtx insn;
|
||||
stack_regs_mentioned (rtx insn)
|
||||
{
|
||||
unsigned int uid, max;
|
||||
int test;
|
||||
@ -336,8 +331,7 @@ stack_regs_mentioned (insn)
|
||||
static rtx ix86_flags_rtx;
|
||||
|
||||
static rtx
|
||||
next_flags_user (insn)
|
||||
rtx insn;
|
||||
next_flags_user (rtx insn)
|
||||
{
|
||||
/* Search forward looking for the first use of this value.
|
||||
Stop at block boundaries. */
|
||||
@ -359,9 +353,7 @@ next_flags_user (insn)
|
||||
after this insn. */
|
||||
|
||||
static void
|
||||
straighten_stack (insn, regstack)
|
||||
rtx insn;
|
||||
stack regstack;
|
||||
straighten_stack (rtx insn, stack regstack)
|
||||
{
|
||||
struct stack_def temp_stack;
|
||||
int top;
|
||||
@ -384,9 +376,7 @@ straighten_stack (insn, regstack)
|
||||
/* Pop a register from the stack. */
|
||||
|
||||
static void
|
||||
pop_stack (regstack, regno)
|
||||
stack regstack;
|
||||
int regno;
|
||||
pop_stack (stack regstack, int regno)
|
||||
{
|
||||
int top = regstack->top;
|
||||
|
||||
@ -417,9 +407,7 @@ pop_stack (regstack, regno)
|
||||
the edges. */
|
||||
|
||||
bool
|
||||
reg_to_stack (first, file)
|
||||
rtx first;
|
||||
FILE *file;
|
||||
reg_to_stack (rtx first, FILE *file)
|
||||
{
|
||||
basic_block bb;
|
||||
int i;
|
||||
@ -437,7 +425,7 @@ reg_to_stack (first, file)
|
||||
return false;
|
||||
|
||||
/* Ok, floating point instructions exist. If not optimizing,
|
||||
build the CFG and run life analysis.
|
||||
build the CFG and run life analysis.
|
||||
Also need to rebuild life when superblock scheduling is done
|
||||
as it don't update liveness yet. */
|
||||
if (!optimize
|
||||
@ -507,8 +495,7 @@ reg_to_stack (first, file)
|
||||
reference. */
|
||||
|
||||
static void
|
||||
record_label_references (insn, pat)
|
||||
rtx insn, pat;
|
||||
record_label_references (rtx insn, rtx pat)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (pat);
|
||||
int i;
|
||||
@ -561,8 +548,7 @@ record_label_references (insn, pat)
|
||||
PAT that stopped the search. */
|
||||
|
||||
static rtx *
|
||||
get_true_reg (pat)
|
||||
rtx *pat;
|
||||
get_true_reg (rtx *pat)
|
||||
{
|
||||
for (;;)
|
||||
switch (GET_CODE (*pat))
|
||||
@ -599,8 +585,7 @@ static bool any_malformed_asm;
|
||||
numbers below refer to that explanation. */
|
||||
|
||||
static int
|
||||
check_asm_stack_operands (insn)
|
||||
rtx insn;
|
||||
check_asm_stack_operands (rtx insn)
|
||||
{
|
||||
int i;
|
||||
int n_clobbers;
|
||||
@ -788,8 +773,7 @@ check_asm_stack_operands (insn)
|
||||
placed. */
|
||||
|
||||
static int
|
||||
get_asm_operand_n_inputs (body)
|
||||
rtx body;
|
||||
get_asm_operand_n_inputs (rtx body)
|
||||
{
|
||||
if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
|
||||
return ASM_OPERANDS_INPUT_LENGTH (SET_SRC (body));
|
||||
@ -812,8 +796,7 @@ get_asm_operand_n_inputs (body)
|
||||
return the REG. Otherwise, return 0. */
|
||||
|
||||
static rtx
|
||||
stack_result (decl)
|
||||
tree decl;
|
||||
stack_result (tree decl)
|
||||
{
|
||||
rtx result;
|
||||
|
||||
@ -846,9 +829,7 @@ stack_result (decl)
|
||||
the desired hard REGNO. */
|
||||
|
||||
static void
|
||||
replace_reg (reg, regno)
|
||||
rtx *reg;
|
||||
int regno;
|
||||
replace_reg (rtx *reg, int regno)
|
||||
{
|
||||
if (regno < FIRST_STACK_REG || regno > LAST_STACK_REG
|
||||
|| ! STACK_REG_P (*reg))
|
||||
@ -868,10 +849,7 @@ replace_reg (reg, regno)
|
||||
number REGNO from INSN. Remove only one such note. */
|
||||
|
||||
static void
|
||||
remove_regno_note (insn, note, regno)
|
||||
rtx insn;
|
||||
enum reg_note note;
|
||||
unsigned int regno;
|
||||
remove_regno_note (rtx insn, enum reg_note note, unsigned int regno)
|
||||
{
|
||||
rtx *note_link, this;
|
||||
|
||||
@ -894,9 +872,7 @@ remove_regno_note (insn, note, regno)
|
||||
returned if the register is not found. */
|
||||
|
||||
static int
|
||||
get_hard_regnum (regstack, reg)
|
||||
stack regstack;
|
||||
rtx reg;
|
||||
get_hard_regnum (stack regstack, rtx reg)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -918,11 +894,7 @@ get_hard_regnum (regstack, reg)
|
||||
cases the movdf pattern to pop. */
|
||||
|
||||
static rtx
|
||||
emit_pop_insn (insn, regstack, reg, where)
|
||||
rtx insn;
|
||||
stack regstack;
|
||||
rtx reg;
|
||||
enum emit_where where;
|
||||
emit_pop_insn (rtx insn, stack regstack, rtx reg, enum emit_where where)
|
||||
{
|
||||
rtx pop_insn, pop_rtx;
|
||||
int hard_regno;
|
||||
@ -977,10 +949,7 @@ emit_pop_insn (insn, regstack, reg, where)
|
||||
If REG is already at the top of the stack, no insn is emitted. */
|
||||
|
||||
static void
|
||||
emit_swap_insn (insn, regstack, reg)
|
||||
rtx insn;
|
||||
stack regstack;
|
||||
rtx reg;
|
||||
emit_swap_insn (rtx insn, stack regstack, rtx reg)
|
||||
{
|
||||
int hard_regno;
|
||||
rtx swap_rtx;
|
||||
@ -1062,10 +1031,7 @@ emit_swap_insn (insn, regstack, reg)
|
||||
REGSTACK is the current stack. */
|
||||
|
||||
static void
|
||||
move_for_stack_reg (insn, regstack, pat)
|
||||
rtx insn;
|
||||
stack regstack;
|
||||
rtx pat;
|
||||
move_for_stack_reg (rtx insn, stack regstack, rtx pat)
|
||||
{
|
||||
rtx *psrc = get_true_reg (&SET_SRC (pat));
|
||||
rtx *pdest = get_true_reg (&SET_DEST (pat));
|
||||
@ -1209,8 +1175,7 @@ move_for_stack_reg (insn, regstack, pat)
|
||||
such. */
|
||||
|
||||
static int
|
||||
swap_rtx_condition_1 (pat)
|
||||
rtx pat;
|
||||
swap_rtx_condition_1 (rtx pat)
|
||||
{
|
||||
const char *fmt;
|
||||
int i, r = 0;
|
||||
@ -1241,8 +1206,7 @@ swap_rtx_condition_1 (pat)
|
||||
}
|
||||
|
||||
static int
|
||||
swap_rtx_condition (insn)
|
||||
rtx insn;
|
||||
swap_rtx_condition (rtx insn)
|
||||
{
|
||||
rtx pat = PATTERN (insn);
|
||||
|
||||
@ -1329,10 +1293,7 @@ swap_rtx_condition (insn)
|
||||
set up. */
|
||||
|
||||
static void
|
||||
compare_for_stack_reg (insn, regstack, pat_src)
|
||||
rtx insn;
|
||||
stack regstack;
|
||||
rtx pat_src;
|
||||
compare_for_stack_reg (rtx insn, stack regstack, rtx pat_src)
|
||||
{
|
||||
rtx *src1, *src2;
|
||||
rtx src1_note, src2_note;
|
||||
@ -1421,10 +1382,7 @@ compare_for_stack_reg (insn, regstack, pat_src)
|
||||
is the current register layout. */
|
||||
|
||||
static void
|
||||
subst_stack_regs_pat (insn, regstack, pat)
|
||||
rtx insn;
|
||||
stack regstack;
|
||||
rtx pat;
|
||||
subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
|
||||
{
|
||||
rtx *dest, *src;
|
||||
|
||||
@ -1749,7 +1707,7 @@ subst_stack_regs_pat (insn, regstack, pat)
|
||||
struct stack_def temp_stack;
|
||||
int regno, j, k, temp;
|
||||
|
||||
temp_stack = *regstack;
|
||||
temp_stack = *regstack;
|
||||
|
||||
/* Place operand 1 at the top of stack. */
|
||||
regno = get_hard_regnum (&temp_stack, *src1);
|
||||
@ -1937,9 +1895,7 @@ subst_stack_regs_pat (insn, regstack, pat)
|
||||
requirements, since record_asm_stack_regs removes any problem asm. */
|
||||
|
||||
static void
|
||||
subst_asm_stack_regs (insn, regstack)
|
||||
rtx insn;
|
||||
stack regstack;
|
||||
subst_asm_stack_regs (rtx insn, stack regstack)
|
||||
{
|
||||
rtx body = PATTERN (insn);
|
||||
int alt;
|
||||
@ -2226,9 +2182,7 @@ subst_asm_stack_regs (insn, regstack)
|
||||
stack for the 387 based on the contents of the insn. */
|
||||
|
||||
static void
|
||||
subst_stack_regs (insn, regstack)
|
||||
rtx insn;
|
||||
stack regstack;
|
||||
subst_stack_regs (rtx insn, stack regstack)
|
||||
{
|
||||
rtx *note_link, note;
|
||||
int i;
|
||||
@ -2320,11 +2274,7 @@ subst_stack_regs (insn, regstack)
|
||||
is no longer needed once this has executed. */
|
||||
|
||||
static void
|
||||
change_stack (insn, old, new, where)
|
||||
rtx insn;
|
||||
stack old;
|
||||
stack new;
|
||||
enum emit_where where;
|
||||
change_stack (rtx insn, stack old, stack new, enum emit_where where)
|
||||
{
|
||||
int reg;
|
||||
int update_end = 0;
|
||||
@ -2423,9 +2373,7 @@ change_stack (insn, old, new, where)
|
||||
/* Print stack configuration. */
|
||||
|
||||
static void
|
||||
print_stack (file, s)
|
||||
FILE *file;
|
||||
stack s;
|
||||
print_stack (FILE *file, stack s)
|
||||
{
|
||||
if (! file)
|
||||
return;
|
||||
@ -2453,7 +2401,7 @@ print_stack (file, s)
|
||||
commit_edge_insertions needs to be called. */
|
||||
|
||||
static int
|
||||
convert_regs_entry ()
|
||||
convert_regs_entry (void)
|
||||
{
|
||||
int inserted = 0;
|
||||
edge e;
|
||||
@ -2516,7 +2464,7 @@ convert_regs_entry ()
|
||||
be `empty', or the function return value at top-of-stack. */
|
||||
|
||||
static void
|
||||
convert_regs_exit ()
|
||||
convert_regs_exit (void)
|
||||
{
|
||||
int value_reg_low, value_reg_high;
|
||||
stack output_stack;
|
||||
@ -2551,9 +2499,7 @@ convert_regs_exit ()
|
||||
target block, or copy stack info into the stack of the successor
|
||||
of the successor hasn't been processed yet. */
|
||||
static bool
|
||||
compensate_edge (e, file)
|
||||
edge e;
|
||||
FILE *file;
|
||||
compensate_edge (edge e, FILE *file)
|
||||
{
|
||||
basic_block block = e->src, target = e->dest;
|
||||
block_info bi = BLOCK_INFO (block);
|
||||
@ -2688,9 +2634,7 @@ compensate_edge (e, file)
|
||||
/* Convert stack register references in one block. */
|
||||
|
||||
static int
|
||||
convert_regs_1 (file, block)
|
||||
FILE *file;
|
||||
basic_block block;
|
||||
convert_regs_1 (FILE *file, basic_block block)
|
||||
{
|
||||
struct stack_def regstack;
|
||||
block_info bi = BLOCK_INFO (block);
|
||||
@ -2851,9 +2795,7 @@ convert_regs_1 (file, block)
|
||||
/* Convert registers in all blocks reachable from BLOCK. */
|
||||
|
||||
static int
|
||||
convert_regs_2 (file, block)
|
||||
FILE *file;
|
||||
basic_block block;
|
||||
convert_regs_2 (FILE *file, basic_block block)
|
||||
{
|
||||
basic_block *stack, *sp;
|
||||
int inserted;
|
||||
@ -2890,8 +2832,7 @@ convert_regs_2 (file, block)
|
||||
to the stack-like registers the 387 uses. */
|
||||
|
||||
static int
|
||||
convert_regs (file)
|
||||
FILE *file;
|
||||
convert_regs (FILE *file)
|
||||
{
|
||||
int inserted;
|
||||
basic_block b;
|
||||
|
157
gcc/regclass.c
157
gcc/regclass.c
@ -45,9 +45,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#include "ggc.h"
|
||||
#include "timevar.h"
|
||||
|
||||
static void init_reg_sets_1 PARAMS ((void));
|
||||
static void init_reg_modes PARAMS ((void));
|
||||
static void init_reg_autoinc PARAMS ((void));
|
||||
static void init_reg_sets_1 (void);
|
||||
static void init_reg_modes (void);
|
||||
static void init_reg_autoinc (void);
|
||||
|
||||
/* If we have auto-increment or auto-decrement and we can have secondary
|
||||
reloads, we are not allowed to use classes requiring secondary
|
||||
@ -261,7 +261,7 @@ static int no_global_reg_vars = 0;
|
||||
Once this is done, various switches may override. */
|
||||
|
||||
void
|
||||
init_reg_sets ()
|
||||
init_reg_sets (void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@ -296,7 +296,7 @@ init_reg_sets ()
|
||||
`fixed_regs' and `call_used_regs', convert them to HARD_REG_SETs. */
|
||||
|
||||
static void
|
||||
init_reg_sets_1 ()
|
||||
init_reg_sets_1 (void)
|
||||
{
|
||||
unsigned int i, j;
|
||||
unsigned int /* enum machine_mode */ m;
|
||||
@ -547,7 +547,7 @@ init_reg_sets_1 ()
|
||||
(as opposed to a multi-register mode). */
|
||||
|
||||
static void
|
||||
init_reg_modes ()
|
||||
init_reg_modes (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -569,7 +569,7 @@ init_reg_modes ()
|
||||
initialize the register modes. */
|
||||
|
||||
void
|
||||
init_regs ()
|
||||
init_regs (void)
|
||||
{
|
||||
/* This finishes what was started by init_reg_sets, but couldn't be done
|
||||
until after register usage was specified. */
|
||||
@ -584,7 +584,7 @@ init_regs ()
|
||||
memory_move_secondary_cost. */
|
||||
|
||||
void
|
||||
init_fake_stack_mems ()
|
||||
init_fake_stack_mems (void)
|
||||
{
|
||||
#ifdef HAVE_SECONDARY_RELOADS
|
||||
{
|
||||
@ -602,10 +602,7 @@ init_fake_stack_mems ()
|
||||
Only needed if secondary reloads are required for memory moves. */
|
||||
|
||||
int
|
||||
memory_move_secondary_cost (mode, class, in)
|
||||
enum machine_mode mode;
|
||||
enum reg_class class;
|
||||
int in;
|
||||
memory_move_secondary_cost (enum machine_mode mode, enum reg_class class, int in)
|
||||
{
|
||||
enum reg_class altclass;
|
||||
int partial_cost = 0;
|
||||
@ -659,9 +656,8 @@ memory_move_secondary_cost (mode, class, in)
|
||||
enough to save nregs. If we can't find one, return VOIDmode. */
|
||||
|
||||
enum machine_mode
|
||||
choose_hard_reg_mode (regno, nregs)
|
||||
unsigned int regno ATTRIBUTE_UNUSED;
|
||||
unsigned int nregs;
|
||||
choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
|
||||
unsigned int nregs)
|
||||
{
|
||||
unsigned int /* enum machine_mode */ m;
|
||||
enum machine_mode found_mode = VOIDmode, mode;
|
||||
@ -728,9 +724,7 @@ choose_hard_reg_mode (regno, nregs)
|
||||
call-used register if CALL_USED. */
|
||||
|
||||
void
|
||||
fix_register (name, fixed, call_used)
|
||||
const char *name;
|
||||
int fixed, call_used;
|
||||
fix_register (const char *name, int fixed, int call_used)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -774,8 +768,7 @@ fix_register (name, fixed, call_used)
|
||||
/* Mark register number I as global. */
|
||||
|
||||
void
|
||||
globalize_reg (i)
|
||||
int i;
|
||||
globalize_reg (int i)
|
||||
{
|
||||
if (fixed_regs[i] == 0 && no_global_reg_vars)
|
||||
error ("global register variable follows a function definition");
|
||||
@ -854,27 +847,25 @@ static struct reg_pref *reg_pref_buffer;
|
||||
|
||||
static int frequency;
|
||||
|
||||
static rtx scan_one_insn PARAMS ((rtx, int));
|
||||
static void record_operand_costs PARAMS ((rtx, struct costs *, struct reg_pref *));
|
||||
static void dump_regclass PARAMS ((FILE *));
|
||||
static void record_reg_classes PARAMS ((int, int, rtx *, enum machine_mode *,
|
||||
const char **, rtx,
|
||||
struct costs *, struct reg_pref *));
|
||||
static int copy_cost PARAMS ((rtx, enum machine_mode,
|
||||
enum reg_class, int));
|
||||
static void record_address_regs PARAMS ((rtx, enum reg_class, int));
|
||||
static rtx scan_one_insn (rtx, int);
|
||||
static void record_operand_costs (rtx, struct costs *, struct reg_pref *);
|
||||
static void dump_regclass (FILE *);
|
||||
static void record_reg_classes (int, int, rtx *, enum machine_mode *,
|
||||
const char **, rtx, struct costs *,
|
||||
struct reg_pref *);
|
||||
static int copy_cost (rtx, enum machine_mode, enum reg_class, int);
|
||||
static void record_address_regs (rtx, enum reg_class, int);
|
||||
#ifdef FORBIDDEN_INC_DEC_CLASSES
|
||||
static int auto_inc_dec_reg_p PARAMS ((rtx, enum machine_mode));
|
||||
static int auto_inc_dec_reg_p (rtx, enum machine_mode);
|
||||
#endif
|
||||
static void reg_scan_mark_refs PARAMS ((rtx, rtx, int, unsigned int));
|
||||
static void reg_scan_mark_refs (rtx, rtx, int, unsigned int);
|
||||
|
||||
/* Return the reg_class in which pseudo reg number REGNO is best allocated.
|
||||
This function is sometimes called before the info has been computed.
|
||||
When that happens, just return GENERAL_REGS, which is innocuous. */
|
||||
|
||||
enum reg_class
|
||||
reg_preferred_class (regno)
|
||||
int regno;
|
||||
reg_preferred_class (int regno)
|
||||
{
|
||||
if (reg_pref == 0)
|
||||
return GENERAL_REGS;
|
||||
@ -882,8 +873,7 @@ reg_preferred_class (regno)
|
||||
}
|
||||
|
||||
enum reg_class
|
||||
reg_alternate_class (regno)
|
||||
int regno;
|
||||
reg_alternate_class (int regno)
|
||||
{
|
||||
if (reg_pref == 0)
|
||||
return ALL_REGS;
|
||||
@ -894,7 +884,7 @@ reg_alternate_class (regno)
|
||||
/* Initialize some global data for this pass. */
|
||||
|
||||
void
|
||||
regclass_init ()
|
||||
regclass_init (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -912,8 +902,7 @@ regclass_init ()
|
||||
|
||||
/* Dump register costs. */
|
||||
static void
|
||||
dump_regclass (dump)
|
||||
FILE *dump;
|
||||
dump_regclass (FILE *dump)
|
||||
{
|
||||
static const char *const reg_class_names[] = REG_CLASS_NAMES;
|
||||
int i;
|
||||
@ -945,10 +934,8 @@ dump_regclass (dump)
|
||||
/* Calculate the costs of insn operands. */
|
||||
|
||||
static void
|
||||
record_operand_costs (insn, op_costs, reg_pref)
|
||||
rtx insn;
|
||||
struct costs *op_costs;
|
||||
struct reg_pref *reg_pref;
|
||||
record_operand_costs (rtx insn, struct costs *op_costs,
|
||||
struct reg_pref *reg_pref)
|
||||
{
|
||||
const char *constraints[MAX_RECOG_OPERANDS];
|
||||
enum machine_mode modes[MAX_RECOG_OPERANDS];
|
||||
@ -1018,9 +1005,7 @@ record_operand_costs (insn, op_costs, reg_pref)
|
||||
there. */
|
||||
|
||||
static rtx
|
||||
scan_one_insn (insn, pass)
|
||||
rtx insn;
|
||||
int pass;
|
||||
scan_one_insn (rtx insn, int pass)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (insn);
|
||||
enum rtx_code pat_code;
|
||||
@ -1147,7 +1132,7 @@ scan_one_insn (insn, pass)
|
||||
pseudos that are auto-incremented or auto-decremented. */
|
||||
|
||||
static void
|
||||
init_reg_autoinc ()
|
||||
init_reg_autoinc (void)
|
||||
{
|
||||
#ifdef FORBIDDEN_INC_DEC_CLASSES
|
||||
int i;
|
||||
@ -1203,10 +1188,7 @@ init_reg_autoinc ()
|
||||
This pass comes just before local register allocation. */
|
||||
|
||||
void
|
||||
regclass (f, nregs, dump)
|
||||
rtx f;
|
||||
int nregs;
|
||||
FILE *dump;
|
||||
regclass (rtx f, int nregs, FILE *dump)
|
||||
{
|
||||
rtx insn;
|
||||
int i;
|
||||
@ -1395,16 +1377,10 @@ regclass (f, nregs, dump)
|
||||
alternatives. */
|
||||
|
||||
static void
|
||||
record_reg_classes (n_alts, n_ops, ops, modes,
|
||||
constraints, insn, op_costs, reg_pref)
|
||||
int n_alts;
|
||||
int n_ops;
|
||||
rtx *ops;
|
||||
enum machine_mode *modes;
|
||||
const char **constraints;
|
||||
rtx insn;
|
||||
struct costs *op_costs;
|
||||
struct reg_pref *reg_pref;
|
||||
record_reg_classes (int n_alts, int n_ops, rtx *ops,
|
||||
enum machine_mode *modes, const char **constraints,
|
||||
rtx insn, struct costs *op_costs,
|
||||
struct reg_pref *reg_pref)
|
||||
{
|
||||
int alt;
|
||||
int i, j;
|
||||
@ -1886,11 +1862,8 @@ record_reg_classes (n_alts, n_ops, ops, modes,
|
||||
X must not be a pseudo. */
|
||||
|
||||
static int
|
||||
copy_cost (x, mode, class, to_p)
|
||||
rtx x;
|
||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
||||
enum reg_class class;
|
||||
int to_p ATTRIBUTE_UNUSED;
|
||||
copy_cost (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED,
|
||||
enum reg_class class, int to_p ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef HAVE_SECONDARY_RELOADS
|
||||
enum reg_class secondary_class = NO_REGS;
|
||||
@ -1951,10 +1924,7 @@ copy_cost (x, mode, class, to_p)
|
||||
can represent half-cost adjustments). */
|
||||
|
||||
static void
|
||||
record_address_regs (x, class, scale)
|
||||
rtx x;
|
||||
enum reg_class class;
|
||||
int scale;
|
||||
record_address_regs (rtx x, enum reg_class class, int scale)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
|
||||
@ -2135,9 +2105,7 @@ record_address_regs (x, class, scale)
|
||||
to an object of MODE. */
|
||||
|
||||
static int
|
||||
auto_inc_dec_reg_p (reg, mode)
|
||||
rtx reg;
|
||||
enum machine_mode mode;
|
||||
auto_inc_dec_reg_p (rtx reg, enum machine_mode mode)
|
||||
{
|
||||
if (HAVE_POST_INCREMENT
|
||||
&& memory_address_p (mode, gen_rtx_POST_INC (Pmode, reg)))
|
||||
@ -2171,10 +2139,7 @@ static unsigned int reg_n_max;
|
||||
RENUMBER_P is nonzero, allocate the reg_renumber array also. */
|
||||
|
||||
void
|
||||
allocate_reg_info (num_regs, new_p, renumber_p)
|
||||
size_t num_regs;
|
||||
int new_p;
|
||||
int renumber_p;
|
||||
allocate_reg_info (size_t num_regs, int new_p, int renumber_p)
|
||||
{
|
||||
size_t size_info;
|
||||
size_t size_renumber;
|
||||
@ -2278,7 +2243,7 @@ allocate_reg_info (num_regs, new_p, renumber_p)
|
||||
|
||||
/* Free up the space allocated by allocate_reg_info. */
|
||||
void
|
||||
free_reg_info ()
|
||||
free_reg_info (void)
|
||||
{
|
||||
if (reg_n_info)
|
||||
{
|
||||
@ -2324,10 +2289,7 @@ int max_parallel;
|
||||
static int max_set_parallel;
|
||||
|
||||
void
|
||||
reg_scan (f, nregs, repeat)
|
||||
rtx f;
|
||||
unsigned int nregs;
|
||||
int repeat ATTRIBUTE_UNUSED;
|
||||
reg_scan (rtx f, unsigned int nregs, int repeat ATTRIBUTE_UNUSED)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -2362,10 +2324,7 @@ reg_scan (f, nregs, repeat)
|
||||
such a REG. We only update information for those. */
|
||||
|
||||
void
|
||||
reg_scan_update (first, last, old_max_regno)
|
||||
rtx first;
|
||||
rtx last;
|
||||
unsigned int old_max_regno;
|
||||
reg_scan_update (rtx first, rtx last, unsigned int old_max_regno)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -2392,11 +2351,7 @@ reg_scan_update (first, last, old_max_regno)
|
||||
greater than or equal to MIN_REGNO. */
|
||||
|
||||
static void
|
||||
reg_scan_mark_refs (x, insn, note_flag, min_regno)
|
||||
rtx x;
|
||||
rtx insn;
|
||||
int note_flag;
|
||||
unsigned int min_regno;
|
||||
reg_scan_mark_refs (rtx x, rtx insn, int note_flag, unsigned int min_regno)
|
||||
{
|
||||
enum rtx_code code;
|
||||
rtx dest;
|
||||
@ -2573,9 +2528,7 @@ reg_scan_mark_refs (x, insn, note_flag, min_regno)
|
||||
is also in C2. */
|
||||
|
||||
int
|
||||
reg_class_subset_p (c1, c2)
|
||||
enum reg_class c1;
|
||||
enum reg_class c2;
|
||||
reg_class_subset_p (enum reg_class c1, enum reg_class c2)
|
||||
{
|
||||
if (c1 == c2) return 1;
|
||||
|
||||
@ -2591,9 +2544,7 @@ reg_class_subset_p (c1, c2)
|
||||
/* Return nonzero if there is a register that is in both C1 and C2. */
|
||||
|
||||
int
|
||||
reg_classes_intersect_p (c1, c2)
|
||||
enum reg_class c1;
|
||||
enum reg_class c2;
|
||||
reg_classes_intersect_p (enum reg_class c1, enum reg_class c2)
|
||||
{
|
||||
#ifdef HARD_REG_SET
|
||||
register
|
||||
@ -2618,7 +2569,7 @@ reg_classes_intersect_p (c1, c2)
|
||||
/* Release any memory allocated by register sets. */
|
||||
|
||||
void
|
||||
regset_release_memory ()
|
||||
regset_release_memory (void)
|
||||
{
|
||||
bitmap_release_memory ();
|
||||
}
|
||||
@ -2628,10 +2579,8 @@ regset_release_memory ()
|
||||
their mode from FROM to any mode in which REGNO was encountered. */
|
||||
|
||||
void
|
||||
cannot_change_mode_set_regs (used, from, regno)
|
||||
HARD_REG_SET *used;
|
||||
enum machine_mode from;
|
||||
unsigned int regno;
|
||||
cannot_change_mode_set_regs (HARD_REG_SET *used, enum machine_mode from,
|
||||
unsigned int regno)
|
||||
{
|
||||
enum machine_mode to;
|
||||
int n, i;
|
||||
@ -2652,10 +2601,8 @@ cannot_change_mode_set_regs (used, from, regno)
|
||||
mode. */
|
||||
|
||||
bool
|
||||
invalid_mode_change_p (regno, class, from_mode)
|
||||
unsigned int regno;
|
||||
enum reg_class class;
|
||||
enum machine_mode from_mode;
|
||||
invalid_mode_change_p (unsigned int regno, enum reg_class class,
|
||||
enum machine_mode from_mode)
|
||||
{
|
||||
enum machine_mode to_mode;
|
||||
int n;
|
||||
|
158
gcc/regmove.c
158
gcc/regmove.c
@ -53,11 +53,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#define STACK_GROWS_DOWNWARD 0
|
||||
#endif
|
||||
|
||||
static int perhaps_ends_bb_p PARAMS ((rtx));
|
||||
static int optimize_reg_copy_1 PARAMS ((rtx, rtx, rtx));
|
||||
static void optimize_reg_copy_2 PARAMS ((rtx, rtx, rtx));
|
||||
static void optimize_reg_copy_3 PARAMS ((rtx, rtx, rtx));
|
||||
static void copy_src_to_dest PARAMS ((rtx, rtx, rtx, int));
|
||||
static int perhaps_ends_bb_p (rtx);
|
||||
static int optimize_reg_copy_1 (rtx, rtx, rtx);
|
||||
static void optimize_reg_copy_2 (rtx, rtx, rtx);
|
||||
static void optimize_reg_copy_3 (rtx, rtx, rtx);
|
||||
static void copy_src_to_dest (rtx, rtx, rtx, int);
|
||||
static int *regmove_bb_head;
|
||||
|
||||
struct match {
|
||||
@ -67,26 +67,24 @@ struct match {
|
||||
int early_clobber[MAX_RECOG_OPERANDS];
|
||||
};
|
||||
|
||||
static rtx discover_flags_reg PARAMS ((void));
|
||||
static void mark_flags_life_zones PARAMS ((rtx));
|
||||
static void flags_set_1 PARAMS ((rtx, rtx, void *));
|
||||
static rtx discover_flags_reg (void);
|
||||
static void mark_flags_life_zones (rtx);
|
||||
static void flags_set_1 (rtx, rtx, void *);
|
||||
|
||||
static int try_auto_increment PARAMS ((rtx, rtx, rtx, rtx, HOST_WIDE_INT, int));
|
||||
static int find_matches PARAMS ((rtx, struct match *));
|
||||
static void replace_in_call_usage PARAMS ((rtx *, unsigned int, rtx, rtx));
|
||||
static int fixup_match_1 PARAMS ((rtx, rtx, rtx, rtx, rtx, int, int, int, FILE *))
|
||||
;
|
||||
static int reg_is_remote_constant_p PARAMS ((rtx, rtx, rtx));
|
||||
static int stable_and_no_regs_but_for_p PARAMS ((rtx, rtx, rtx));
|
||||
static int regclass_compatible_p PARAMS ((int, int));
|
||||
static int replacement_quality PARAMS ((rtx));
|
||||
static int fixup_match_2 PARAMS ((rtx, rtx, rtx, rtx, FILE *));
|
||||
static int try_auto_increment (rtx, rtx, rtx, rtx, HOST_WIDE_INT, int);
|
||||
static int find_matches (rtx, struct match *);
|
||||
static void replace_in_call_usage (rtx *, unsigned int, rtx, rtx);
|
||||
static int fixup_match_1 (rtx, rtx, rtx, rtx, rtx, int, int, int, FILE *);
|
||||
static int reg_is_remote_constant_p (rtx, rtx, rtx);
|
||||
static int stable_and_no_regs_but_for_p (rtx, rtx, rtx);
|
||||
static int regclass_compatible_p (int, int);
|
||||
static int replacement_quality (rtx);
|
||||
static int fixup_match_2 (rtx, rtx, rtx, rtx, FILE *);
|
||||
|
||||
/* Return nonzero if registers with CLASS1 and CLASS2 can be merged without
|
||||
causing too much register allocation problems. */
|
||||
static int
|
||||
regclass_compatible_p (class0, class1)
|
||||
int class0, class1;
|
||||
regclass_compatible_p (int class0, int class1)
|
||||
{
|
||||
return (class0 == class1
|
||||
|| (reg_class_subset_p (class0, class1)
|
||||
@ -100,10 +98,8 @@ regclass_compatible_p (class0, class1)
|
||||
Iff INC_INSN_SET is nonzero, inc_insn has a destination different from src.
|
||||
Return nonzero for success. */
|
||||
static int
|
||||
try_auto_increment (insn, inc_insn, inc_insn_set, reg, increment, pre)
|
||||
rtx reg, insn, inc_insn ,inc_insn_set;
|
||||
HOST_WIDE_INT increment;
|
||||
int pre;
|
||||
try_auto_increment (rtx insn, rtx inc_insn, rtx inc_insn_set, rtx reg,
|
||||
HOST_WIDE_INT increment, int pre)
|
||||
{
|
||||
enum rtx_code inc_code;
|
||||
|
||||
@ -167,7 +163,7 @@ try_auto_increment (insn, inc_insn, inc_insn_set, reg, increment, pre)
|
||||
if no flags were found. Return pc_rtx if we got confused. */
|
||||
|
||||
static rtx
|
||||
discover_flags_reg ()
|
||||
discover_flags_reg (void)
|
||||
{
|
||||
rtx tmp;
|
||||
tmp = gen_rtx_REG (word_mode, 10000);
|
||||
@ -220,8 +216,7 @@ static rtx flags_set_1_rtx;
|
||||
static int flags_set_1_set;
|
||||
|
||||
static void
|
||||
mark_flags_life_zones (flags)
|
||||
rtx flags;
|
||||
mark_flags_life_zones (rtx flags)
|
||||
{
|
||||
int flags_regno;
|
||||
int flags_nregs;
|
||||
@ -319,9 +314,7 @@ mark_flags_life_zones (flags)
|
||||
/* A subroutine of mark_flags_life_zones, called through note_stores. */
|
||||
|
||||
static void
|
||||
flags_set_1 (x, pat, data)
|
||||
rtx x, pat;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
flags_set_1 (rtx x, rtx pat, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (GET_CODE (pat) == SET
|
||||
&& reg_overlap_mentioned_p (x, flags_set_1_rtx))
|
||||
@ -336,8 +329,7 @@ static int *regno_src_regno;
|
||||
a candidate for tying to a hard register, since the output might in
|
||||
turn be a candidate to be tied to a different hard register. */
|
||||
static int
|
||||
replacement_quality (reg)
|
||||
rtx reg;
|
||||
replacement_quality (rtx reg)
|
||||
{
|
||||
int src_regno;
|
||||
|
||||
@ -402,10 +394,7 @@ static int perhaps_ends_bb_p (insn)
|
||||
register-register copy. */
|
||||
|
||||
static int
|
||||
optimize_reg_copy_1 (insn, dest, src)
|
||||
rtx insn;
|
||||
rtx dest;
|
||||
rtx src;
|
||||
optimize_reg_copy_1 (rtx insn, rtx dest, rtx src)
|
||||
{
|
||||
rtx p, q;
|
||||
rtx note;
|
||||
@ -601,10 +590,7 @@ optimize_reg_copy_1 (insn, dest, src)
|
||||
this for hard registers since the substitutions we may make might fail. */
|
||||
|
||||
static void
|
||||
optimize_reg_copy_2 (insn, dest, src)
|
||||
rtx insn;
|
||||
rtx dest;
|
||||
rtx src;
|
||||
optimize_reg_copy_2 (rtx insn, rtx dest, rtx src)
|
||||
{
|
||||
rtx p, q;
|
||||
rtx set;
|
||||
@ -662,10 +648,7 @@ optimize_reg_copy_2 (insn, dest, src)
|
||||
the remaining accesses to use the appropriate SUBREG. This allows
|
||||
SRC and DEST to be tied later. */
|
||||
static void
|
||||
optimize_reg_copy_3 (insn, dest, src)
|
||||
rtx insn;
|
||||
rtx dest;
|
||||
rtx src;
|
||||
optimize_reg_copy_3 (rtx insn, rtx dest, rtx src)
|
||||
{
|
||||
rtx src_reg = XEXP (src, 0);
|
||||
int src_no = REGNO (src_reg);
|
||||
@ -750,11 +733,7 @@ optimize_reg_copy_3 (insn, dest, src)
|
||||
instead moving the value to dest directly before the operation. */
|
||||
|
||||
static void
|
||||
copy_src_to_dest (insn, src, dest, old_max_uid)
|
||||
rtx insn;
|
||||
rtx src;
|
||||
rtx dest;
|
||||
int old_max_uid;
|
||||
copy_src_to_dest (rtx insn, rtx src, rtx dest, int old_max_uid)
|
||||
{
|
||||
rtx seq;
|
||||
rtx link;
|
||||
@ -871,10 +850,7 @@ copy_src_to_dest (insn, src, dest, old_max_uid)
|
||||
the first insn in the function. */
|
||||
|
||||
static int
|
||||
reg_is_remote_constant_p (reg, insn, first)
|
||||
rtx reg;
|
||||
rtx insn;
|
||||
rtx first;
|
||||
reg_is_remote_constant_p (rtx reg, rtx insn, rtx first)
|
||||
{
|
||||
rtx p;
|
||||
|
||||
@ -939,9 +915,7 @@ reg_is_remote_constant_p (reg, insn, first)
|
||||
hard register as ultimate source, like the frame pointer. */
|
||||
|
||||
static int
|
||||
fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
|
||||
rtx insn, dst, src, offset;
|
||||
FILE *regmove_dump_file;
|
||||
fixup_match_2 (rtx insn, rtx dst, rtx src, rtx offset, FILE *regmove_dump_file)
|
||||
{
|
||||
rtx p, dst_death = 0;
|
||||
int length, num_calls = 0;
|
||||
@ -1063,10 +1037,7 @@ fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
|
||||
(or 0 if none should be output). */
|
||||
|
||||
void
|
||||
regmove_optimize (f, nregs, regmove_dump_file)
|
||||
rtx f;
|
||||
int nregs;
|
||||
FILE *regmove_dump_file;
|
||||
regmove_optimize (rtx f, int nregs, FILE *regmove_dump_file)
|
||||
{
|
||||
int old_max_uid = get_max_uid ();
|
||||
rtx insn;
|
||||
@ -1543,9 +1514,7 @@ regmove_optimize (f, nregs, regmove_dump_file)
|
||||
Initialize the info in MATCHP based on the constraints. */
|
||||
|
||||
static int
|
||||
find_matches (insn, matchp)
|
||||
rtx insn;
|
||||
struct match *matchp;
|
||||
find_matches (rtx insn, struct match *matchp)
|
||||
{
|
||||
int likely_spilled[MAX_RECOG_OPERANDS];
|
||||
int op_no;
|
||||
@ -1633,11 +1602,7 @@ find_matches (insn, matchp)
|
||||
assumed to be in INSN. */
|
||||
|
||||
static void
|
||||
replace_in_call_usage (loc, dst_reg, src, insn)
|
||||
rtx *loc;
|
||||
unsigned int dst_reg;
|
||||
rtx src;
|
||||
rtx insn;
|
||||
replace_in_call_usage (rtx *loc, unsigned int dst_reg, rtx src, rtx insn)
|
||||
{
|
||||
rtx x = *loc;
|
||||
enum rtx_code code;
|
||||
@ -1676,11 +1641,9 @@ replace_in_call_usage (loc, dst_reg, src, insn)
|
||||
Return nonzero for success. */
|
||||
|
||||
static int
|
||||
fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
|
||||
match_number, regmove_dump_file)
|
||||
rtx insn, set, src, src_subreg, dst;
|
||||
int backward, operand_number, match_number;
|
||||
FILE *regmove_dump_file;
|
||||
fixup_match_1 (rtx insn, rtx set, rtx src, rtx src_subreg, rtx dst,
|
||||
int backward, int operand_number, int match_number,
|
||||
FILE *regmove_dump_file)
|
||||
{
|
||||
rtx p;
|
||||
rtx post_inc = 0, post_inc_set = 0, search_end = 0;
|
||||
@ -2079,8 +2042,7 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
|
||||
leave the burden to update REG_DEAD / REG_UNUSED notes, so we don't
|
||||
want any registers but SRC and DST. */
|
||||
static int
|
||||
stable_and_no_regs_but_for_p (x, src, dst)
|
||||
rtx x, src, dst;
|
||||
stable_and_no_regs_but_for_p (rtx x, rtx src, rtx dst)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
switch (GET_RTX_CLASS (code))
|
||||
@ -2140,21 +2102,21 @@ struct csa_memlist
|
||||
struct csa_memlist *next;
|
||||
};
|
||||
|
||||
static int stack_memref_p PARAMS ((rtx));
|
||||
static rtx single_set_for_csa PARAMS ((rtx));
|
||||
static void free_csa_memlist PARAMS ((struct csa_memlist *));
|
||||
static struct csa_memlist *record_one_stack_memref
|
||||
PARAMS ((rtx, rtx *, struct csa_memlist *));
|
||||
static int try_apply_stack_adjustment
|
||||
PARAMS ((rtx, struct csa_memlist *, HOST_WIDE_INT, HOST_WIDE_INT));
|
||||
static void combine_stack_adjustments_for_block PARAMS ((basic_block));
|
||||
static int record_stack_memrefs PARAMS ((rtx *, void *));
|
||||
static int stack_memref_p (rtx);
|
||||
static rtx single_set_for_csa (rtx);
|
||||
static void free_csa_memlist (struct csa_memlist *);
|
||||
static struct csa_memlist *record_one_stack_memref (rtx, rtx *,
|
||||
struct csa_memlist *);
|
||||
static int try_apply_stack_adjustment (rtx, struct csa_memlist *,
|
||||
HOST_WIDE_INT, HOST_WIDE_INT);
|
||||
static void combine_stack_adjustments_for_block (basic_block);
|
||||
static int record_stack_memrefs (rtx *, void *);
|
||||
|
||||
|
||||
/* Main entry point for stack adjustment combination. */
|
||||
|
||||
void
|
||||
combine_stack_adjustments ()
|
||||
combine_stack_adjustments (void)
|
||||
{
|
||||
basic_block bb;
|
||||
|
||||
@ -2165,8 +2127,7 @@ combine_stack_adjustments ()
|
||||
/* Recognize a MEM of the form (sp) or (plus sp const). */
|
||||
|
||||
static int
|
||||
stack_memref_p (x)
|
||||
rtx x;
|
||||
stack_memref_p (rtx x)
|
||||
{
|
||||
if (GET_CODE (x) != MEM)
|
||||
return 0;
|
||||
@ -2186,8 +2147,7 @@ stack_memref_p (x)
|
||||
tying fp and sp adjustments. */
|
||||
|
||||
static rtx
|
||||
single_set_for_csa (insn)
|
||||
rtx insn;
|
||||
single_set_for_csa (rtx insn)
|
||||
{
|
||||
int i;
|
||||
rtx tmp = single_set (insn);
|
||||
@ -2221,8 +2181,7 @@ single_set_for_csa (insn)
|
||||
/* Free the list of csa_memlist nodes. */
|
||||
|
||||
static void
|
||||
free_csa_memlist (memlist)
|
||||
struct csa_memlist *memlist;
|
||||
free_csa_memlist (struct csa_memlist *memlist)
|
||||
{
|
||||
struct csa_memlist *next;
|
||||
for (; memlist ; memlist = next)
|
||||
@ -2236,9 +2195,7 @@ free_csa_memlist (memlist)
|
||||
It is already known that the memory is stack_memref_p. */
|
||||
|
||||
static struct csa_memlist *
|
||||
record_one_stack_memref (insn, mem, next_memlist)
|
||||
rtx insn, *mem;
|
||||
struct csa_memlist *next_memlist;
|
||||
record_one_stack_memref (rtx insn, rtx *mem, struct csa_memlist *next_memlist)
|
||||
{
|
||||
struct csa_memlist *ml;
|
||||
|
||||
@ -2260,10 +2217,8 @@ record_one_stack_memref (insn, mem, next_memlist)
|
||||
as each of the memories in MEMLIST. Return true on success. */
|
||||
|
||||
static int
|
||||
try_apply_stack_adjustment (insn, memlist, new_adjust, delta)
|
||||
rtx insn;
|
||||
struct csa_memlist *memlist;
|
||||
HOST_WIDE_INT new_adjust, delta;
|
||||
try_apply_stack_adjustment (rtx insn, struct csa_memlist *memlist, HOST_WIDE_INT new_adjust,
|
||||
HOST_WIDE_INT delta)
|
||||
{
|
||||
struct csa_memlist *ml;
|
||||
rtx set;
|
||||
@ -2299,9 +2254,7 @@ struct record_stack_memrefs_data
|
||||
};
|
||||
|
||||
static int
|
||||
record_stack_memrefs (xp, data)
|
||||
rtx *xp;
|
||||
void *data;
|
||||
record_stack_memrefs (rtx *xp, void *data)
|
||||
{
|
||||
rtx x = *xp;
|
||||
struct record_stack_memrefs_data *d =
|
||||
@ -2343,8 +2296,7 @@ record_stack_memrefs (xp, data)
|
||||
/* Subroutine of combine_stack_adjustments, called for each basic block. */
|
||||
|
||||
static void
|
||||
combine_stack_adjustments_for_block (bb)
|
||||
basic_block bb;
|
||||
combine_stack_adjustments_for_block (basic_block bb)
|
||||
{
|
||||
HOST_WIDE_INT last_sp_adjust = 0;
|
||||
rtx last_sp_set = NULL_RTX;
|
||||
|
215
gcc/regrename.c
215
gcc/regrename.c
@ -1,5 +1,5 @@
|
||||
/* Register renaming for the GNU compiler.
|
||||
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -78,28 +78,25 @@ static const char * const scan_actions_name[] =
|
||||
|
||||
static struct obstack rename_obstack;
|
||||
|
||||
static void do_replace PARAMS ((struct du_chain *, int));
|
||||
static void scan_rtx_reg PARAMS ((rtx, rtx *, enum reg_class,
|
||||
enum scan_actions, enum op_type, int));
|
||||
static void scan_rtx_address PARAMS ((rtx, rtx *, enum reg_class,
|
||||
enum scan_actions, enum machine_mode));
|
||||
static void scan_rtx PARAMS ((rtx, rtx *, enum reg_class,
|
||||
enum scan_actions, enum op_type, int));
|
||||
static struct du_chain *build_def_use PARAMS ((basic_block));
|
||||
static void dump_def_use_chain PARAMS ((struct du_chain *));
|
||||
static void note_sets PARAMS ((rtx, rtx, void *));
|
||||
static void clear_dead_regs PARAMS ((HARD_REG_SET *, enum machine_mode, rtx));
|
||||
static void merge_overlapping_regs PARAMS ((basic_block, HARD_REG_SET *,
|
||||
struct du_chain *));
|
||||
static void do_replace (struct du_chain *, int);
|
||||
static void scan_rtx_reg (rtx, rtx *, enum reg_class,
|
||||
enum scan_actions, enum op_type, int);
|
||||
static void scan_rtx_address (rtx, rtx *, enum reg_class,
|
||||
enum scan_actions, enum machine_mode);
|
||||
static void scan_rtx (rtx, rtx *, enum reg_class, enum scan_actions,
|
||||
enum op_type, int);
|
||||
static struct du_chain *build_def_use (basic_block);
|
||||
static void dump_def_use_chain (struct du_chain *);
|
||||
static void note_sets (rtx, rtx, void *);
|
||||
static void clear_dead_regs (HARD_REG_SET *, enum machine_mode, rtx);
|
||||
static void merge_overlapping_regs (basic_block, HARD_REG_SET *,
|
||||
struct du_chain *);
|
||||
|
||||
/* Called through note_stores from update_life. Find sets of registers, and
|
||||
record them in *DATA (which is actually a HARD_REG_SET *). */
|
||||
|
||||
static void
|
||||
note_sets (x, set, data)
|
||||
rtx x;
|
||||
rtx set ATTRIBUTE_UNUSED;
|
||||
void *data;
|
||||
note_sets (rtx x, rtx set ATTRIBUTE_UNUSED, void *data)
|
||||
{
|
||||
HARD_REG_SET *pset = (HARD_REG_SET *) data;
|
||||
unsigned int regno;
|
||||
@ -121,10 +118,7 @@ note_sets (x, set, data)
|
||||
in the list NOTES. */
|
||||
|
||||
static void
|
||||
clear_dead_regs (pset, kind, notes)
|
||||
HARD_REG_SET *pset;
|
||||
enum machine_mode kind;
|
||||
rtx notes;
|
||||
clear_dead_regs (HARD_REG_SET *pset, enum machine_mode kind, rtx notes)
|
||||
{
|
||||
rtx note;
|
||||
for (note = notes; note; note = XEXP (note, 1))
|
||||
@ -147,10 +141,8 @@ clear_dead_regs (pset, kind, notes)
|
||||
its lifetime and set the corresponding bits in *PSET. */
|
||||
|
||||
static void
|
||||
merge_overlapping_regs (b, pset, chain)
|
||||
basic_block b;
|
||||
HARD_REG_SET *pset;
|
||||
struct du_chain *chain;
|
||||
merge_overlapping_regs (basic_block b, HARD_REG_SET *pset,
|
||||
struct du_chain *chain)
|
||||
{
|
||||
struct du_chain *t = chain;
|
||||
rtx insn;
|
||||
@ -192,7 +184,7 @@ merge_overlapping_regs (b, pset, chain)
|
||||
/* Perform register renaming on the current function. */
|
||||
|
||||
void
|
||||
regrename_optimize ()
|
||||
regrename_optimize (void)
|
||||
{
|
||||
int tick[FIRST_PSEUDO_REGISTER];
|
||||
int this_tick = 0;
|
||||
@ -370,9 +362,7 @@ regrename_optimize ()
|
||||
}
|
||||
|
||||
static void
|
||||
do_replace (chain, reg)
|
||||
struct du_chain *chain;
|
||||
int reg;
|
||||
do_replace (struct du_chain *chain, int reg)
|
||||
{
|
||||
while (chain)
|
||||
{
|
||||
@ -392,13 +382,8 @@ static struct du_chain *open_chains;
|
||||
static struct du_chain *closed_chains;
|
||||
|
||||
static void
|
||||
scan_rtx_reg (insn, loc, class, action, type, earlyclobber)
|
||||
rtx insn;
|
||||
rtx *loc;
|
||||
enum reg_class class;
|
||||
enum scan_actions action;
|
||||
enum op_type type;
|
||||
int earlyclobber;
|
||||
scan_rtx_reg (rtx insn, rtx *loc, enum reg_class class,
|
||||
enum scan_actions action, enum op_type type, int earlyclobber)
|
||||
{
|
||||
struct du_chain **p;
|
||||
rtx x = *loc;
|
||||
@ -519,12 +504,8 @@ scan_rtx_reg (insn, loc, class, action, type, earlyclobber)
|
||||
BASE_REG_CLASS depending on how the register is being considered. */
|
||||
|
||||
static void
|
||||
scan_rtx_address (insn, loc, class, action, mode)
|
||||
rtx insn;
|
||||
rtx *loc;
|
||||
enum reg_class class;
|
||||
enum scan_actions action;
|
||||
enum machine_mode mode;
|
||||
scan_rtx_address (rtx insn, rtx *loc, enum reg_class class,
|
||||
enum scan_actions action, enum machine_mode mode)
|
||||
{
|
||||
rtx x = *loc;
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
@ -656,13 +637,8 @@ scan_rtx_address (insn, loc, class, action, mode)
|
||||
}
|
||||
|
||||
static void
|
||||
scan_rtx (insn, loc, class, action, type, earlyclobber)
|
||||
rtx insn;
|
||||
rtx *loc;
|
||||
enum reg_class class;
|
||||
enum scan_actions action;
|
||||
enum op_type type;
|
||||
int earlyclobber;
|
||||
scan_rtx (rtx insn, rtx *loc, enum reg_class class,
|
||||
enum scan_actions action, enum op_type type, int earlyclobber)
|
||||
{
|
||||
const char *fmt;
|
||||
rtx x = *loc;
|
||||
@ -746,8 +722,7 @@ scan_rtx (insn, loc, class, action, type, earlyclobber)
|
||||
/* Build def/use chain. */
|
||||
|
||||
static struct du_chain *
|
||||
build_def_use (bb)
|
||||
basic_block bb;
|
||||
build_def_use (basic_block bb)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -991,8 +966,7 @@ build_def_use (bb)
|
||||
printed in reverse order as that's how we build them. */
|
||||
|
||||
static void
|
||||
dump_def_use_chain (chains)
|
||||
struct du_chain *chains;
|
||||
dump_def_use_chain (struct du_chain *chains)
|
||||
{
|
||||
while (chains)
|
||||
{
|
||||
@ -1036,42 +1010,36 @@ struct value_data
|
||||
unsigned int max_value_regs;
|
||||
};
|
||||
|
||||
static void kill_value_regno PARAMS ((unsigned, struct value_data *));
|
||||
static void kill_value PARAMS ((rtx, struct value_data *));
|
||||
static void set_value_regno PARAMS ((unsigned, enum machine_mode,
|
||||
struct value_data *));
|
||||
static void init_value_data PARAMS ((struct value_data *));
|
||||
static void kill_clobbered_value PARAMS ((rtx, rtx, void *));
|
||||
static void kill_set_value PARAMS ((rtx, rtx, void *));
|
||||
static int kill_autoinc_value PARAMS ((rtx *, void *));
|
||||
static void copy_value PARAMS ((rtx, rtx, struct value_data *));
|
||||
static bool mode_change_ok PARAMS ((enum machine_mode, enum machine_mode,
|
||||
unsigned int));
|
||||
static rtx maybe_mode_change PARAMS ((enum machine_mode, enum machine_mode,
|
||||
enum machine_mode, unsigned int,
|
||||
unsigned int));
|
||||
static rtx find_oldest_value_reg PARAMS ((enum reg_class, rtx,
|
||||
struct value_data *));
|
||||
static bool replace_oldest_value_reg PARAMS ((rtx *, enum reg_class, rtx,
|
||||
struct value_data *));
|
||||
static bool replace_oldest_value_addr PARAMS ((rtx *, enum reg_class,
|
||||
enum machine_mode, rtx,
|
||||
struct value_data *));
|
||||
static bool replace_oldest_value_mem PARAMS ((rtx, rtx, struct value_data *));
|
||||
static bool copyprop_hardreg_forward_1 PARAMS ((basic_block,
|
||||
struct value_data *));
|
||||
extern void debug_value_data PARAMS ((struct value_data *));
|
||||
static void kill_value_regno (unsigned, struct value_data *);
|
||||
static void kill_value (rtx, struct value_data *);
|
||||
static void set_value_regno (unsigned, enum machine_mode, struct value_data *);
|
||||
static void init_value_data (struct value_data *);
|
||||
static void kill_clobbered_value (rtx, rtx, void *);
|
||||
static void kill_set_value (rtx, rtx, void *);
|
||||
static int kill_autoinc_value (rtx *, void *);
|
||||
static void copy_value (rtx, rtx, struct value_data *);
|
||||
static bool mode_change_ok (enum machine_mode, enum machine_mode,
|
||||
unsigned int);
|
||||
static rtx maybe_mode_change (enum machine_mode, enum machine_mode,
|
||||
enum machine_mode, unsigned int, unsigned int);
|
||||
static rtx find_oldest_value_reg (enum reg_class, rtx, struct value_data *);
|
||||
static bool replace_oldest_value_reg (rtx *, enum reg_class, rtx,
|
||||
struct value_data *);
|
||||
static bool replace_oldest_value_addr (rtx *, enum reg_class,
|
||||
enum machine_mode, rtx,
|
||||
struct value_data *);
|
||||
static bool replace_oldest_value_mem (rtx, rtx, struct value_data *);
|
||||
static bool copyprop_hardreg_forward_1 (basic_block, struct value_data *);
|
||||
extern void debug_value_data (struct value_data *);
|
||||
#ifdef ENABLE_CHECKING
|
||||
static void validate_value_data PARAMS ((struct value_data *));
|
||||
static void validate_value_data (struct value_data *);
|
||||
#endif
|
||||
|
||||
/* Kill register REGNO. This involves removing it from any value lists,
|
||||
and resetting the value mode to VOIDmode. */
|
||||
|
||||
static void
|
||||
kill_value_regno (regno, vd)
|
||||
unsigned int regno;
|
||||
struct value_data *vd;
|
||||
kill_value_regno (unsigned int regno, struct value_data *vd)
|
||||
{
|
||||
unsigned int i, next;
|
||||
|
||||
@ -1102,9 +1070,7 @@ kill_value_regno (regno, vd)
|
||||
so that we mind the mode the register is in. */
|
||||
|
||||
static void
|
||||
kill_value (x, vd)
|
||||
rtx x;
|
||||
struct value_data *vd;
|
||||
kill_value (rtx x, struct value_data *vd)
|
||||
{
|
||||
/* SUBREGS are supposed to have been eliminated by now. But some
|
||||
ports, e.g. i386 sse, use them to smuggle vector type information
|
||||
@ -1144,10 +1110,8 @@ kill_value (x, vd)
|
||||
/* Remember that REGNO is valid in MODE. */
|
||||
|
||||
static void
|
||||
set_value_regno (regno, mode, vd)
|
||||
unsigned int regno;
|
||||
enum machine_mode mode;
|
||||
struct value_data *vd;
|
||||
set_value_regno (unsigned int regno, enum machine_mode mode,
|
||||
struct value_data *vd)
|
||||
{
|
||||
unsigned int nregs;
|
||||
|
||||
@ -1161,8 +1125,7 @@ set_value_regno (regno, mode, vd)
|
||||
/* Initialize VD such that there are no known relationships between regs. */
|
||||
|
||||
static void
|
||||
init_value_data (vd)
|
||||
struct value_data *vd;
|
||||
init_value_data (struct value_data *vd)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
|
||||
@ -1177,10 +1140,7 @@ init_value_data (vd)
|
||||
/* Called through note_stores. If X is clobbered, kill its value. */
|
||||
|
||||
static void
|
||||
kill_clobbered_value (x, set, data)
|
||||
rtx x;
|
||||
rtx set;
|
||||
void *data;
|
||||
kill_clobbered_value (rtx x, rtx set, void *data)
|
||||
{
|
||||
struct value_data *vd = data;
|
||||
if (GET_CODE (set) == CLOBBER)
|
||||
@ -1191,10 +1151,7 @@ kill_clobbered_value (x, set, data)
|
||||
current value and install it as the root of its own value list. */
|
||||
|
||||
static void
|
||||
kill_set_value (x, set, data)
|
||||
rtx x;
|
||||
rtx set;
|
||||
void *data;
|
||||
kill_set_value (rtx x, rtx set, void *data)
|
||||
{
|
||||
struct value_data *vd = data;
|
||||
if (GET_CODE (set) != CLOBBER)
|
||||
@ -1210,9 +1167,7 @@ kill_set_value (x, set, data)
|
||||
own value list. */
|
||||
|
||||
static int
|
||||
kill_autoinc_value (px, data)
|
||||
rtx *px;
|
||||
void *data;
|
||||
kill_autoinc_value (rtx *px, void *data)
|
||||
{
|
||||
rtx x = *px;
|
||||
struct value_data *vd = data;
|
||||
@ -1232,10 +1187,7 @@ kill_autoinc_value (px, data)
|
||||
to reflect that SRC contains an older copy of the shared value. */
|
||||
|
||||
static void
|
||||
copy_value (dest, src, vd)
|
||||
rtx dest;
|
||||
rtx src;
|
||||
struct value_data *vd;
|
||||
copy_value (rtx dest, rtx src, struct value_data *vd)
|
||||
{
|
||||
unsigned int dr = REGNO (dest);
|
||||
unsigned int sr = REGNO (src);
|
||||
@ -1311,9 +1263,8 @@ copy_value (dest, src, vd)
|
||||
/* Return true if a mode change from ORIG to NEW is allowed for REGNO. */
|
||||
|
||||
static bool
|
||||
mode_change_ok (orig_mode, new_mode, regno)
|
||||
enum machine_mode orig_mode, new_mode;
|
||||
unsigned int regno ATTRIBUTE_UNUSED;
|
||||
mode_change_ok (enum machine_mode orig_mode, enum machine_mode new_mode,
|
||||
unsigned int regno ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (GET_MODE_SIZE (orig_mode) < GET_MODE_SIZE (new_mode))
|
||||
return false;
|
||||
@ -1331,9 +1282,9 @@ mode_change_ok (orig_mode, new_mode, regno)
|
||||
Return a NEW_MODE rtx for REGNO if that's OK, otherwise return NULL_RTX. */
|
||||
|
||||
static rtx
|
||||
maybe_mode_change (orig_mode, copy_mode, new_mode, regno, copy_regno)
|
||||
enum machine_mode orig_mode, copy_mode, new_mode;
|
||||
unsigned int regno, copy_regno ATTRIBUTE_UNUSED;
|
||||
maybe_mode_change (enum machine_mode orig_mode, enum machine_mode copy_mode,
|
||||
enum machine_mode new_mode, unsigned int regno,
|
||||
unsigned int copy_regno ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (orig_mode == new_mode)
|
||||
return gen_rtx_raw_REG (new_mode, regno);
|
||||
@ -1363,10 +1314,7 @@ maybe_mode_change (orig_mode, copy_mode, new_mode, regno, copy_regno)
|
||||
of that oldest register, otherwise return NULL. */
|
||||
|
||||
static rtx
|
||||
find_oldest_value_reg (class, reg, vd)
|
||||
enum reg_class class;
|
||||
rtx reg;
|
||||
struct value_data *vd;
|
||||
find_oldest_value_reg (enum reg_class class, rtx reg, struct value_data *vd)
|
||||
{
|
||||
unsigned int regno = REGNO (reg);
|
||||
enum machine_mode mode = GET_MODE (reg);
|
||||
@ -1408,11 +1356,8 @@ find_oldest_value_reg (class, reg, vd)
|
||||
in register class CLASS. Return true if successfully replaced. */
|
||||
|
||||
static bool
|
||||
replace_oldest_value_reg (loc, class, insn, vd)
|
||||
rtx *loc;
|
||||
enum reg_class class;
|
||||
rtx insn;
|
||||
struct value_data *vd;
|
||||
replace_oldest_value_reg (rtx *loc, enum reg_class class, rtx insn,
|
||||
struct value_data *vd)
|
||||
{
|
||||
rtx new = find_oldest_value_reg (class, *loc, vd);
|
||||
if (new)
|
||||
@ -1432,12 +1377,9 @@ replace_oldest_value_reg (loc, class, insn, vd)
|
||||
BASE_REG_CLASS depending on how the register is being considered. */
|
||||
|
||||
static bool
|
||||
replace_oldest_value_addr (loc, class, mode, insn, vd)
|
||||
rtx *loc;
|
||||
enum reg_class class;
|
||||
enum machine_mode mode;
|
||||
rtx insn;
|
||||
struct value_data *vd;
|
||||
replace_oldest_value_addr (rtx *loc, enum reg_class class,
|
||||
enum machine_mode mode, rtx insn,
|
||||
struct value_data *vd)
|
||||
{
|
||||
rtx x = *loc;
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
@ -1567,10 +1509,7 @@ replace_oldest_value_addr (loc, class, mode, insn, vd)
|
||||
/* Similar to replace_oldest_value_reg, but X contains a memory. */
|
||||
|
||||
static bool
|
||||
replace_oldest_value_mem (x, insn, vd)
|
||||
rtx x;
|
||||
rtx insn;
|
||||
struct value_data *vd;
|
||||
replace_oldest_value_mem (rtx x, rtx insn, struct value_data *vd)
|
||||
{
|
||||
return replace_oldest_value_addr (&XEXP (x, 0),
|
||||
MODE_BASE_REG_CLASS (GET_MODE (x)),
|
||||
@ -1580,9 +1519,7 @@ replace_oldest_value_mem (x, insn, vd)
|
||||
/* Perform the forward copy propagation on basic block BB. */
|
||||
|
||||
static bool
|
||||
copyprop_hardreg_forward_1 (bb, vd)
|
||||
basic_block bb;
|
||||
struct value_data *vd;
|
||||
copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
|
||||
{
|
||||
bool changed = false;
|
||||
rtx insn;
|
||||
@ -1781,7 +1718,7 @@ copyprop_hardreg_forward_1 (bb, vd)
|
||||
/* Main entry point for the forward copy propagation optimization. */
|
||||
|
||||
void
|
||||
copyprop_hardreg_forward ()
|
||||
copyprop_hardreg_forward (void)
|
||||
{
|
||||
struct value_data *all_vd;
|
||||
bool need_refresh;
|
||||
@ -1833,8 +1770,7 @@ copyprop_hardreg_forward ()
|
||||
/* Dump the value chain data to stderr. */
|
||||
|
||||
void
|
||||
debug_value_data (vd)
|
||||
struct value_data *vd;
|
||||
debug_value_data (struct value_data *vd)
|
||||
{
|
||||
HARD_REG_SET set;
|
||||
unsigned int i, j;
|
||||
@ -1889,8 +1825,7 @@ debug_value_data (vd)
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
static void
|
||||
validate_value_data (vd)
|
||||
struct value_data *vd;
|
||||
validate_value_data (struct value_data *vd)
|
||||
{
|
||||
HARD_REG_SET set;
|
||||
unsigned int i, j;
|
||||
|
@ -60,7 +60,7 @@ typedef struct reg_info_def
|
||||
int live_length; /* # of instructions (REG n) is live */
|
||||
int calls_crossed; /* # of calls (REG n) is live across */
|
||||
int basic_block; /* # of basic blocks (REG n) is used in */
|
||||
char changes_mode; /* whether (SUBREG (REG n)) exists and
|
||||
char changes_mode; /* whether (SUBREG (REG n)) exists and
|
||||
is illegal. */
|
||||
} reg_info;
|
||||
|
||||
@ -76,7 +76,7 @@ extern bitmap_head subregs_of_mode;
|
||||
|
||||
#define REG_FREQ(N) (VARRAY_REG (reg_n_info, N)->freq)
|
||||
|
||||
/* The weights for each insn varries from 0 to REG_FREQ_BASE.
|
||||
/* The weights for each insn varries from 0 to REG_FREQ_BASE.
|
||||
This constant does not need to be high, as in infrequently executed
|
||||
regions we want to count instructions equivalently to optimize for
|
||||
size instead of speed. */
|
||||
@ -213,11 +213,11 @@ extern int caller_save_needed;
|
||||
choose_hard_reg_mode (REGNO, NREGS)
|
||||
#endif
|
||||
|
||||
/* Registers that get partially clobbered by a call in a given mode.
|
||||
/* Registers that get partially clobbered by a call in a given mode.
|
||||
These must not be call used registers. */
|
||||
#ifndef HARD_REGNO_CALL_PART_CLOBBERED
|
||||
#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) 0
|
||||
#endif
|
||||
|
||||
/* Allocate reg_n_info tables */
|
||||
extern void allocate_reg_info PARAMS ((size_t, int, int));
|
||||
extern void allocate_reg_info (size_t, int, int);
|
||||
|
347
gcc/reload.c
347
gcc/reload.c
@ -234,43 +234,41 @@ static int output_reloadnum;
|
||||
: (type)))
|
||||
|
||||
#ifdef HAVE_SECONDARY_RELOADS
|
||||
static int push_secondary_reload PARAMS ((int, rtx, int, int, enum reg_class,
|
||||
enum machine_mode, enum reload_type,
|
||||
enum insn_code *));
|
||||
static int push_secondary_reload (int, rtx, int, int, enum reg_class,
|
||||
enum machine_mode, enum reload_type,
|
||||
enum insn_code *);
|
||||
#endif
|
||||
static enum reg_class find_valid_class PARAMS ((enum machine_mode, int,
|
||||
unsigned int));
|
||||
static int reload_inner_reg_of_subreg PARAMS ((rtx, enum machine_mode, int));
|
||||
static void push_replacement PARAMS ((rtx *, int, enum machine_mode));
|
||||
static void dup_replacements PARAMS ((rtx *, rtx *));
|
||||
static void combine_reloads PARAMS ((void));
|
||||
static int find_reusable_reload PARAMS ((rtx *, rtx, enum reg_class,
|
||||
enum reload_type, int, int));
|
||||
static rtx find_dummy_reload PARAMS ((rtx, rtx, rtx *, rtx *,
|
||||
enum machine_mode, enum machine_mode,
|
||||
enum reg_class, int, int));
|
||||
static int hard_reg_set_here_p PARAMS ((unsigned int, unsigned int, rtx));
|
||||
static struct decomposition decompose PARAMS ((rtx));
|
||||
static int immune_p PARAMS ((rtx, rtx, struct decomposition));
|
||||
static int alternative_allows_memconst PARAMS ((const char *, int));
|
||||
static rtx find_reloads_toplev PARAMS ((rtx, int, enum reload_type, int,
|
||||
int, rtx, int *));
|
||||
static rtx make_memloc PARAMS ((rtx, int));
|
||||
static int maybe_memory_address_p PARAMS ((enum machine_mode, rtx, rtx *));
|
||||
static int find_reloads_address PARAMS ((enum machine_mode, rtx *, rtx, rtx *,
|
||||
int, enum reload_type, int, rtx));
|
||||
static rtx subst_reg_equivs PARAMS ((rtx, rtx));
|
||||
static rtx subst_indexed_address PARAMS ((rtx));
|
||||
static void update_auto_inc_notes PARAMS ((rtx, int, int));
|
||||
static int find_reloads_address_1 PARAMS ((enum machine_mode, rtx, int, rtx *,
|
||||
int, enum reload_type,int, rtx));
|
||||
static void find_reloads_address_part PARAMS ((rtx, rtx *, enum reg_class,
|
||||
enum machine_mode, int,
|
||||
enum reload_type, int));
|
||||
static rtx find_reloads_subreg_address PARAMS ((rtx, int, int,
|
||||
enum reload_type, int, rtx));
|
||||
static void copy_replacements_1 PARAMS ((rtx *, rtx *, int));
|
||||
static int find_inc_amount PARAMS ((rtx, rtx));
|
||||
static enum reg_class find_valid_class (enum machine_mode, int, unsigned int);
|
||||
static int reload_inner_reg_of_subreg (rtx, enum machine_mode, int);
|
||||
static void push_replacement (rtx *, int, enum machine_mode);
|
||||
static void dup_replacements (rtx *, rtx *);
|
||||
static void combine_reloads (void);
|
||||
static int find_reusable_reload (rtx *, rtx, enum reg_class,
|
||||
enum reload_type, int, int);
|
||||
static rtx find_dummy_reload (rtx, rtx, rtx *, rtx *, enum machine_mode,
|
||||
enum machine_mode, enum reg_class, int, int);
|
||||
static int hard_reg_set_here_p (unsigned int, unsigned int, rtx);
|
||||
static struct decomposition decompose (rtx);
|
||||
static int immune_p (rtx, rtx, struct decomposition);
|
||||
static int alternative_allows_memconst (const char *, int);
|
||||
static rtx find_reloads_toplev (rtx, int, enum reload_type, int, int, rtx,
|
||||
int *);
|
||||
static rtx make_memloc (rtx, int);
|
||||
static int maybe_memory_address_p (enum machine_mode, rtx, rtx *);
|
||||
static int find_reloads_address (enum machine_mode, rtx *, rtx, rtx *,
|
||||
int, enum reload_type, int, rtx);
|
||||
static rtx subst_reg_equivs (rtx, rtx);
|
||||
static rtx subst_indexed_address (rtx);
|
||||
static void update_auto_inc_notes (rtx, int, int);
|
||||
static int find_reloads_address_1 (enum machine_mode, rtx, int, rtx *,
|
||||
int, enum reload_type,int, rtx);
|
||||
static void find_reloads_address_part (rtx, rtx *, enum reg_class,
|
||||
enum machine_mode, int,
|
||||
enum reload_type, int);
|
||||
static rtx find_reloads_subreg_address (rtx, int, int, enum reload_type,
|
||||
int, rtx);
|
||||
static void copy_replacements_1 (rtx *, rtx *, int);
|
||||
static int find_inc_amount (rtx, rtx);
|
||||
|
||||
#ifdef HAVE_SECONDARY_RELOADS
|
||||
|
||||
@ -284,16 +282,10 @@ static int find_inc_amount PARAMS ((rtx, rtx));
|
||||
need a secondary reload. */
|
||||
|
||||
static int
|
||||
push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
|
||||
type, picode)
|
||||
int in_p;
|
||||
rtx x;
|
||||
int opnum;
|
||||
int optional;
|
||||
enum reg_class reload_class;
|
||||
enum machine_mode reload_mode;
|
||||
enum reload_type type;
|
||||
enum insn_code *picode;
|
||||
push_secondary_reload (int in_p, rtx x, int opnum, int optional,
|
||||
enum reg_class reload_class,
|
||||
enum machine_mode reload_mode, enum reload_type type,
|
||||
enum insn_code *picode)
|
||||
{
|
||||
enum reg_class class = NO_REGS;
|
||||
enum machine_mode mode = reload_mode;
|
||||
@ -588,11 +580,8 @@ push_secondary_reload (in_p, x, opnum, optional, reload_class, reload_mode,
|
||||
call find_reloads_address on the location being returned. */
|
||||
|
||||
rtx
|
||||
get_secondary_mem (x, mode, opnum, type)
|
||||
rtx x ATTRIBUTE_UNUSED;
|
||||
enum machine_mode mode;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
get_secondary_mem (rtx x ATTRIBUTE_UNUSED, enum machine_mode mode,
|
||||
int opnum, enum reload_type type)
|
||||
{
|
||||
rtx loc;
|
||||
int mem_valid;
|
||||
@ -660,7 +649,7 @@ get_secondary_mem (x, mode, opnum, type)
|
||||
/* Clear any secondary memory locations we've made. */
|
||||
|
||||
void
|
||||
clear_secondary_mem ()
|
||||
clear_secondary_mem (void)
|
||||
{
|
||||
memset ((char *) secondary_memlocs, 0, sizeof secondary_memlocs);
|
||||
}
|
||||
@ -671,10 +660,8 @@ clear_secondary_mem ()
|
||||
Abort if no such class exists. */
|
||||
|
||||
static enum reg_class
|
||||
find_valid_class (m1, n, dest_regno)
|
||||
enum machine_mode m1 ATTRIBUTE_UNUSED;
|
||||
int n;
|
||||
unsigned int dest_regno ATTRIBUTE_UNUSED;
|
||||
find_valid_class (enum machine_mode m1 ATTRIBUTE_UNUSED, int n,
|
||||
unsigned int dest_regno ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int best_cost = -1;
|
||||
int class;
|
||||
@ -722,11 +709,8 @@ find_valid_class (m1, n, dest_regno)
|
||||
DONT_SHARE is nonzero if we can't share any input-only reload for IN. */
|
||||
|
||||
static int
|
||||
find_reusable_reload (p_in, out, class, type, opnum, dont_share)
|
||||
rtx *p_in, out;
|
||||
enum reg_class class;
|
||||
enum reload_type type;
|
||||
int opnum, dont_share;
|
||||
find_reusable_reload (rtx *p_in, rtx out, enum reg_class class,
|
||||
enum reload_type type, int opnum, int dont_share)
|
||||
{
|
||||
rtx in = *p_in;
|
||||
int i;
|
||||
@ -799,10 +783,7 @@ find_reusable_reload (p_in, out, class, type, opnum, dont_share)
|
||||
SUBREG_REG expression. */
|
||||
|
||||
static int
|
||||
reload_inner_reg_of_subreg (x, mode, output)
|
||||
rtx x;
|
||||
enum machine_mode mode;
|
||||
int output;
|
||||
reload_inner_reg_of_subreg (rtx x, enum machine_mode mode, int output)
|
||||
{
|
||||
rtx inner;
|
||||
|
||||
@ -920,16 +901,10 @@ can_reload_into (rtx in, int regno, enum machine_mode mode)
|
||||
distinguish them. */
|
||||
|
||||
int
|
||||
push_reload (in, out, inloc, outloc, class,
|
||||
inmode, outmode, strict_low, optional, opnum, type)
|
||||
rtx in, out;
|
||||
rtx *inloc, *outloc;
|
||||
enum reg_class class;
|
||||
enum machine_mode inmode, outmode;
|
||||
int strict_low;
|
||||
int optional;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
|
||||
enum reg_class class, enum machine_mode inmode,
|
||||
enum machine_mode outmode, int strict_low, int optional,
|
||||
int opnum, enum reload_type type)
|
||||
{
|
||||
int i;
|
||||
int dont_share = 0;
|
||||
@ -1170,7 +1145,7 @@ push_reload (in, out, inloc, outloc, class,
|
||||
|| (GET_CODE (SUBREG_REG (out)) == REG
|
||||
&& REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER
|
||||
&& REG_CANNOT_CHANGE_MODE_P (REGNO (SUBREG_REG (out)),
|
||||
GET_MODE (SUBREG_REG (out)),
|
||||
GET_MODE (SUBREG_REG (out)),
|
||||
outmode))
|
||||
#endif
|
||||
))
|
||||
@ -1603,10 +1578,7 @@ push_reload (in, out, inloc, outloc, class,
|
||||
This is used in insn patterns that use match_dup. */
|
||||
|
||||
static void
|
||||
push_replacement (loc, reloadnum, mode)
|
||||
rtx *loc;
|
||||
int reloadnum;
|
||||
enum machine_mode mode;
|
||||
push_replacement (rtx *loc, int reloadnum, enum machine_mode mode)
|
||||
{
|
||||
if (replace_reloads)
|
||||
{
|
||||
@ -1623,9 +1595,7 @@ push_replacement (loc, reloadnum, mode)
|
||||
This is used in insn patterns that use match_dup. */
|
||||
|
||||
static void
|
||||
dup_replacements (dup_loc, orig_loc)
|
||||
rtx *dup_loc;
|
||||
rtx *orig_loc;
|
||||
dup_replacements (rtx *dup_loc, rtx *orig_loc)
|
||||
{
|
||||
int i, n = n_replacements;
|
||||
|
||||
@ -1641,8 +1611,7 @@ dup_replacements (dup_loc, orig_loc)
|
||||
reload TO. */
|
||||
|
||||
void
|
||||
transfer_replacements (to, from)
|
||||
int to, from;
|
||||
transfer_replacements (int to, int from)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1656,8 +1625,7 @@ transfer_replacements (to, from)
|
||||
cancel the reloads that were supposed to load them.
|
||||
Return nonzero if we canceled any reloads. */
|
||||
int
|
||||
remove_address_replacements (in_rtx)
|
||||
rtx in_rtx;
|
||||
remove_address_replacements (rtx in_rtx)
|
||||
{
|
||||
int i, j;
|
||||
char reload_flags[MAX_RELOADS];
|
||||
@ -1703,7 +1671,7 @@ remove_address_replacements (in_rtx)
|
||||
class and does not appear in the value being output-reloaded. */
|
||||
|
||||
static void
|
||||
combine_reloads ()
|
||||
combine_reloads (void)
|
||||
{
|
||||
int i;
|
||||
int output_reload = -1;
|
||||
@ -1900,14 +1868,9 @@ combine_reloads ()
|
||||
is safe from the earlyclobber). */
|
||||
|
||||
static rtx
|
||||
find_dummy_reload (real_in, real_out, inloc, outloc,
|
||||
inmode, outmode, class, for_real, earlyclobber)
|
||||
rtx real_in, real_out;
|
||||
rtx *inloc, *outloc;
|
||||
enum machine_mode inmode, outmode;
|
||||
enum reg_class class;
|
||||
int for_real;
|
||||
int earlyclobber;
|
||||
find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc,
|
||||
enum machine_mode inmode, enum machine_mode outmode,
|
||||
enum reg_class class, int for_real, int earlyclobber)
|
||||
{
|
||||
rtx in = real_in;
|
||||
rtx out = real_out;
|
||||
@ -2058,8 +2021,7 @@ find_dummy_reload (real_in, real_out, inloc, outloc,
|
||||
/* Return 1 if X is an operand of an insn that is being earlyclobbered. */
|
||||
|
||||
int
|
||||
earlyclobber_operand_p (x)
|
||||
rtx x;
|
||||
earlyclobber_operand_p (rtx x)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -2076,9 +2038,7 @@ earlyclobber_operand_p (x)
|
||||
X should be the body of an instruction. */
|
||||
|
||||
static int
|
||||
hard_reg_set_here_p (beg_regno, end_regno, x)
|
||||
unsigned int beg_regno, end_regno;
|
||||
rtx x;
|
||||
hard_reg_set_here_p (unsigned int beg_regno, unsigned int end_regno, rtx x)
|
||||
{
|
||||
if (GET_CODE (x) == SET || GET_CODE (x) == CLOBBER)
|
||||
{
|
||||
@ -2113,9 +2073,7 @@ hard_reg_set_here_p (beg_regno, end_regno, x)
|
||||
hard reg. */
|
||||
|
||||
int
|
||||
strict_memory_address_p (mode, addr)
|
||||
enum machine_mode mode ATTRIBUTE_UNUSED;
|
||||
rtx addr;
|
||||
strict_memory_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx addr)
|
||||
{
|
||||
GO_IF_LEGITIMATE_ADDRESS (mode, addr, win);
|
||||
return 0;
|
||||
@ -2140,8 +2098,7 @@ strict_memory_address_p (mode, addr)
|
||||
because that is natural in (SET output (... input ...)). */
|
||||
|
||||
int
|
||||
operands_match_p (x, y)
|
||||
rtx x, y;
|
||||
operands_match_p (rtx x, rtx y)
|
||||
{
|
||||
int i;
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
@ -2292,8 +2249,7 @@ operands_match_p (x, y)
|
||||
so we set the SAFE field. */
|
||||
|
||||
static struct decomposition
|
||||
decompose (x)
|
||||
rtx x;
|
||||
decompose (rtx x)
|
||||
{
|
||||
struct decomposition val;
|
||||
int all_const = 0;
|
||||
@ -2431,9 +2387,7 @@ decompose (x)
|
||||
Y is also described by YDATA, which should be decompose (Y). */
|
||||
|
||||
static int
|
||||
immune_p (x, y, ydata)
|
||||
rtx x, y;
|
||||
struct decomposition ydata;
|
||||
immune_p (rtx x, rtx y, struct decomposition ydata)
|
||||
{
|
||||
struct decomposition xdata;
|
||||
|
||||
@ -2476,8 +2430,7 @@ immune_p (x, y, ydata)
|
||||
/* Similar, but calls decompose. */
|
||||
|
||||
int
|
||||
safe_from_earlyclobber (op, clobber)
|
||||
rtx op, clobber;
|
||||
safe_from_earlyclobber (rtx op, rtx clobber)
|
||||
{
|
||||
struct decomposition early_data;
|
||||
|
||||
@ -2508,11 +2461,8 @@ safe_from_earlyclobber (op, clobber)
|
||||
commutative operands, reg_equiv_address substitution, or whatever. */
|
||||
|
||||
int
|
||||
find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
|
||||
rtx insn;
|
||||
int replace, ind_levels;
|
||||
int live_known;
|
||||
short *reload_reg_p;
|
||||
find_reloads (rtx insn, int replace, int ind_levels, int live_known,
|
||||
short *reload_reg_p)
|
||||
{
|
||||
int insn_code_number;
|
||||
int i, j;
|
||||
@ -4387,15 +4337,15 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
|
||||
for (i = 0; i < n_reloads; i++)
|
||||
if (rld[i].when_needed == RELOAD_FOR_INPUT
|
||||
&& GET_CODE (PATTERN (insn)) == SET
|
||||
&& GET_CODE (SET_DEST (PATTERN (insn))) == REG
|
||||
&& SET_SRC (PATTERN (insn)) == rld[i].in)
|
||||
&& GET_CODE (SET_DEST (PATTERN (insn))) == REG
|
||||
&& SET_SRC (PATTERN (insn)) == rld[i].in)
|
||||
{
|
||||
rtx dest = SET_DEST (PATTERN (insn));
|
||||
rtx dest = SET_DEST (PATTERN (insn));
|
||||
unsigned int regno = REGNO (dest);
|
||||
|
||||
if (regno < FIRST_PSEUDO_REGISTER
|
||||
&& TEST_HARD_REG_BIT (reg_class_contents[rld[i].class], regno)
|
||||
&& HARD_REGNO_MODE_OK (regno, rld[i].mode))
|
||||
if (regno < FIRST_PSEUDO_REGISTER
|
||||
&& TEST_HARD_REG_BIT (reg_class_contents[rld[i].class], regno)
|
||||
&& HARD_REGNO_MODE_OK (regno, rld[i].mode))
|
||||
{
|
||||
int nr = HARD_REGNO_NREGS (regno, rld[i].mode);
|
||||
int ok = 1, nri;
|
||||
@ -4416,9 +4366,7 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
|
||||
accepts a memory operand with constant address. */
|
||||
|
||||
static int
|
||||
alternative_allows_memconst (constraint, altnum)
|
||||
const char *constraint;
|
||||
int altnum;
|
||||
alternative_allows_memconst (const char *constraint, int altnum)
|
||||
{
|
||||
int c;
|
||||
/* Skip alternatives before the one requested. */
|
||||
@ -4459,15 +4407,9 @@ alternative_allows_memconst (constraint, altnum)
|
||||
result of find_reloads_address. */
|
||||
|
||||
static rtx
|
||||
find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest, insn,
|
||||
address_reloaded)
|
||||
rtx x;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
int ind_levels;
|
||||
int is_set_dest;
|
||||
rtx insn;
|
||||
int *address_reloaded;
|
||||
find_reloads_toplev (rtx x, int opnum, enum reload_type type,
|
||||
int ind_levels, int is_set_dest, rtx insn,
|
||||
int *address_reloaded)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
|
||||
@ -4611,9 +4553,7 @@ find_reloads_toplev (x, opnum, type, ind_levels, is_set_dest, insn,
|
||||
This mem ref is not shared with anything. */
|
||||
|
||||
static rtx
|
||||
make_memloc (ad, regno)
|
||||
rtx ad;
|
||||
int regno;
|
||||
make_memloc (rtx ad, int regno)
|
||||
{
|
||||
/* We must rerun eliminate_regs, in case the elimination
|
||||
offsets have changed. */
|
||||
@ -4636,14 +4576,11 @@ make_memloc (ad, regno)
|
||||
}
|
||||
|
||||
/* Returns true if AD could be turned into a valid memory reference
|
||||
to mode MODE by reloading the part pointed to by PART into a
|
||||
to mode MODE by reloading the part pointed to by PART into a
|
||||
register. */
|
||||
|
||||
static int
|
||||
maybe_memory_address_p (mode, ad, part)
|
||||
enum machine_mode mode;
|
||||
rtx ad;
|
||||
rtx *part;
|
||||
maybe_memory_address_p (enum machine_mode mode, rtx ad, rtx *part)
|
||||
{
|
||||
int retv;
|
||||
rtx tem = *part;
|
||||
@ -4681,15 +4618,9 @@ maybe_memory_address_p (mode, ad, part)
|
||||
to a hard register, and frame pointer elimination. */
|
||||
|
||||
static int
|
||||
find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
|
||||
enum machine_mode mode;
|
||||
rtx *memrefloc;
|
||||
rtx ad;
|
||||
rtx *loc;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
int ind_levels;
|
||||
rtx insn;
|
||||
find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
|
||||
rtx *loc, int opnum, enum reload_type type,
|
||||
int ind_levels, rtx insn)
|
||||
{
|
||||
int regno;
|
||||
int removed_and = 0;
|
||||
@ -5042,9 +4973,7 @@ find_reloads_address (mode, memrefloc, ad, loc, opnum, type, ind_levels, insn)
|
||||
front of it for pseudos that we have to replace with stack slots. */
|
||||
|
||||
static rtx
|
||||
subst_reg_equivs (ad, insn)
|
||||
rtx ad;
|
||||
rtx insn;
|
||||
subst_reg_equivs (rtx ad, rtx insn)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (ad);
|
||||
int i;
|
||||
@ -5115,8 +5044,7 @@ subst_reg_equivs (ad, insn)
|
||||
This routine assumes both inputs are already in canonical form. */
|
||||
|
||||
rtx
|
||||
form_sum (x, y)
|
||||
rtx x, y;
|
||||
form_sum (rtx x, rtx y)
|
||||
{
|
||||
rtx tem;
|
||||
enum machine_mode mode = GET_MODE (x);
|
||||
@ -5170,8 +5098,7 @@ form_sum (x, y)
|
||||
In all other cases, return ADDR. */
|
||||
|
||||
static rtx
|
||||
subst_indexed_address (addr)
|
||||
rtx addr;
|
||||
subst_indexed_address (rtx addr)
|
||||
{
|
||||
rtx op0 = 0, op1 = 0, op2 = 0;
|
||||
rtx tem;
|
||||
@ -5228,10 +5155,8 @@ subst_indexed_address (addr)
|
||||
RELOADNUM is the reload number. */
|
||||
|
||||
static void
|
||||
update_auto_inc_notes (insn, regno, reloadnum)
|
||||
rtx insn ATTRIBUTE_UNUSED;
|
||||
int regno ATTRIBUTE_UNUSED;
|
||||
int reloadnum ATTRIBUTE_UNUSED;
|
||||
update_auto_inc_notes (rtx insn ATTRIBUTE_UNUSED, int regno ATTRIBUTE_UNUSED,
|
||||
int reloadnum ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef AUTO_INC_DEC
|
||||
rtx link;
|
||||
@ -5268,15 +5193,9 @@ update_auto_inc_notes (insn, regno, reloadnum)
|
||||
could have addressing modes that this does not handle right. */
|
||||
|
||||
static int
|
||||
find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
|
||||
enum machine_mode mode;
|
||||
rtx x;
|
||||
int context;
|
||||
rtx *loc;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
int ind_levels;
|
||||
rtx insn;
|
||||
find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
|
||||
rtx *loc, int opnum, enum reload_type type,
|
||||
int ind_levels, rtx insn)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
|
||||
@ -5445,7 +5364,7 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
|
||||
|
||||
/* Handle a register that is equivalent to a memory location
|
||||
which cannot be addressed directly. */
|
||||
if (reg_equiv_memory_loc[regno] != 0
|
||||
if (reg_equiv_memory_loc[regno] != 0
|
||||
&& (reg_equiv_address[regno] != 0
|
||||
|| num_not_at_initial_offset))
|
||||
{
|
||||
@ -5809,14 +5728,9 @@ find_reloads_address_1 (mode, x, context, loc, opnum, type, ind_levels, insn)
|
||||
supports. */
|
||||
|
||||
static void
|
||||
find_reloads_address_part (x, loc, class, mode, opnum, type, ind_levels)
|
||||
rtx x;
|
||||
rtx *loc;
|
||||
enum reg_class class;
|
||||
enum machine_mode mode;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
int ind_levels;
|
||||
find_reloads_address_part (rtx x, rtx *loc, enum reg_class class,
|
||||
enum machine_mode mode, int opnum,
|
||||
enum reload_type type, int ind_levels)
|
||||
{
|
||||
if (CONSTANT_P (x)
|
||||
&& (! LEGITIMATE_CONSTANT_P (x)
|
||||
@ -5869,14 +5783,8 @@ find_reloads_address_part (x, loc, class, mode, opnum, type, ind_levels)
|
||||
stack slots. */
|
||||
|
||||
static rtx
|
||||
find_reloads_subreg_address (x, force_replace, opnum, type,
|
||||
ind_levels, insn)
|
||||
rtx x;
|
||||
int force_replace;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
int ind_levels;
|
||||
rtx insn;
|
||||
find_reloads_subreg_address (rtx x, int force_replace, int opnum,
|
||||
enum reload_type type, int ind_levels, rtx insn)
|
||||
{
|
||||
int regno = REGNO (SUBREG_REG (x));
|
||||
|
||||
@ -5955,8 +5863,7 @@ find_reloads_subreg_address (x, force_replace, opnum, type,
|
||||
Return the rtx that X translates into; usually X, but modified. */
|
||||
|
||||
void
|
||||
subst_reloads (insn)
|
||||
rtx insn;
|
||||
subst_reloads (rtx insn)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -6046,8 +5953,7 @@ subst_reloads (insn)
|
||||
copies to locations in Y, a copy of X. */
|
||||
|
||||
void
|
||||
copy_replacements (x, y)
|
||||
rtx x, y;
|
||||
copy_replacements (rtx x, rtx y)
|
||||
{
|
||||
/* We can't support X being a SUBREG because we might then need to know its
|
||||
location if something inside it was replaced. */
|
||||
@ -6058,10 +5964,7 @@ copy_replacements (x, y)
|
||||
}
|
||||
|
||||
static void
|
||||
copy_replacements_1 (px, py, orig_replacements)
|
||||
rtx *px;
|
||||
rtx *py;
|
||||
int orig_replacements;
|
||||
copy_replacements_1 (rtx *px, rtx *py, int orig_replacements)
|
||||
{
|
||||
int i, j;
|
||||
rtx x, y;
|
||||
@ -6108,9 +6011,7 @@ copy_replacements_1 (px, py, orig_replacements)
|
||||
/* Change any replacements being done to *X to be done to *Y. */
|
||||
|
||||
void
|
||||
move_replacements (x, y)
|
||||
rtx *x;
|
||||
rtx *y;
|
||||
move_replacements (rtx *x, rtx *y)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -6128,8 +6029,7 @@ move_replacements (x, y)
|
||||
Otherwise, return *LOC. */
|
||||
|
||||
rtx
|
||||
find_replacement (loc)
|
||||
rtx *loc;
|
||||
find_replacement (rtx *loc)
|
||||
{
|
||||
struct replacement *r;
|
||||
|
||||
@ -6199,10 +6099,8 @@ find_replacement (loc)
|
||||
look at equivalences for pseudos that didn't get hard registers. */
|
||||
|
||||
int
|
||||
refers_to_regno_for_reload_p (regno, endregno, x, loc)
|
||||
unsigned int regno, endregno;
|
||||
rtx x;
|
||||
rtx *loc;
|
||||
refers_to_regno_for_reload_p (unsigned int regno, unsigned int endregno,
|
||||
rtx x, rtx *loc)
|
||||
{
|
||||
int i;
|
||||
unsigned int r;
|
||||
@ -6325,8 +6223,7 @@ refers_to_regno_for_reload_p (regno, endregno, x, loc)
|
||||
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;
|
||||
reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
|
||||
{
|
||||
int regno, endregno;
|
||||
|
||||
@ -6384,8 +6281,7 @@ reg_overlap_mentioned_for_reload_p (x, in)
|
||||
registers. */
|
||||
|
||||
int
|
||||
refers_to_mem_for_reload_p (x)
|
||||
rtx x;
|
||||
refers_to_mem_for_reload_p (rtx x)
|
||||
{
|
||||
const char *fmt;
|
||||
int i;
|
||||
@ -6435,14 +6331,8 @@ refers_to_mem_for_reload_p (x)
|
||||
as if it were a constant except that sp is required to be unchanging. */
|
||||
|
||||
rtx
|
||||
find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
|
||||
rtx goal;
|
||||
rtx insn;
|
||||
enum reg_class class;
|
||||
int other;
|
||||
short *reload_reg_p;
|
||||
int goalreg;
|
||||
enum machine_mode mode;
|
||||
find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other,
|
||||
short *reload_reg_p, int goalreg, enum machine_mode mode)
|
||||
{
|
||||
rtx p = insn;
|
||||
rtx goaltry, valtry, value, where;
|
||||
@ -6890,8 +6780,7 @@ find_equiv_reg (goal, insn, class, other, reload_reg_p, goalreg, mode)
|
||||
The value is always positive. */
|
||||
|
||||
static int
|
||||
find_inc_amount (x, inced)
|
||||
rtx x, inced;
|
||||
find_inc_amount (rtx x, rtx inced)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
const char *fmt;
|
||||
@ -6946,11 +6835,8 @@ find_inc_amount (x, inced)
|
||||
If SETS is nonzero, also consider SETs. */
|
||||
|
||||
int
|
||||
regno_clobbered_p (regno, insn, mode, sets)
|
||||
unsigned int regno;
|
||||
rtx insn;
|
||||
enum machine_mode mode;
|
||||
int sets;
|
||||
regno_clobbered_p (unsigned int regno, rtx insn, enum machine_mode mode,
|
||||
int sets)
|
||||
{
|
||||
unsigned int nregs = HARD_REGNO_NREGS (regno, mode);
|
||||
unsigned int endregno = regno + nregs;
|
||||
@ -6988,9 +6874,7 @@ regno_clobbered_p (regno, insn, mode, sets)
|
||||
|
||||
/* Find the low part, with mode MODE, of a hard regno RELOADREG. */
|
||||
rtx
|
||||
reload_adjust_reg_for_mode (reloadreg, mode)
|
||||
rtx reloadreg;
|
||||
enum machine_mode mode;
|
||||
reload_adjust_reg_for_mode (rtx reloadreg, enum machine_mode mode)
|
||||
{
|
||||
int regno;
|
||||
|
||||
@ -7026,8 +6910,7 @@ static const char * const reg_class_names[] = REG_CLASS_NAMES;
|
||||
/* These functions are used to print the variables set by 'find_reloads' */
|
||||
|
||||
void
|
||||
debug_reload_to_stream (f)
|
||||
FILE *f;
|
||||
debug_reload_to_stream (FILE *f)
|
||||
{
|
||||
int r;
|
||||
const char *prefix;
|
||||
@ -7122,7 +7005,7 @@ debug_reload_to_stream (f)
|
||||
}
|
||||
|
||||
void
|
||||
debug_reload ()
|
||||
debug_reload (void)
|
||||
{
|
||||
debug_reload_to_stream (stderr);
|
||||
}
|
||||
|
96
gcc/reload.h
96
gcc/reload.h
@ -44,7 +44,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#define MEMORY_MOVE_COST(MODE,CLASS,IN) 4
|
||||
#endif
|
||||
#endif
|
||||
extern int memory_move_secondary_cost PARAMS ((enum machine_mode, enum reg_class, int));
|
||||
extern int memory_move_secondary_cost (enum machine_mode, enum reg_class, int);
|
||||
|
||||
/* Maximum number of reloads we can need. */
|
||||
#define MAX_RELOADS (2 * MAX_RECOG_OPERANDS * (MAX_REGS_PER_ADDRESS + 1))
|
||||
@ -68,14 +68,14 @@ extern int memory_move_secondary_cost PARAMS ((enum machine_mode, enum reg_class
|
||||
reloads; usually secondary reloads
|
||||
RELOAD_OTHER none of the above, usually multiple uses
|
||||
RELOAD_FOR_OTHER_ADDRESS reload for part of the address of an input
|
||||
that is marked RELOAD_OTHER.
|
||||
that is marked RELOAD_OTHER.
|
||||
|
||||
This used to be "enum reload_when_needed" but some debuggers have trouble
|
||||
with an enum tag and variable of the same name. */
|
||||
|
||||
enum reload_type
|
||||
{
|
||||
RELOAD_FOR_INPUT, RELOAD_FOR_OUTPUT, RELOAD_FOR_INSN,
|
||||
RELOAD_FOR_INPUT, RELOAD_FOR_OUTPUT, RELOAD_FOR_INSN,
|
||||
RELOAD_FOR_INPUT_ADDRESS, RELOAD_FOR_INPADDR_ADDRESS,
|
||||
RELOAD_FOR_OUTPUT_ADDRESS, RELOAD_FOR_OUTADDR_ADDRESS,
|
||||
RELOAD_FOR_OPERAND_ADDRESS, RELOAD_FOR_OPADDR_ADDR,
|
||||
@ -147,7 +147,7 @@ struct reload
|
||||
addressing an output, for addressing a non-reloaded mem ref, or for
|
||||
unspecified purposes (i.e., more than one of the above). */
|
||||
enum reload_type when_needed;
|
||||
|
||||
|
||||
/* Nonzero for an optional reload. Optional reloads are ignored unless the
|
||||
value is already sitting in a register. */
|
||||
unsigned int optional:1;
|
||||
@ -203,7 +203,7 @@ struct needs
|
||||
/* This structure describes instructions which are relevant for reload.
|
||||
Apart from all regular insns, this also includes CODE_LABELs, since they
|
||||
must be examined for register elimination. */
|
||||
struct insn_chain
|
||||
struct insn_chain
|
||||
{
|
||||
/* Links to the neighbor instructions. */
|
||||
struct insn_chain *next, *prev;
|
||||
@ -247,146 +247,144 @@ struct insn_chain
|
||||
extern struct insn_chain *reload_insn_chain;
|
||||
|
||||
/* Allocate a new insn_chain structure. */
|
||||
extern struct insn_chain *new_insn_chain PARAMS ((void));
|
||||
extern struct insn_chain *new_insn_chain (void);
|
||||
|
||||
extern void compute_use_by_pseudos PARAMS ((HARD_REG_SET *, regset));
|
||||
extern void compute_use_by_pseudos (HARD_REG_SET *, regset);
|
||||
#endif
|
||||
|
||||
/* Functions from reload.c: */
|
||||
|
||||
/* Return a memory location that will be used to copy X in mode MODE.
|
||||
/* Return a memory location that will be used to copy X in mode MODE.
|
||||
If we haven't already made a location for this mode in this insn,
|
||||
call find_reloads_address on the location being returned. */
|
||||
extern rtx get_secondary_mem PARAMS ((rtx, enum machine_mode,
|
||||
int, enum reload_type));
|
||||
extern rtx get_secondary_mem (rtx, enum machine_mode, int, enum reload_type);
|
||||
|
||||
/* Clear any secondary memory locations we've made. */
|
||||
extern void clear_secondary_mem PARAMS ((void));
|
||||
extern void clear_secondary_mem (void);
|
||||
|
||||
/* Transfer all replacements that used to be in reload FROM to be in
|
||||
reload TO. */
|
||||
extern void transfer_replacements PARAMS ((int, int));
|
||||
extern void transfer_replacements (int, int);
|
||||
|
||||
/* IN_RTX is the value loaded by a reload that we now decided to inherit,
|
||||
or a subpart of it. If we have any replacements registered for IN_RTX,
|
||||
cancel the reloads that were supposed to load them.
|
||||
Return nonzero if we canceled any reloads. */
|
||||
extern int remove_address_replacements PARAMS ((rtx in_rtx));
|
||||
extern int remove_address_replacements (rtx in_rtx);
|
||||
|
||||
/* Like rtx_equal_p except that it allows a REG and a SUBREG to match
|
||||
if they are the same hard reg, and has special hacks for
|
||||
autoincrement and autodecrement. */
|
||||
extern int operands_match_p PARAMS ((rtx, rtx));
|
||||
extern int operands_match_p (rtx, rtx);
|
||||
|
||||
/* Return 1 if altering OP will not modify the value of CLOBBER. */
|
||||
extern int safe_from_earlyclobber PARAMS ((rtx, rtx));
|
||||
extern int safe_from_earlyclobber (rtx, rtx);
|
||||
|
||||
/* Search the body of INSN for values that need reloading and record them
|
||||
with push_reload. REPLACE nonzero means record also where the values occur
|
||||
so that subst_reloads can be used. */
|
||||
extern int find_reloads PARAMS ((rtx, int, int, int, short *));
|
||||
extern int find_reloads (rtx, int, int, int, short *);
|
||||
|
||||
/* Compute the sum of X and Y, making canonicalizations assumed in an
|
||||
address, namely: sum constant integers, surround the sum of two
|
||||
constants with a CONST, put the constant as the second operand, and
|
||||
group the constant on the outermost sum. */
|
||||
extern rtx form_sum PARAMS ((rtx, rtx));
|
||||
extern rtx form_sum (rtx, rtx);
|
||||
|
||||
/* Substitute into the current INSN the registers into which we have reloaded
|
||||
the things that need reloading. */
|
||||
extern void subst_reloads PARAMS ((rtx));
|
||||
extern void subst_reloads (rtx);
|
||||
|
||||
/* Make a copy of any replacements being done into X and move those copies
|
||||
to locations in Y, a copy of X. We only look at the highest level of
|
||||
the RTL. */
|
||||
extern void copy_replacements PARAMS ((rtx, rtx));
|
||||
extern void copy_replacements (rtx, rtx);
|
||||
|
||||
/* Change any replacements being done to *X to be done to *Y */
|
||||
extern void move_replacements PARAMS ((rtx *x, rtx *y));
|
||||
extern void move_replacements (rtx *x, rtx *y);
|
||||
|
||||
/* If LOC was scheduled to be replaced by something, return the replacement.
|
||||
Otherwise, return *LOC. */
|
||||
extern rtx find_replacement PARAMS ((rtx *));
|
||||
extern rtx find_replacement (rtx *);
|
||||
|
||||
/* Return nonzero if register in range [REGNO, ENDREGNO)
|
||||
appears either explicitly or implicitly in X
|
||||
other than being stored into. */
|
||||
extern int refers_to_regno_for_reload_p PARAMS ((unsigned int, unsigned int,
|
||||
rtx, rtx *));
|
||||
extern int refers_to_regno_for_reload_p (unsigned int, unsigned int,
|
||||
rtx, rtx *);
|
||||
|
||||
/* Nonzero if modifying X will affect IN. */
|
||||
extern int reg_overlap_mentioned_for_reload_p PARAMS ((rtx, rtx));
|
||||
extern int reg_overlap_mentioned_for_reload_p (rtx, rtx);
|
||||
|
||||
/* Return nonzero if anything in X contains a MEM. Look also for pseudo
|
||||
registers. */
|
||||
extern int refers_to_mem_for_reload_p PARAMS ((rtx));
|
||||
extern int refers_to_mem_for_reload_p (rtx);
|
||||
|
||||
/* Check the insns before INSN to see if there is a suitable register
|
||||
containing the same value as GOAL. */
|
||||
extern rtx find_equiv_reg PARAMS ((rtx, rtx, enum reg_class, int, short *,
|
||||
int, enum machine_mode));
|
||||
extern rtx find_equiv_reg (rtx, rtx, enum reg_class, int, short *,
|
||||
int, enum machine_mode);
|
||||
|
||||
/* Return 1 if register REGNO is the subject of a clobber in insn INSN. */
|
||||
extern int regno_clobbered_p PARAMS ((unsigned int, rtx, enum machine_mode,
|
||||
int));
|
||||
extern int regno_clobbered_p (unsigned int, rtx, enum machine_mode, int);
|
||||
|
||||
/* Return 1 if X is an operand of an insn that is being earlyclobbered. */
|
||||
extern int earlyclobber_operand_p PARAMS ((rtx));
|
||||
extern int earlyclobber_operand_p (rtx);
|
||||
|
||||
/* Record one reload that needs to be performed. */
|
||||
extern int push_reload PARAMS ((rtx, rtx, rtx *, rtx *, enum reg_class,
|
||||
enum machine_mode, enum machine_mode,
|
||||
int, int, int, enum reload_type));
|
||||
extern int push_reload (rtx, rtx, rtx *, rtx *, enum reg_class,
|
||||
enum machine_mode, enum machine_mode,
|
||||
int, int, int, enum reload_type);
|
||||
|
||||
/* Functions in postreload.c: */
|
||||
extern void reload_cse_regs PARAMS ((rtx));
|
||||
extern void reload_cse_regs (rtx);
|
||||
|
||||
/* Functions in reload1.c: */
|
||||
extern int reloads_conflict PARAMS ((int, int));
|
||||
extern int reloads_conflict (int, int);
|
||||
|
||||
/* Initialize the reload pass once per compilation. */
|
||||
extern void init_reload PARAMS ((void));
|
||||
extern void init_reload (void);
|
||||
|
||||
/* The reload pass itself. */
|
||||
extern int reload PARAMS ((rtx, int));
|
||||
extern int reload (rtx, int);
|
||||
|
||||
/* Mark the slots in regs_ever_live for the hard regs
|
||||
used by pseudo-reg number REGNO. */
|
||||
extern void mark_home_live PARAMS ((int));
|
||||
extern void mark_home_live (int);
|
||||
|
||||
/* Scan X and replace any eliminable registers (such as fp) with a
|
||||
replacement (such as sp), plus an offset. */
|
||||
extern rtx eliminate_regs PARAMS ((rtx, enum machine_mode, rtx));
|
||||
extern rtx eliminate_regs (rtx, enum machine_mode, rtx);
|
||||
|
||||
/* Emit code to perform a reload from IN (which may be a reload register) to
|
||||
OUT (which may also be a reload register). IN or OUT is from operand
|
||||
OPNUM with reload type TYPE. */
|
||||
extern rtx gen_reload PARAMS ((rtx, rtx, int, enum reload_type));
|
||||
extern rtx gen_reload (rtx, rtx, int, enum reload_type);
|
||||
|
||||
/* Deallocate the reload register used by reload number R. */
|
||||
extern void deallocate_reload_reg PARAMS ((int r));
|
||||
extern void deallocate_reload_reg (int r);
|
||||
|
||||
/* Functions in caller-save.c: */
|
||||
|
||||
/* Initialize for caller-save. */
|
||||
extern void init_caller_save PARAMS ((void));
|
||||
extern void init_caller_save (void);
|
||||
|
||||
/* Initialize save areas by showing that we haven't allocated any yet. */
|
||||
extern void init_save_areas PARAMS ((void));
|
||||
extern void init_save_areas (void);
|
||||
|
||||
/* Allocate save areas for any hard registers that might need saving. */
|
||||
extern void setup_save_areas PARAMS ((void));
|
||||
extern void setup_save_areas (void);
|
||||
|
||||
/* Find the places where hard regs are live across calls and save them. */
|
||||
extern void save_call_clobbered_regs PARAMS ((void));
|
||||
extern void save_call_clobbered_regs (void);
|
||||
|
||||
/* Replace (subreg (reg)) with the appropriate (reg) for any operands. */
|
||||
extern void cleanup_subreg_operands PARAMS ((rtx));
|
||||
extern void cleanup_subreg_operands (rtx);
|
||||
|
||||
/* Debugging support. */
|
||||
extern void debug_reload_to_stream PARAMS ((FILE *));
|
||||
extern void debug_reload PARAMS ((void));
|
||||
extern void debug_reload_to_stream (FILE *);
|
||||
extern void debug_reload (void);
|
||||
|
||||
/* Compute the actual register we should reload to, in case we're
|
||||
reloading to/from a register that is wider than a word. */
|
||||
extern rtx reload_adjust_reg_for_mode PARAMS ((rtx, enum machine_mode));
|
||||
extern rtx reload_adjust_reg_for_mode (rtx, enum machine_mode);
|
||||
|
404
gcc/reload1.c
404
gcc/reload1.c
@ -364,86 +364,77 @@ static int (*offsets_at)[NUM_ELIMINABLE_REGS];
|
||||
|
||||
static int num_labels;
|
||||
|
||||
static void replace_pseudos_in PARAMS ((rtx *, enum machine_mode, rtx));
|
||||
static void maybe_fix_stack_asms PARAMS ((void));
|
||||
static void copy_reloads PARAMS ((struct insn_chain *));
|
||||
static void calculate_needs_all_insns PARAMS ((int));
|
||||
static int find_reg PARAMS ((struct insn_chain *, int));
|
||||
static void find_reload_regs PARAMS ((struct insn_chain *));
|
||||
static void select_reload_regs PARAMS ((void));
|
||||
static void delete_caller_save_insns PARAMS ((void));
|
||||
static void replace_pseudos_in (rtx *, enum machine_mode, rtx);
|
||||
static void maybe_fix_stack_asms (void);
|
||||
static void copy_reloads (struct insn_chain *);
|
||||
static void calculate_needs_all_insns (int);
|
||||
static int find_reg (struct insn_chain *, int);
|
||||
static void find_reload_regs (struct insn_chain *);
|
||||
static void select_reload_regs (void);
|
||||
static void delete_caller_save_insns (void);
|
||||
|
||||
static void spill_failure PARAMS ((rtx, enum reg_class));
|
||||
static void count_spilled_pseudo PARAMS ((int, int, int));
|
||||
static void delete_dead_insn PARAMS ((rtx));
|
||||
static void alter_reg PARAMS ((int, int));
|
||||
static void set_label_offsets PARAMS ((rtx, rtx, int));
|
||||
static void check_eliminable_occurrences PARAMS ((rtx));
|
||||
static void elimination_effects PARAMS ((rtx, enum machine_mode));
|
||||
static int eliminate_regs_in_insn PARAMS ((rtx, int));
|
||||
static void update_eliminable_offsets PARAMS ((void));
|
||||
static void mark_not_eliminable PARAMS ((rtx, rtx, void *));
|
||||
static void set_initial_elim_offsets PARAMS ((void));
|
||||
static void verify_initial_elim_offsets PARAMS ((void));
|
||||
static void set_initial_label_offsets PARAMS ((void));
|
||||
static void set_offsets_for_label PARAMS ((rtx));
|
||||
static void init_elim_table PARAMS ((void));
|
||||
static void update_eliminables PARAMS ((HARD_REG_SET *));
|
||||
static void spill_hard_reg PARAMS ((unsigned int, int));
|
||||
static int finish_spills PARAMS ((int));
|
||||
static void ior_hard_reg_set PARAMS ((HARD_REG_SET *, HARD_REG_SET *));
|
||||
static void scan_paradoxical_subregs PARAMS ((rtx));
|
||||
static void count_pseudo PARAMS ((int));
|
||||
static void order_regs_for_reload PARAMS ((struct insn_chain *));
|
||||
static void reload_as_needed PARAMS ((int));
|
||||
static void forget_old_reloads_1 PARAMS ((rtx, rtx, void *));
|
||||
static int reload_reg_class_lower PARAMS ((const void *, const void *));
|
||||
static void mark_reload_reg_in_use PARAMS ((unsigned int, int,
|
||||
enum reload_type,
|
||||
enum machine_mode));
|
||||
static void clear_reload_reg_in_use PARAMS ((unsigned int, int,
|
||||
enum reload_type,
|
||||
enum machine_mode));
|
||||
static int reload_reg_free_p PARAMS ((unsigned int, int,
|
||||
enum reload_type));
|
||||
static int reload_reg_free_for_value_p PARAMS ((int, int, int,
|
||||
enum reload_type,
|
||||
rtx, rtx, int, int));
|
||||
static int free_for_value_p PARAMS ((int, enum machine_mode, int,
|
||||
enum reload_type, rtx, rtx,
|
||||
int, int));
|
||||
static int reload_reg_reaches_end_p PARAMS ((unsigned int, int,
|
||||
enum reload_type));
|
||||
static int allocate_reload_reg PARAMS ((struct insn_chain *, int,
|
||||
int));
|
||||
static int conflicts_with_override PARAMS ((rtx));
|
||||
static void failed_reload PARAMS ((rtx, int));
|
||||
static int set_reload_reg PARAMS ((int, int));
|
||||
static void choose_reload_regs_init PARAMS ((struct insn_chain *, rtx *));
|
||||
static void choose_reload_regs PARAMS ((struct insn_chain *));
|
||||
static void merge_assigned_reloads PARAMS ((rtx));
|
||||
static void emit_input_reload_insns PARAMS ((struct insn_chain *,
|
||||
struct reload *, rtx, int));
|
||||
static void emit_output_reload_insns PARAMS ((struct insn_chain *,
|
||||
struct reload *, int));
|
||||
static void do_input_reload PARAMS ((struct insn_chain *,
|
||||
struct reload *, int));
|
||||
static void do_output_reload PARAMS ((struct insn_chain *,
|
||||
struct reload *, int));
|
||||
static void emit_reload_insns PARAMS ((struct insn_chain *));
|
||||
static void delete_output_reload PARAMS ((rtx, int, int));
|
||||
static void delete_address_reloads PARAMS ((rtx, rtx));
|
||||
static void delete_address_reloads_1 PARAMS ((rtx, rtx, rtx));
|
||||
static rtx inc_for_reload PARAMS ((rtx, rtx, rtx, int));
|
||||
static void spill_failure (rtx, enum reg_class);
|
||||
static void count_spilled_pseudo (int, int, int);
|
||||
static void delete_dead_insn (rtx);
|
||||
static void alter_reg (int, int);
|
||||
static void set_label_offsets (rtx, rtx, int);
|
||||
static void check_eliminable_occurrences (rtx);
|
||||
static void elimination_effects (rtx, enum machine_mode);
|
||||
static int eliminate_regs_in_insn (rtx, int);
|
||||
static void update_eliminable_offsets (void);
|
||||
static void mark_not_eliminable (rtx, rtx, void *);
|
||||
static void set_initial_elim_offsets (void);
|
||||
static void verify_initial_elim_offsets (void);
|
||||
static void set_initial_label_offsets (void);
|
||||
static void set_offsets_for_label (rtx);
|
||||
static void init_elim_table (void);
|
||||
static void update_eliminables (HARD_REG_SET *);
|
||||
static void spill_hard_reg (unsigned int, int);
|
||||
static int finish_spills (int);
|
||||
static void ior_hard_reg_set (HARD_REG_SET *, HARD_REG_SET *);
|
||||
static void scan_paradoxical_subregs (rtx);
|
||||
static void count_pseudo (int);
|
||||
static void order_regs_for_reload (struct insn_chain *);
|
||||
static void reload_as_needed (int);
|
||||
static void forget_old_reloads_1 (rtx, rtx, void *);
|
||||
static int reload_reg_class_lower (const void *, const void *);
|
||||
static void mark_reload_reg_in_use (unsigned int, int, enum reload_type,
|
||||
enum machine_mode);
|
||||
static void clear_reload_reg_in_use (unsigned int, int, enum reload_type,
|
||||
enum machine_mode);
|
||||
static int reload_reg_free_p (unsigned int, int, enum reload_type);
|
||||
static int reload_reg_free_for_value_p (int, int, int, enum reload_type,
|
||||
rtx, rtx, int, int);
|
||||
static int free_for_value_p (int, enum machine_mode, int, enum reload_type,
|
||||
rtx, rtx, int, int);
|
||||
static int reload_reg_reaches_end_p (unsigned int, int, enum reload_type);
|
||||
static int allocate_reload_reg (struct insn_chain *, int, int);
|
||||
static int conflicts_with_override (rtx);
|
||||
static void failed_reload (rtx, int);
|
||||
static int set_reload_reg (int, int);
|
||||
static void choose_reload_regs_init (struct insn_chain *, rtx *);
|
||||
static void choose_reload_regs (struct insn_chain *);
|
||||
static void merge_assigned_reloads (rtx);
|
||||
static void emit_input_reload_insns (struct insn_chain *, struct reload *,
|
||||
rtx, int);
|
||||
static void emit_output_reload_insns (struct insn_chain *, struct reload *,
|
||||
int);
|
||||
static void do_input_reload (struct insn_chain *, struct reload *, int);
|
||||
static void do_output_reload (struct insn_chain *, struct reload *, int);
|
||||
static void emit_reload_insns (struct insn_chain *);
|
||||
static void delete_output_reload (rtx, int, int);
|
||||
static void delete_address_reloads (rtx, rtx);
|
||||
static void delete_address_reloads_1 (rtx, rtx, rtx);
|
||||
static rtx inc_for_reload (rtx, rtx, rtx, int);
|
||||
#ifdef AUTO_INC_DEC
|
||||
static void add_auto_inc_notes PARAMS ((rtx, rtx));
|
||||
static void add_auto_inc_notes (rtx, rtx);
|
||||
#endif
|
||||
static void copy_eh_notes PARAMS ((rtx, rtx));
|
||||
static void copy_eh_notes (rtx, rtx);
|
||||
|
||||
/* Initialize the reload pass once per compilation. */
|
||||
|
||||
void
|
||||
init_reload ()
|
||||
init_reload (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -501,7 +492,7 @@ static struct insn_chain *unused_insn_chains = 0;
|
||||
|
||||
/* Allocate an empty insn_chain structure. */
|
||||
struct insn_chain *
|
||||
new_insn_chain ()
|
||||
new_insn_chain (void)
|
||||
{
|
||||
struct insn_chain *c;
|
||||
|
||||
@ -528,9 +519,7 @@ new_insn_chain ()
|
||||
allocated to pseudos in regset FROM. */
|
||||
|
||||
void
|
||||
compute_use_by_pseudos (to, from)
|
||||
HARD_REG_SET *to;
|
||||
regset from;
|
||||
compute_use_by_pseudos (HARD_REG_SET *to, regset from)
|
||||
{
|
||||
unsigned int regno;
|
||||
|
||||
@ -562,10 +551,7 @@ compute_use_by_pseudos (to, from)
|
||||
equivalences. */
|
||||
|
||||
static void
|
||||
replace_pseudos_in (loc, mem_mode, usage)
|
||||
rtx *loc;
|
||||
enum machine_mode mem_mode;
|
||||
rtx usage;
|
||||
replace_pseudos_in (rtx *loc, enum machine_mode mem_mode, rtx usage)
|
||||
{
|
||||
rtx x = *loc;
|
||||
enum rtx_code code;
|
||||
@ -646,9 +632,7 @@ static int failure;
|
||||
and we must not do any more for this function. */
|
||||
|
||||
int
|
||||
reload (first, global)
|
||||
rtx first;
|
||||
int global;
|
||||
reload (rtx first, int global)
|
||||
{
|
||||
int i;
|
||||
rtx insn;
|
||||
@ -1182,7 +1166,7 @@ reload (first, global)
|
||||
&& (GET_CODE (XEXP (PATTERN (insn), 0)) != MEM
|
||||
|| GET_MODE (XEXP (PATTERN (insn), 0)) != BLKmode
|
||||
|| (GET_CODE (XEXP (XEXP (PATTERN (insn), 0), 0)) != SCRATCH
|
||||
&& XEXP (XEXP (PATTERN (insn), 0), 0)
|
||||
&& XEXP (XEXP (PATTERN (insn), 0), 0)
|
||||
!= stack_pointer_rtx))
|
||||
&& (GET_CODE (XEXP (PATTERN (insn), 0)) != REG
|
||||
|| ! REG_FUNCTION_VALUE_P (XEXP (PATTERN (insn), 0)))))
|
||||
@ -1287,7 +1271,7 @@ reload (first, global)
|
||||
The whole thing is rather sick, I'm afraid. */
|
||||
|
||||
static void
|
||||
maybe_fix_stack_asms ()
|
||||
maybe_fix_stack_asms (void)
|
||||
{
|
||||
#ifdef STACK_REGS
|
||||
const char *constraints[MAX_RECOG_OPERANDS];
|
||||
@ -1400,8 +1384,7 @@ maybe_fix_stack_asms ()
|
||||
/* Copy the global variables n_reloads and rld into the corresponding elts
|
||||
of CHAIN. */
|
||||
static void
|
||||
copy_reloads (chain)
|
||||
struct insn_chain *chain;
|
||||
copy_reloads (struct insn_chain *chain)
|
||||
{
|
||||
chain->n_reloads = n_reloads;
|
||||
chain->rld
|
||||
@ -1415,8 +1398,7 @@ copy_reloads (chain)
|
||||
and/or eliminations. Build the corresponding insns_need_reload list, and
|
||||
set something_needs_elimination as appropriate. */
|
||||
static void
|
||||
calculate_needs_all_insns (global)
|
||||
int global;
|
||||
calculate_needs_all_insns (int global)
|
||||
{
|
||||
struct insn_chain **pprev_reload = &insns_need_reload;
|
||||
struct insn_chain *chain, *next = 0;
|
||||
@ -1531,9 +1513,7 @@ calculate_needs_all_insns (global)
|
||||
should be handled first. *P1 and *P2 are the reload numbers. */
|
||||
|
||||
static int
|
||||
reload_reg_class_lower (r1p, r2p)
|
||||
const void *r1p;
|
||||
const void *r2p;
|
||||
reload_reg_class_lower (const void *r1p, const void *r2p)
|
||||
{
|
||||
int r1 = *(const short *) r1p, r2 = *(const short *) r2p;
|
||||
int t;
|
||||
@ -1575,8 +1555,7 @@ static int spill_add_cost[FIRST_PSEUDO_REGISTER];
|
||||
/* Update the spill cost arrays, considering that pseudo REG is live. */
|
||||
|
||||
static void
|
||||
count_pseudo (reg)
|
||||
int reg;
|
||||
count_pseudo (int reg)
|
||||
{
|
||||
int freq = REG_FREQ (reg);
|
||||
int r = reg_renumber[reg];
|
||||
@ -1602,8 +1581,7 @@ count_pseudo (reg)
|
||||
contents of BAD_SPILL_REGS for the insn described by CHAIN. */
|
||||
|
||||
static void
|
||||
order_regs_for_reload (chain)
|
||||
struct insn_chain *chain;
|
||||
order_regs_for_reload (struct insn_chain *chain)
|
||||
{
|
||||
int i;
|
||||
HARD_REG_SET used_by_pseudos;
|
||||
@ -1653,8 +1631,7 @@ static HARD_REG_SET used_spill_regs_local;
|
||||
update SPILL_COST/SPILL_ADD_COST. */
|
||||
|
||||
static void
|
||||
count_spilled_pseudo (spilled, spilled_nregs, reg)
|
||||
int spilled, spilled_nregs, reg;
|
||||
count_spilled_pseudo (int spilled, int spilled_nregs, int reg)
|
||||
{
|
||||
int r = reg_renumber[reg];
|
||||
int nregs = HARD_REGNO_NREGS (r, PSEUDO_REGNO_MODE (reg));
|
||||
@ -1673,9 +1650,7 @@ count_spilled_pseudo (spilled, spilled_nregs, reg)
|
||||
/* Find reload register to use for reload number ORDER. */
|
||||
|
||||
static int
|
||||
find_reg (chain, order)
|
||||
struct insn_chain *chain;
|
||||
int order;
|
||||
find_reg (struct insn_chain *chain, int order)
|
||||
{
|
||||
int rnum = reload_order[order];
|
||||
struct reload *rl = rld + rnum;
|
||||
@ -1781,8 +1756,7 @@ find_reg (chain, order)
|
||||
for a smaller class even though it belongs to that class. */
|
||||
|
||||
static void
|
||||
find_reload_regs (chain)
|
||||
struct insn_chain *chain;
|
||||
find_reload_regs (struct insn_chain *chain)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1842,7 +1816,7 @@ find_reload_regs (chain)
|
||||
}
|
||||
|
||||
static void
|
||||
select_reload_regs ()
|
||||
select_reload_regs (void)
|
||||
{
|
||||
struct insn_chain *chain;
|
||||
|
||||
@ -1855,7 +1829,7 @@ select_reload_regs ()
|
||||
/* Delete all insns that were inserted by emit_caller_save_insns during
|
||||
this iteration. */
|
||||
static void
|
||||
delete_caller_save_insns ()
|
||||
delete_caller_save_insns (void)
|
||||
{
|
||||
struct insn_chain *c = reload_insn_chain;
|
||||
|
||||
@ -1887,9 +1861,7 @@ delete_caller_save_insns ()
|
||||
INSN should be one of the insns which needed this particular spill reg. */
|
||||
|
||||
static void
|
||||
spill_failure (insn, class)
|
||||
rtx insn;
|
||||
enum reg_class class;
|
||||
spill_failure (rtx insn, enum reg_class class)
|
||||
{
|
||||
static const char *const reg_class_names[] = REG_CLASS_NAMES;
|
||||
if (asm_noperands (PATTERN (insn)) >= 0)
|
||||
@ -1907,8 +1879,7 @@ spill_failure (insn, class)
|
||||
data that is dead in INSN. */
|
||||
|
||||
static void
|
||||
delete_dead_insn (insn)
|
||||
rtx insn;
|
||||
delete_dead_insn (rtx insn)
|
||||
{
|
||||
rtx prev = prev_real_insn (insn);
|
||||
rtx prev_dest;
|
||||
@ -1936,9 +1907,7 @@ delete_dead_insn (insn)
|
||||
can share one stack slot. */
|
||||
|
||||
static void
|
||||
alter_reg (i, from_reg)
|
||||
int i;
|
||||
int from_reg;
|
||||
alter_reg (int i, int from_reg)
|
||||
{
|
||||
/* When outputting an inline function, this can happen
|
||||
for a reg that isn't actually used. */
|
||||
@ -2086,8 +2055,7 @@ alter_reg (i, from_reg)
|
||||
used by pseudo-reg number REGNO. */
|
||||
|
||||
void
|
||||
mark_home_live (regno)
|
||||
int regno;
|
||||
mark_home_live (int regno)
|
||||
{
|
||||
int i, lim;
|
||||
|
||||
@ -2110,10 +2078,7 @@ mark_home_live (regno)
|
||||
current offset. */
|
||||
|
||||
static void
|
||||
set_label_offsets (x, insn, initial_p)
|
||||
rtx x;
|
||||
rtx insn;
|
||||
int initial_p;
|
||||
set_label_offsets (rtx x, rtx insn, int initial_p)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
rtx tem;
|
||||
@ -2276,10 +2241,7 @@ set_label_offsets (x, insn, initial_p)
|
||||
the proper thing. */
|
||||
|
||||
rtx
|
||||
eliminate_regs (x, mem_mode, insn)
|
||||
rtx x;
|
||||
enum machine_mode mem_mode;
|
||||
rtx insn;
|
||||
eliminate_regs (rtx x, enum machine_mode mem_mode, rtx insn)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
struct elim_table *ep;
|
||||
@ -2664,10 +2626,7 @@ eliminate_regs (x, mem_mode, insn)
|
||||
the mode of an enclosing MEM rtx, or VOIDmode if not within a MEM. */
|
||||
|
||||
static void
|
||||
elimination_effects (x, mem_mode)
|
||||
rtx x;
|
||||
enum machine_mode mem_mode;
|
||||
|
||||
elimination_effects (rtx x, enum machine_mode mem_mode)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
struct elim_table *ep;
|
||||
@ -2864,8 +2823,7 @@ elimination_effects (x, mem_mode)
|
||||
eliminable. */
|
||||
|
||||
static void
|
||||
check_eliminable_occurrences (x)
|
||||
rtx x;
|
||||
check_eliminable_occurrences (rtx x)
|
||||
{
|
||||
const char *fmt;
|
||||
int i;
|
||||
@ -2914,9 +2872,7 @@ check_eliminable_occurrences (x)
|
||||
is returned. Otherwise, 1 is returned. */
|
||||
|
||||
static int
|
||||
eliminate_regs_in_insn (insn, replace)
|
||||
rtx insn;
|
||||
int replace;
|
||||
eliminate_regs_in_insn (rtx insn, int replace)
|
||||
{
|
||||
int icode = recog_memoized (insn);
|
||||
rtx old_body = PATTERN (insn);
|
||||
@ -3262,7 +3218,7 @@ eliminate_regs_in_insn (insn, replace)
|
||||
grow downward) for each elimination pair. */
|
||||
|
||||
static void
|
||||
update_eliminable_offsets ()
|
||||
update_eliminable_offsets (void)
|
||||
{
|
||||
struct elim_table *ep;
|
||||
|
||||
@ -3290,10 +3246,7 @@ update_eliminable_offsets ()
|
||||
the insns of the function. */
|
||||
|
||||
static void
|
||||
mark_not_eliminable (dest, x, data)
|
||||
rtx dest;
|
||||
rtx x;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
mark_not_eliminable (rtx dest, rtx x, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@ -3325,7 +3278,7 @@ mark_not_eliminable (dest, x, data)
|
||||
cause incorrect code to be generated if we did not check for it. */
|
||||
|
||||
static void
|
||||
verify_initial_elim_offsets ()
|
||||
verify_initial_elim_offsets (void)
|
||||
{
|
||||
int t;
|
||||
|
||||
@ -3348,7 +3301,7 @@ verify_initial_elim_offsets ()
|
||||
/* Reset all offsets on eliminable registers to their initial values. */
|
||||
|
||||
static void
|
||||
set_initial_elim_offsets ()
|
||||
set_initial_elim_offsets (void)
|
||||
{
|
||||
struct elim_table *ep = reg_eliminate;
|
||||
|
||||
@ -3374,7 +3327,7 @@ set_initial_elim_offsets ()
|
||||
For all other labels, show that we don't know the offsets. */
|
||||
|
||||
static void
|
||||
set_initial_label_offsets ()
|
||||
set_initial_label_offsets (void)
|
||||
{
|
||||
rtx x;
|
||||
memset (offsets_known_at, 0, num_labels);
|
||||
@ -3388,8 +3341,7 @@ set_initial_label_offsets ()
|
||||
by INSN. */
|
||||
|
||||
static void
|
||||
set_offsets_for_label (insn)
|
||||
rtx insn;
|
||||
set_offsets_for_label (rtx insn)
|
||||
{
|
||||
unsigned int i;
|
||||
int label_nr = CODE_LABEL_NUMBER (insn);
|
||||
@ -3412,8 +3364,7 @@ set_offsets_for_label (insn)
|
||||
since they can't have changed. */
|
||||
|
||||
static void
|
||||
update_eliminables (pset)
|
||||
HARD_REG_SET *pset;
|
||||
update_eliminables (HARD_REG_SET *pset)
|
||||
{
|
||||
int previous_frame_pointer_needed = frame_pointer_needed;
|
||||
struct elim_table *ep;
|
||||
@ -3489,7 +3440,7 @@ update_eliminables (pset)
|
||||
/* Initialize the table of registers to eliminate. */
|
||||
|
||||
static void
|
||||
init_elim_table ()
|
||||
init_elim_table (void)
|
||||
{
|
||||
struct elim_table *ep;
|
||||
#ifdef ELIMINABLE_REGS
|
||||
@ -3556,9 +3507,7 @@ init_elim_table ()
|
||||
Return nonzero if any pseudos needed to be kicked out. */
|
||||
|
||||
static void
|
||||
spill_hard_reg (regno, cant_eliminate)
|
||||
unsigned int regno;
|
||||
int cant_eliminate;
|
||||
spill_hard_reg (unsigned int regno, int cant_eliminate)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -3585,8 +3534,7 @@ spill_hard_reg (regno, cant_eliminate)
|
||||
from within EXECUTE_IF_SET_IN_REG_SET. Hence this awkwardness. */
|
||||
|
||||
static void
|
||||
ior_hard_reg_set (set1, set2)
|
||||
HARD_REG_SET *set1, *set2;
|
||||
ior_hard_reg_set (HARD_REG_SET *set1, HARD_REG_SET *set2)
|
||||
{
|
||||
IOR_HARD_REG_SET (*set1, *set2);
|
||||
}
|
||||
@ -3597,8 +3545,7 @@ ior_hard_reg_set (set1, set2)
|
||||
spill_regs array for use by choose_reload_regs. */
|
||||
|
||||
static int
|
||||
finish_spills (global)
|
||||
int global;
|
||||
finish_spills (int global)
|
||||
{
|
||||
struct insn_chain *chain;
|
||||
int something_changed = 0;
|
||||
@ -3747,8 +3694,7 @@ finish_spills (global)
|
||||
forbidden from being used for spill registers. */
|
||||
|
||||
static void
|
||||
scan_paradoxical_subregs (x)
|
||||
rtx x;
|
||||
scan_paradoxical_subregs (rtx x)
|
||||
{
|
||||
int i;
|
||||
const char *fmt;
|
||||
@ -3811,8 +3757,7 @@ scan_paradoxical_subregs (x)
|
||||
as the insns are scanned. */
|
||||
|
||||
static void
|
||||
reload_as_needed (live_known)
|
||||
int live_known;
|
||||
reload_as_needed (int live_known)
|
||||
{
|
||||
struct insn_chain *chain;
|
||||
#if defined (AUTO_INC_DEC)
|
||||
@ -4090,10 +4035,8 @@ reload_as_needed (live_known)
|
||||
or it may be a pseudo reg that was reloaded from. */
|
||||
|
||||
static void
|
||||
forget_old_reloads_1 (x, ignored, data)
|
||||
rtx x;
|
||||
rtx ignored ATTRIBUTE_UNUSED;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
forget_old_reloads_1 (rtx x, rtx ignored ATTRIBUTE_UNUSED,
|
||||
void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
unsigned int regno;
|
||||
unsigned int nr;
|
||||
@ -4189,11 +4132,8 @@ static HARD_REG_SET reg_used_in_insn;
|
||||
actually used. */
|
||||
|
||||
static void
|
||||
mark_reload_reg_in_use (regno, opnum, type, mode)
|
||||
unsigned int regno;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
enum machine_mode mode;
|
||||
mark_reload_reg_in_use (unsigned int regno, int opnum, enum reload_type type,
|
||||
enum machine_mode mode)
|
||||
{
|
||||
unsigned int nregs = HARD_REGNO_NREGS (regno, mode);
|
||||
unsigned int i;
|
||||
@ -4254,11 +4194,8 @@ mark_reload_reg_in_use (regno, opnum, type, mode)
|
||||
/* Similarly, but show REGNO is no longer in use for a reload. */
|
||||
|
||||
static void
|
||||
clear_reload_reg_in_use (regno, opnum, type, mode)
|
||||
unsigned int regno;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
enum machine_mode mode;
|
||||
clear_reload_reg_in_use (unsigned int regno, int opnum,
|
||||
enum reload_type type, enum machine_mode mode)
|
||||
{
|
||||
unsigned int nregs = HARD_REGNO_NREGS (regno, mode);
|
||||
unsigned int start_regno, end_regno, r;
|
||||
@ -4366,10 +4303,7 @@ clear_reload_reg_in_use (regno, opnum, type, mode)
|
||||
specified by OPNUM and TYPE. */
|
||||
|
||||
static int
|
||||
reload_reg_free_p (regno, opnum, type)
|
||||
unsigned int regno;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
reload_reg_free_p (unsigned int regno, int opnum, enum reload_type type)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -4532,10 +4466,7 @@ reload_reg_free_p (regno, opnum, type)
|
||||
in case the reg has already been marked in use. */
|
||||
|
||||
static int
|
||||
reload_reg_reaches_end_p (regno, opnum, type)
|
||||
unsigned int regno;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
reload_reg_reaches_end_p (unsigned int regno, int opnum, enum reload_type type)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -4665,8 +4596,7 @@ reload_reg_reaches_end_p (regno, opnum, type)
|
||||
This function uses the same algorithm as reload_reg_free_p above. */
|
||||
|
||||
int
|
||||
reloads_conflict (r1, r2)
|
||||
int r1, r2;
|
||||
reloads_conflict (int r1, int r2)
|
||||
{
|
||||
enum reload_type r1_type = rld[r1].when_needed;
|
||||
enum reload_type r2_type = rld[r2].when_needed;
|
||||
@ -4757,14 +4687,9 @@ int reload_spill_index[MAX_RELOADS];
|
||||
(possibly comprising multiple hard registers) that we are considering. */
|
||||
|
||||
static int
|
||||
reload_reg_free_for_value_p (start_regno, regno, opnum, type, value, out,
|
||||
reloadnum, ignore_address_reloads)
|
||||
int start_regno, regno;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
rtx value, out;
|
||||
int reloadnum;
|
||||
int ignore_address_reloads;
|
||||
reload_reg_free_for_value_p (int start_regno, int regno, int opnum,
|
||||
enum reload_type type, rtx value, rtx out,
|
||||
int reloadnum, int ignore_address_reloads)
|
||||
{
|
||||
int time1;
|
||||
/* Set if we see an input reload that must not share its reload register
|
||||
@ -5001,15 +4926,9 @@ reload_reg_free_for_value_p (start_regno, regno, opnum, type, value, out,
|
||||
register. */
|
||||
|
||||
static int
|
||||
free_for_value_p (regno, mode, opnum, type, value, out, reloadnum,
|
||||
ignore_address_reloads)
|
||||
int regno;
|
||||
enum machine_mode mode;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
rtx value, out;
|
||||
int reloadnum;
|
||||
int ignore_address_reloads;
|
||||
free_for_value_p (int regno, enum machine_mode mode, int opnum,
|
||||
enum reload_type type, rtx value, rtx out, int reloadnum,
|
||||
int ignore_address_reloads)
|
||||
{
|
||||
int nregs = HARD_REGNO_NREGS (regno, mode);
|
||||
while (nregs-- > 0)
|
||||
@ -5024,8 +4943,7 @@ free_for_value_p (regno, mode, opnum, type, value, out, reloadnum,
|
||||
overriding inheritance. Return nonzero if so. */
|
||||
|
||||
static int
|
||||
conflicts_with_override (x)
|
||||
rtx x;
|
||||
conflicts_with_override (rtx x)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n_reloads; i++)
|
||||
@ -5038,9 +4956,7 @@ conflicts_with_override (x)
|
||||
/* Give an error message saying we failed to find a reload for INSN,
|
||||
and clear out reload R. */
|
||||
static void
|
||||
failed_reload (insn, r)
|
||||
rtx insn;
|
||||
int r;
|
||||
failed_reload (rtx insn, int r)
|
||||
{
|
||||
if (asm_noperands (PATTERN (insn)) < 0)
|
||||
/* It's the compiler's fault. */
|
||||
@ -5061,8 +4977,7 @@ failed_reload (insn, r)
|
||||
for reload R. If it's valid, get an rtx for it. Return nonzero if
|
||||
successful. */
|
||||
static int
|
||||
set_reload_reg (i, r)
|
||||
int i, r;
|
||||
set_reload_reg (int i, int r)
|
||||
{
|
||||
int regno;
|
||||
rtx reg = spill_reg_rtx[i];
|
||||
@ -5117,10 +5032,8 @@ set_reload_reg (i, r)
|
||||
we didn't change anything. */
|
||||
|
||||
static int
|
||||
allocate_reload_reg (chain, r, last_reload)
|
||||
struct insn_chain *chain ATTRIBUTE_UNUSED;
|
||||
int r;
|
||||
int last_reload;
|
||||
allocate_reload_reg (struct insn_chain *chain ATTRIBUTE_UNUSED, int r,
|
||||
int last_reload)
|
||||
{
|
||||
int i, pass, count;
|
||||
|
||||
@ -5241,9 +5154,7 @@ allocate_reload_reg (chain, r, last_reload)
|
||||
is the array we use to restore the reg_rtx field for every reload. */
|
||||
|
||||
static void
|
||||
choose_reload_regs_init (chain, save_reload_reg_rtx)
|
||||
struct insn_chain *chain;
|
||||
rtx *save_reload_reg_rtx;
|
||||
choose_reload_regs_init (struct insn_chain *chain, rtx *save_reload_reg_rtx)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -5302,8 +5213,7 @@ choose_reload_regs_init (chain, save_reload_reg_rtx)
|
||||
finding a reload reg in the proper class. */
|
||||
|
||||
static void
|
||||
choose_reload_regs (chain)
|
||||
struct insn_chain *chain;
|
||||
choose_reload_regs (struct insn_chain *chain)
|
||||
{
|
||||
rtx insn = chain->insn;
|
||||
int i, j;
|
||||
@ -5676,7 +5586,7 @@ choose_reload_regs (chain)
|
||||
{
|
||||
regs_used |= TEST_HARD_REG_BIT (reload_reg_used_at_all,
|
||||
i);
|
||||
bad_for_class |= ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].class],
|
||||
bad_for_class |= ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].class],
|
||||
i);
|
||||
}
|
||||
|
||||
@ -5998,8 +5908,7 @@ choose_reload_regs (chain)
|
||||
remove_address_replacements. */
|
||||
|
||||
void
|
||||
deallocate_reload_reg (r)
|
||||
int r;
|
||||
deallocate_reload_reg (int r)
|
||||
{
|
||||
int regno;
|
||||
|
||||
@ -6027,8 +5936,7 @@ deallocate_reload_reg (r)
|
||||
prevent redundant code. */
|
||||
|
||||
static void
|
||||
merge_assigned_reloads (insn)
|
||||
rtx insn;
|
||||
merge_assigned_reloads (rtx insn)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
@ -6168,11 +6076,8 @@ static HARD_REG_SET reg_reloaded_died;
|
||||
has the number J. OLD contains the value to be used as input. */
|
||||
|
||||
static void
|
||||
emit_input_reload_insns (chain, rl, old, j)
|
||||
struct insn_chain *chain;
|
||||
struct reload *rl;
|
||||
rtx old;
|
||||
int j;
|
||||
emit_input_reload_insns (struct insn_chain *chain, struct reload *rl,
|
||||
rtx old, int j)
|
||||
{
|
||||
rtx insn = chain->insn;
|
||||
rtx reloadreg = rl->reg_rtx;
|
||||
@ -6659,10 +6564,8 @@ emit_input_reload_insns (chain, rl, old, j)
|
||||
/* Generate insns to for the output reload RL, which is for the insn described
|
||||
by CHAIN and has the number J. */
|
||||
static void
|
||||
emit_output_reload_insns (chain, rl, j)
|
||||
struct insn_chain *chain;
|
||||
struct reload *rl;
|
||||
int j;
|
||||
emit_output_reload_insns (struct insn_chain *chain, struct reload *rl,
|
||||
int j)
|
||||
{
|
||||
rtx reloadreg = rl->reg_rtx;
|
||||
rtx insn = chain->insn;
|
||||
@ -6873,10 +6776,7 @@ emit_output_reload_insns (chain, rl, j)
|
||||
/* Do input reloading for reload RL, which is for the insn described by CHAIN
|
||||
and has the number J. */
|
||||
static void
|
||||
do_input_reload (chain, rl, j)
|
||||
struct insn_chain *chain;
|
||||
struct reload *rl;
|
||||
int j;
|
||||
do_input_reload (struct insn_chain *chain, struct reload *rl, int j)
|
||||
{
|
||||
rtx insn = chain->insn;
|
||||
rtx old = (rl->in && GET_CODE (rl->in) == MEM
|
||||
@ -6931,10 +6831,7 @@ do_input_reload (chain, rl, j)
|
||||
??? At some point we need to support handling output reloads of
|
||||
JUMP_INSNs or insns that set cc0. */
|
||||
static void
|
||||
do_output_reload (chain, rl, j)
|
||||
struct insn_chain *chain;
|
||||
struct reload *rl;
|
||||
int j;
|
||||
do_output_reload (struct insn_chain *chain, struct reload *rl, int j)
|
||||
{
|
||||
rtx note, old;
|
||||
rtx insn = chain->insn;
|
||||
@ -7003,8 +6900,7 @@ do_output_reload (chain, rl, j)
|
||||
/* Output insns to reload values in and out of the chosen reload regs. */
|
||||
|
||||
static void
|
||||
emit_reload_insns (chain)
|
||||
struct insn_chain *chain;
|
||||
emit_reload_insns (struct insn_chain *chain)
|
||||
{
|
||||
rtx insn = chain->insn;
|
||||
|
||||
@ -7377,11 +7273,7 @@ emit_reload_insns (chain)
|
||||
Returns first insn emitted. */
|
||||
|
||||
rtx
|
||||
gen_reload (out, in, opnum, type)
|
||||
rtx out;
|
||||
rtx in;
|
||||
int opnum;
|
||||
enum reload_type type;
|
||||
gen_reload (rtx out, rtx in, int opnum, enum reload_type type)
|
||||
{
|
||||
rtx last = get_last_insn ();
|
||||
rtx tem;
|
||||
@ -7601,10 +7493,7 @@ gen_reload (out, in, opnum, type)
|
||||
certain that reload J doesn't use REG any longer for input. */
|
||||
|
||||
static void
|
||||
delete_output_reload (insn, j, last_reload_reg)
|
||||
rtx insn;
|
||||
int j;
|
||||
int last_reload_reg;
|
||||
delete_output_reload (rtx insn, int j, int last_reload_reg)
|
||||
{
|
||||
rtx output_reload_insn = spill_reg_store[last_reload_reg];
|
||||
rtx reg = spill_reg_stored_to[last_reload_reg];
|
||||
@ -7771,8 +7660,7 @@ delete_output_reload (insn, j, last_reload_reg)
|
||||
reload registers used in DEAD_INSN that are not used till CURRENT_INSN.
|
||||
CURRENT_INSN is being reloaded, so we have to check its reloads too. */
|
||||
static void
|
||||
delete_address_reloads (dead_insn, current_insn)
|
||||
rtx dead_insn, current_insn;
|
||||
delete_address_reloads (rtx dead_insn, rtx current_insn)
|
||||
{
|
||||
rtx set = single_set (dead_insn);
|
||||
rtx set2, dst, prev, next;
|
||||
@ -7808,8 +7696,7 @@ delete_address_reloads (dead_insn, current_insn)
|
||||
|
||||
/* Subfunction of delete_address_reloads: process registers found in X. */
|
||||
static void
|
||||
delete_address_reloads_1 (dead_insn, x, current_insn)
|
||||
rtx dead_insn, x, current_insn;
|
||||
delete_address_reloads_1 (rtx dead_insn, rtx x, rtx current_insn)
|
||||
{
|
||||
rtx prev, set, dst, i2;
|
||||
int i, j;
|
||||
@ -7927,10 +7814,7 @@ delete_address_reloads_1 (dead_insn, x, current_insn)
|
||||
Return the instruction that stores into RELOADREG. */
|
||||
|
||||
static rtx
|
||||
inc_for_reload (reloadreg, in, value, inc_amount)
|
||||
rtx reloadreg;
|
||||
rtx in, value;
|
||||
int inc_amount;
|
||||
inc_for_reload (rtx reloadreg, rtx in, rtx value, int inc_amount)
|
||||
{
|
||||
/* REG or MEM to be copied and incremented. */
|
||||
rtx incloc = XEXP (value, 0);
|
||||
@ -8021,9 +7905,7 @@ inc_for_reload (reloadreg, in, value, inc_amount)
|
||||
|
||||
#ifdef AUTO_INC_DEC
|
||||
static void
|
||||
add_auto_inc_notes (insn, x)
|
||||
rtx insn;
|
||||
rtx x;
|
||||
add_auto_inc_notes (rtx insn, rtx x)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
const char *fmt;
|
||||
@ -8051,9 +7933,7 @@ add_auto_inc_notes (insn, x)
|
||||
|
||||
/* Copy EH notes from an insn to its reloads. */
|
||||
static void
|
||||
copy_eh_notes (insn, x)
|
||||
rtx insn;
|
||||
rtx x;
|
||||
copy_eh_notes (rtx insn, rtx x)
|
||||
{
|
||||
rtx eh_note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
|
||||
if (eh_note)
|
||||
@ -8075,7 +7955,7 @@ copy_eh_notes (insn, x)
|
||||
|
||||
Similar handle instructions throwing exceptions internally. */
|
||||
void
|
||||
fixup_abnormal_edges ()
|
||||
fixup_abnormal_edges (void)
|
||||
{
|
||||
bool inserted = false;
|
||||
basic_block bb;
|
||||
|
254
gcc/reorg.c
254
gcc/reorg.c
@ -1,6 +1,6 @@
|
||||
/* Perform instruction reorganizations for delay slot filling.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu).
|
||||
Hacked by Michael Tiemann (tiemann@cygnus.com).
|
||||
|
||||
@ -177,53 +177,52 @@ static int *uid_to_ruid;
|
||||
/* Highest valid index in `uid_to_ruid'. */
|
||||
static int max_uid;
|
||||
|
||||
static int stop_search_p PARAMS ((rtx, int));
|
||||
static int resource_conflicts_p PARAMS ((struct resources *,
|
||||
struct resources *));
|
||||
static int insn_references_resource_p PARAMS ((rtx, struct resources *, int));
|
||||
static int insn_sets_resource_p PARAMS ((rtx, struct resources *, int));
|
||||
static rtx find_end_label PARAMS ((void));
|
||||
static rtx emit_delay_sequence PARAMS ((rtx, rtx, int));
|
||||
static rtx add_to_delay_list PARAMS ((rtx, rtx));
|
||||
static rtx delete_from_delay_slot PARAMS ((rtx));
|
||||
static void delete_scheduled_jump PARAMS ((rtx));
|
||||
static void note_delay_statistics PARAMS ((int, int));
|
||||
static int stop_search_p (rtx, int);
|
||||
static int resource_conflicts_p (struct resources *, struct resources *);
|
||||
static int insn_references_resource_p (rtx, struct resources *, int);
|
||||
static int insn_sets_resource_p (rtx, struct resources *, int);
|
||||
static rtx find_end_label (void);
|
||||
static rtx emit_delay_sequence (rtx, rtx, int);
|
||||
static rtx add_to_delay_list (rtx, rtx);
|
||||
static rtx delete_from_delay_slot (rtx);
|
||||
static void delete_scheduled_jump (rtx);
|
||||
static void note_delay_statistics (int, int);
|
||||
#if defined(ANNUL_IFFALSE_SLOTS) || defined(ANNUL_IFTRUE_SLOTS)
|
||||
static rtx optimize_skip PARAMS ((rtx));
|
||||
static rtx optimize_skip (rtx);
|
||||
#endif
|
||||
static int get_jump_flags PARAMS ((rtx, rtx));
|
||||
static int rare_destination PARAMS ((rtx));
|
||||
static int mostly_true_jump PARAMS ((rtx, rtx));
|
||||
static rtx get_branch_condition PARAMS ((rtx, rtx));
|
||||
static int condition_dominates_p PARAMS ((rtx, rtx));
|
||||
static int redirect_with_delay_slots_safe_p PARAMS ((rtx, rtx, rtx));
|
||||
static int redirect_with_delay_list_safe_p PARAMS ((rtx, rtx, rtx));
|
||||
static int check_annul_list_true_false PARAMS ((int, rtx));
|
||||
static rtx steal_delay_list_from_target PARAMS ((rtx, rtx, rtx, rtx,
|
||||
struct resources *,
|
||||
struct resources *,
|
||||
struct resources *,
|
||||
int, int *, int *, rtx *));
|
||||
static rtx steal_delay_list_from_fallthrough PARAMS ((rtx, rtx, rtx, rtx,
|
||||
struct resources *,
|
||||
struct resources *,
|
||||
struct resources *,
|
||||
int, int *, int *));
|
||||
static void try_merge_delay_insns PARAMS ((rtx, rtx));
|
||||
static rtx redundant_insn PARAMS ((rtx, rtx, rtx));
|
||||
static int own_thread_p PARAMS ((rtx, rtx, int));
|
||||
static void update_block PARAMS ((rtx, rtx));
|
||||
static int reorg_redirect_jump PARAMS ((rtx, rtx));
|
||||
static void update_reg_dead_notes PARAMS ((rtx, rtx));
|
||||
static void fix_reg_dead_note PARAMS ((rtx, rtx));
|
||||
static void update_reg_unused_notes PARAMS ((rtx, rtx));
|
||||
static void fill_simple_delay_slots PARAMS ((int));
|
||||
static rtx fill_slots_from_thread PARAMS ((rtx, rtx, rtx, rtx, int, int,
|
||||
int, int, int *, rtx));
|
||||
static void fill_eager_delay_slots PARAMS ((void));
|
||||
static void relax_delay_slots PARAMS ((rtx));
|
||||
static int get_jump_flags (rtx, rtx);
|
||||
static int rare_destination (rtx);
|
||||
static int mostly_true_jump (rtx, rtx);
|
||||
static rtx get_branch_condition (rtx, rtx);
|
||||
static int condition_dominates_p (rtx, rtx);
|
||||
static int redirect_with_delay_slots_safe_p (rtx, rtx, rtx);
|
||||
static int redirect_with_delay_list_safe_p (rtx, rtx, rtx);
|
||||
static int check_annul_list_true_false (int, rtx);
|
||||
static rtx steal_delay_list_from_target (rtx, rtx, rtx, rtx,
|
||||
struct resources *,
|
||||
struct resources *,
|
||||
struct resources *,
|
||||
int, int *, int *, rtx *);
|
||||
static rtx steal_delay_list_from_fallthrough (rtx, rtx, rtx, rtx,
|
||||
struct resources *,
|
||||
struct resources *,
|
||||
struct resources *,
|
||||
int, int *, int *);
|
||||
static void try_merge_delay_insns (rtx, rtx);
|
||||
static rtx redundant_insn (rtx, rtx, rtx);
|
||||
static int own_thread_p (rtx, rtx, int);
|
||||
static void update_block (rtx, rtx);
|
||||
static int reorg_redirect_jump (rtx, rtx);
|
||||
static void update_reg_dead_notes (rtx, rtx);
|
||||
static void fix_reg_dead_note (rtx, rtx);
|
||||
static void update_reg_unused_notes (rtx, rtx);
|
||||
static void fill_simple_delay_slots (int);
|
||||
static rtx fill_slots_from_thread (rtx, rtx, rtx, rtx, int, int, int, int,
|
||||
int *, rtx);
|
||||
static void fill_eager_delay_slots (void);
|
||||
static void relax_delay_slots (rtx);
|
||||
#ifdef HAVE_return
|
||||
static void make_return_insns PARAMS ((rtx));
|
||||
static void make_return_insns (rtx);
|
||||
#endif
|
||||
|
||||
/* Return TRUE if this insn should stop the search for insn to fill delay
|
||||
@ -231,9 +230,7 @@ static void make_return_insns PARAMS ((rtx));
|
||||
In all cases, jumps terminate the search. */
|
||||
|
||||
static int
|
||||
stop_search_p (insn, labels_p)
|
||||
rtx insn;
|
||||
int labels_p;
|
||||
stop_search_p (rtx insn, int labels_p)
|
||||
{
|
||||
if (insn == 0)
|
||||
return 1;
|
||||
@ -267,8 +264,7 @@ stop_search_p (insn, labels_p)
|
||||
resource set contains a volatile memory reference. Otherwise, return FALSE. */
|
||||
|
||||
static int
|
||||
resource_conflicts_p (res1, res2)
|
||||
struct resources *res1, *res2;
|
||||
resource_conflicts_p (struct resources *res1, struct resources *res2)
|
||||
{
|
||||
if ((res1->cc && res2->cc) || (res1->memory && res2->memory)
|
||||
|| (res1->unch_memory && res2->unch_memory)
|
||||
@ -299,10 +295,8 @@ resource_conflicts_p (res1, res2)
|
||||
a large block of complex code. */
|
||||
|
||||
static int
|
||||
insn_references_resource_p (insn, res, include_delayed_effects)
|
||||
rtx insn;
|
||||
struct resources *res;
|
||||
int include_delayed_effects;
|
||||
insn_references_resource_p (rtx insn, struct resources *res,
|
||||
int include_delayed_effects)
|
||||
{
|
||||
struct resources insn_res;
|
||||
|
||||
@ -317,10 +311,8 @@ insn_references_resource_p (insn, res, include_delayed_effects)
|
||||
in front of mark_set_resources for details. */
|
||||
|
||||
static int
|
||||
insn_sets_resource_p (insn, res, include_delayed_effects)
|
||||
rtx insn;
|
||||
struct resources *res;
|
||||
int include_delayed_effects;
|
||||
insn_sets_resource_p (rtx insn, struct resources *res,
|
||||
int include_delayed_effects)
|
||||
{
|
||||
struct resources insn_sets;
|
||||
|
||||
@ -333,7 +325,7 @@ insn_sets_resource_p (insn, res, include_delayed_effects)
|
||||
none, make one. */
|
||||
|
||||
static rtx
|
||||
find_end_label ()
|
||||
find_end_label (void)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -430,10 +422,7 @@ find_end_label ()
|
||||
Returns the SEQUENCE that replaces INSN. */
|
||||
|
||||
static rtx
|
||||
emit_delay_sequence (insn, list, length)
|
||||
rtx insn;
|
||||
rtx list;
|
||||
int length;
|
||||
emit_delay_sequence (rtx insn, rtx list, int length)
|
||||
{
|
||||
int i = 1;
|
||||
rtx li;
|
||||
@ -556,9 +545,7 @@ emit_delay_sequence (insn, list, length)
|
||||
be in the order in which the insns are to be executed. */
|
||||
|
||||
static rtx
|
||||
add_to_delay_list (insn, delay_list)
|
||||
rtx insn;
|
||||
rtx delay_list;
|
||||
add_to_delay_list (rtx insn, rtx delay_list)
|
||||
{
|
||||
/* If we have an empty list, just make a new list element. If
|
||||
INSN has its block number recorded, clear it since we may
|
||||
@ -581,8 +568,7 @@ add_to_delay_list (insn, delay_list)
|
||||
produce an insn with no delay slots. Return the new insn. */
|
||||
|
||||
static rtx
|
||||
delete_from_delay_slot (insn)
|
||||
rtx insn;
|
||||
delete_from_delay_slot (rtx insn)
|
||||
{
|
||||
rtx trial, seq_insn, seq, prev;
|
||||
rtx delay_list = 0;
|
||||
@ -639,8 +625,7 @@ delete_from_delay_slot (insn)
|
||||
the insn that sets CC0 for it and delete it too. */
|
||||
|
||||
static void
|
||||
delete_scheduled_jump (insn)
|
||||
rtx insn;
|
||||
delete_scheduled_jump (rtx insn)
|
||||
{
|
||||
/* Delete the insn that sets cc0 for us. On machines without cc0, we could
|
||||
delete the insn that sets the condition code, but it is hard to find it.
|
||||
@ -697,8 +682,7 @@ static int num_filled_delays[NUM_REORG_FUNCTIONS][MAX_DELAY_HISTOGRAM+1][MAX_REO
|
||||
static int reorg_pass_number;
|
||||
|
||||
static void
|
||||
note_delay_statistics (slots_filled, index)
|
||||
int slots_filled, index;
|
||||
note_delay_statistics (int slots_filled, int index)
|
||||
{
|
||||
num_insns_needing_delays[index][reorg_pass_number]++;
|
||||
if (slots_filled > MAX_DELAY_HISTOGRAM)
|
||||
@ -741,8 +725,7 @@ note_delay_statistics (slots_filled, index)
|
||||
of delay slots required. */
|
||||
|
||||
static rtx
|
||||
optimize_skip (insn)
|
||||
rtx insn;
|
||||
optimize_skip (rtx insn)
|
||||
{
|
||||
rtx trial = next_nonnote_insn (insn);
|
||||
rtx next_trial = next_active_insn (trial);
|
||||
@ -823,8 +806,7 @@ optimize_skip (insn)
|
||||
are predicted as very likely taken. */
|
||||
|
||||
static int
|
||||
get_jump_flags (insn, label)
|
||||
rtx insn, label;
|
||||
get_jump_flags (rtx insn, rtx label)
|
||||
{
|
||||
int flags;
|
||||
|
||||
@ -887,8 +869,7 @@ get_jump_flags (insn, label)
|
||||
return 0. */
|
||||
|
||||
static int
|
||||
rare_destination (insn)
|
||||
rtx insn;
|
||||
rare_destination (rtx insn)
|
||||
{
|
||||
int jump_count = 0;
|
||||
rtx next;
|
||||
@ -939,8 +920,7 @@ rare_destination (insn)
|
||||
CONDITION, if nonzero, is the condition that JUMP_INSN is testing. */
|
||||
|
||||
static int
|
||||
mostly_true_jump (jump_insn, condition)
|
||||
rtx jump_insn, condition;
|
||||
mostly_true_jump (rtx jump_insn, rtx condition)
|
||||
{
|
||||
rtx target_label = JUMP_LABEL (jump_insn);
|
||||
rtx insn, note;
|
||||
@ -1062,9 +1042,7 @@ mostly_true_jump (jump_insn, condition)
|
||||
type of jump, or it doesn't go to TARGET, return 0. */
|
||||
|
||||
static rtx
|
||||
get_branch_condition (insn, target)
|
||||
rtx insn;
|
||||
rtx target;
|
||||
get_branch_condition (rtx insn, rtx target)
|
||||
{
|
||||
rtx pat = PATTERN (insn);
|
||||
rtx src;
|
||||
@ -1110,9 +1088,7 @@ get_branch_condition (insn, target)
|
||||
INSN, i.e., if INSN will always branch if CONDITION is true. */
|
||||
|
||||
static int
|
||||
condition_dominates_p (condition, insn)
|
||||
rtx condition;
|
||||
rtx insn;
|
||||
condition_dominates_p (rtx condition, rtx insn)
|
||||
{
|
||||
rtx other_condition = get_branch_condition (insn, JUMP_LABEL (insn));
|
||||
enum rtx_code code = GET_CODE (condition);
|
||||
@ -1138,8 +1114,7 @@ condition_dominates_p (condition, insn)
|
||||
any insns already in the delay slot of JUMP. */
|
||||
|
||||
static int
|
||||
redirect_with_delay_slots_safe_p (jump, newlabel, seq)
|
||||
rtx jump, newlabel, seq;
|
||||
redirect_with_delay_slots_safe_p (rtx jump, rtx newlabel, rtx seq)
|
||||
{
|
||||
int flags, i;
|
||||
rtx pat = PATTERN (seq);
|
||||
@ -1173,8 +1148,7 @@ redirect_with_delay_slots_safe_p (jump, newlabel, seq)
|
||||
any insns we wish to place in the delay slot of JUMP. */
|
||||
|
||||
static int
|
||||
redirect_with_delay_list_safe_p (jump, newlabel, delay_list)
|
||||
rtx jump, newlabel, delay_list;
|
||||
redirect_with_delay_list_safe_p (rtx jump, rtx newlabel, rtx delay_list)
|
||||
{
|
||||
int flags, i;
|
||||
rtx li;
|
||||
@ -1207,9 +1181,7 @@ redirect_with_delay_list_safe_p (jump, newlabel, delay_list)
|
||||
If not, return 0; otherwise return 1. */
|
||||
|
||||
static int
|
||||
check_annul_list_true_false (annul_true_p, delay_list)
|
||||
int annul_true_p;
|
||||
rtx delay_list;
|
||||
check_annul_list_true_false (int annul_true_p, rtx delay_list)
|
||||
{
|
||||
rtx temp;
|
||||
|
||||
@ -1249,18 +1221,12 @@ check_annul_list_true_false (annul_true_p, delay_list)
|
||||
execution should continue. */
|
||||
|
||||
static rtx
|
||||
steal_delay_list_from_target (insn, condition, seq, delay_list,
|
||||
sets, needed, other_needed,
|
||||
slots_to_fill, pslots_filled, pannul_p,
|
||||
pnew_thread)
|
||||
rtx insn, condition;
|
||||
rtx seq;
|
||||
rtx delay_list;
|
||||
struct resources *sets, *needed, *other_needed;
|
||||
int slots_to_fill;
|
||||
int *pslots_filled;
|
||||
int *pannul_p;
|
||||
rtx *pnew_thread;
|
||||
steal_delay_list_from_target (rtx insn, rtx condition, rtx seq,
|
||||
rtx delay_list, struct resources *sets,
|
||||
struct resources *needed,
|
||||
struct resources *other_needed,
|
||||
int slots_to_fill, int *pslots_filled,
|
||||
int *pannul_p, rtx *pnew_thread)
|
||||
{
|
||||
rtx temp;
|
||||
int slots_remaining = slots_to_fill - *pslots_filled;
|
||||
@ -1388,16 +1354,12 @@ steal_delay_list_from_target (insn, condition, seq, delay_list,
|
||||
for INSN since unconditional branches are much easier to fill. */
|
||||
|
||||
static rtx
|
||||
steal_delay_list_from_fallthrough (insn, condition, seq,
|
||||
delay_list, sets, needed, other_needed,
|
||||
slots_to_fill, pslots_filled, pannul_p)
|
||||
rtx insn, condition;
|
||||
rtx seq;
|
||||
rtx delay_list;
|
||||
struct resources *sets, *needed, *other_needed;
|
||||
int slots_to_fill;
|
||||
int *pslots_filled;
|
||||
int *pannul_p;
|
||||
steal_delay_list_from_fallthrough (rtx insn, rtx condition, rtx seq,
|
||||
rtx delay_list, struct resources *sets,
|
||||
struct resources *needed,
|
||||
struct resources *other_needed,
|
||||
int slots_to_fill, int *pslots_filled,
|
||||
int *pannul_p)
|
||||
{
|
||||
int i;
|
||||
int flags;
|
||||
@ -1472,8 +1434,7 @@ steal_delay_list_from_fallthrough (insn, condition, seq,
|
||||
we delete the merged insn. */
|
||||
|
||||
static void
|
||||
try_merge_delay_insns (insn, thread)
|
||||
rtx insn, thread;
|
||||
try_merge_delay_insns (rtx insn, rtx thread)
|
||||
{
|
||||
rtx trial, next_trial;
|
||||
rtx delay_insn = XVECEXP (PATTERN (insn), 0, 0);
|
||||
@ -1663,10 +1624,7 @@ try_merge_delay_insns (insn, thread)
|
||||
gain in rare cases. */
|
||||
|
||||
static rtx
|
||||
redundant_insn (insn, target, delay_list)
|
||||
rtx insn;
|
||||
rtx target;
|
||||
rtx delay_list;
|
||||
redundant_insn (rtx insn, rtx target, rtx delay_list)
|
||||
{
|
||||
rtx target_main = target;
|
||||
rtx ipat = PATTERN (insn);
|
||||
@ -1873,10 +1831,7 @@ redundant_insn (insn, target, delay_list)
|
||||
finding an active insn, we do not own this thread. */
|
||||
|
||||
static int
|
||||
own_thread_p (thread, label, allow_fallthrough)
|
||||
rtx thread;
|
||||
rtx label;
|
||||
int allow_fallthrough;
|
||||
own_thread_p (rtx thread, rtx label, int allow_fallthrough)
|
||||
{
|
||||
rtx active_insn;
|
||||
rtx insn;
|
||||
@ -1920,9 +1875,7 @@ own_thread_p (thread, label, allow_fallthrough)
|
||||
BARRIER in relax_delay_slots. */
|
||||
|
||||
static void
|
||||
update_block (insn, where)
|
||||
rtx insn;
|
||||
rtx where;
|
||||
update_block (rtx insn, rtx where)
|
||||
{
|
||||
/* Ignore if this was in a delay slot and it came from the target of
|
||||
a branch. */
|
||||
@ -1941,9 +1894,7 @@ update_block (insn, where)
|
||||
the basic block containing the jump. */
|
||||
|
||||
static int
|
||||
reorg_redirect_jump (jump, nlabel)
|
||||
rtx jump;
|
||||
rtx nlabel;
|
||||
reorg_redirect_jump (rtx jump, rtx nlabel)
|
||||
{
|
||||
incr_ticks_for_insn (jump);
|
||||
return redirect_jump (jump, nlabel, 1);
|
||||
@ -1961,8 +1912,7 @@ reorg_redirect_jump (jump, nlabel)
|
||||
is dead because it sees a REG_DEAD note immediately before a CODE_LABEL. */
|
||||
|
||||
static void
|
||||
update_reg_dead_notes (insn, delayed_insn)
|
||||
rtx insn, delayed_insn;
|
||||
update_reg_dead_notes (rtx insn, rtx delayed_insn)
|
||||
{
|
||||
rtx p, link, next;
|
||||
|
||||
@ -1995,8 +1945,7 @@ update_reg_dead_notes (insn, delayed_insn)
|
||||
confused into thinking the register is dead. */
|
||||
|
||||
static void
|
||||
fix_reg_dead_note (start_insn, stop_insn)
|
||||
rtx start_insn, stop_insn;
|
||||
fix_reg_dead_note (rtx start_insn, rtx stop_insn)
|
||||
{
|
||||
rtx p, link, next;
|
||||
|
||||
@ -2026,8 +1975,7 @@ fix_reg_dead_note (start_insn, stop_insn)
|
||||
does. */
|
||||
|
||||
static void
|
||||
update_reg_unused_notes (insn, redundant_insn)
|
||||
rtx insn, redundant_insn;
|
||||
update_reg_unused_notes (rtx insn, rtx redundant_insn)
|
||||
{
|
||||
rtx link, next;
|
||||
|
||||
@ -2060,8 +2008,7 @@ update_reg_unused_notes (insn, redundant_insn)
|
||||
through FINAL_SEQUENCE. */
|
||||
|
||||
static void
|
||||
fill_simple_delay_slots (non_jumps_p)
|
||||
int non_jumps_p;
|
||||
fill_simple_delay_slots (int non_jumps_p)
|
||||
{
|
||||
rtx insn, pat, trial, next_trial;
|
||||
int i;
|
||||
@ -2564,17 +2511,10 @@ fill_simple_delay_slots (non_jumps_p)
|
||||
slot. We then adjust the jump to point after the insns we have taken. */
|
||||
|
||||
static rtx
|
||||
fill_slots_from_thread (insn, condition, thread, opposite_thread, likely,
|
||||
thread_if_true, own_thread,
|
||||
slots_to_fill, pslots_filled, delay_list)
|
||||
rtx insn;
|
||||
rtx condition;
|
||||
rtx thread, opposite_thread;
|
||||
int likely;
|
||||
int thread_if_true;
|
||||
int own_thread;
|
||||
int slots_to_fill, *pslots_filled;
|
||||
rtx delay_list;
|
||||
fill_slots_from_thread (rtx insn, rtx condition, rtx thread,
|
||||
rtx opposite_thread, int likely, int thread_if_true,
|
||||
int own_thread, int slots_to_fill,
|
||||
int *pslots_filled, rtx delay_list)
|
||||
{
|
||||
rtx new_thread;
|
||||
struct resources opposite_needed, set, needed;
|
||||
@ -2991,7 +2931,7 @@ fill_slots_from_thread (insn, condition, thread, opposite_thread, likely,
|
||||
if safe. */
|
||||
|
||||
static void
|
||||
fill_eager_delay_slots ()
|
||||
fill_eager_delay_slots (void)
|
||||
{
|
||||
rtx insn;
|
||||
int i;
|
||||
@ -3018,7 +2958,7 @@ fill_eager_delay_slots ()
|
||||
delay slots only in certain circumstances which may depend on
|
||||
nearby insns (which change due to reorg's actions).
|
||||
|
||||
For example, the PA port normally has delay slots for unconditional
|
||||
For example, the PA port normally has delay slots for unconditional
|
||||
jumps.
|
||||
|
||||
However, the PA port claims such jumps do not have a delay slot
|
||||
@ -3119,8 +3059,7 @@ fill_eager_delay_slots ()
|
||||
threading. */
|
||||
|
||||
static void
|
||||
relax_delay_slots (first)
|
||||
rtx first;
|
||||
relax_delay_slots (rtx first)
|
||||
{
|
||||
rtx insn, next, pat;
|
||||
rtx trial, delay_insn, target_label;
|
||||
@ -3485,8 +3424,7 @@ relax_delay_slots (first)
|
||||
RETURN as well. */
|
||||
|
||||
static void
|
||||
make_return_insns (first)
|
||||
rtx first;
|
||||
make_return_insns (rtx first)
|
||||
{
|
||||
rtx insn, jump_insn, pat;
|
||||
rtx real_return_label = end_of_function_label;
|
||||
@ -3617,9 +3555,7 @@ make_return_insns (first)
|
||||
/* Try to find insns to place in delay slots. */
|
||||
|
||||
void
|
||||
dbr_schedule (first, file)
|
||||
rtx first;
|
||||
FILE *file;
|
||||
dbr_schedule (rtx first, FILE *file)
|
||||
{
|
||||
rtx insn, next, epilogue_insn = 0;
|
||||
int i;
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* Definitions for computing resource usage of specific insns.
|
||||
Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000, 2001, 2002, 2003
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -78,21 +79,18 @@ static HARD_REG_SET current_live_regs;
|
||||
|
||||
static HARD_REG_SET pending_dead_regs;
|
||||
|
||||
static void update_live_status PARAMS ((rtx, rtx, void *));
|
||||
static int find_basic_block PARAMS ((rtx, int));
|
||||
static rtx next_insn_no_annul PARAMS ((rtx));
|
||||
static rtx find_dead_or_set_registers PARAMS ((rtx, struct resources*,
|
||||
rtx*, int, struct resources,
|
||||
struct resources));
|
||||
static void update_live_status (rtx, rtx, void *);
|
||||
static int find_basic_block (rtx, int);
|
||||
static rtx next_insn_no_annul (rtx);
|
||||
static rtx find_dead_or_set_registers (rtx, struct resources*,
|
||||
rtx*, int, struct resources,
|
||||
struct resources);
|
||||
|
||||
/* Utility function called from mark_target_live_regs via note_stores.
|
||||
It deadens any CLOBBERed registers and livens any SET registers. */
|
||||
|
||||
static void
|
||||
update_live_status (dest, x, data)
|
||||
rtx dest;
|
||||
rtx x;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
update_live_status (rtx dest, rtx x, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int first_regno, last_regno;
|
||||
int i;
|
||||
@ -131,9 +129,7 @@ update_live_status (dest, x, data)
|
||||
correct. */
|
||||
|
||||
static int
|
||||
find_basic_block (insn, search_limit)
|
||||
rtx insn;
|
||||
int search_limit;
|
||||
find_basic_block (rtx insn, int search_limit)
|
||||
{
|
||||
basic_block bb;
|
||||
|
||||
@ -170,8 +166,7 @@ find_basic_block (insn, search_limit)
|
||||
an annulled branch. */
|
||||
|
||||
static rtx
|
||||
next_insn_no_annul (insn)
|
||||
rtx insn;
|
||||
next_insn_no_annul (rtx insn)
|
||||
{
|
||||
if (insn)
|
||||
{
|
||||
@ -210,10 +205,8 @@ next_insn_no_annul (insn)
|
||||
CALL_INSNs. */
|
||||
|
||||
void
|
||||
mark_referenced_resources (x, res, include_delayed_effects)
|
||||
rtx x;
|
||||
struct resources *res;
|
||||
int include_delayed_effects;
|
||||
mark_referenced_resources (rtx x, struct resources *res,
|
||||
int include_delayed_effects)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
int i, j;
|
||||
@ -443,12 +436,9 @@ mark_referenced_resources (x, res, include_delayed_effects)
|
||||
number of unconditional branches. */
|
||||
|
||||
static rtx
|
||||
find_dead_or_set_registers (target, res, jump_target, jump_count, set, needed)
|
||||
rtx target;
|
||||
struct resources *res;
|
||||
rtx *jump_target;
|
||||
int jump_count;
|
||||
struct resources set, needed;
|
||||
find_dead_or_set_registers (rtx target, struct resources *res,
|
||||
rtx *jump_target, int jump_count,
|
||||
struct resources set, struct resources needed)
|
||||
{
|
||||
HARD_REG_SET scratch;
|
||||
rtx insn, next;
|
||||
@ -638,11 +628,8 @@ find_dead_or_set_registers (target, res, jump_target, jump_count, set, needed)
|
||||
our computation and thus may be placed in a delay slot. */
|
||||
|
||||
void
|
||||
mark_set_resources (x, res, in_dest, mark_type)
|
||||
rtx x;
|
||||
struct resources *res;
|
||||
int in_dest;
|
||||
enum mark_resource_type mark_type;
|
||||
mark_set_resources (rtx x, struct resources *res, int in_dest,
|
||||
enum mark_resource_type mark_type)
|
||||
{
|
||||
enum rtx_code code;
|
||||
int i, j;
|
||||
@ -902,10 +889,7 @@ mark_set_resources (x, res, in_dest, mark_type)
|
||||
init_resource_info () was invoked before we are called. */
|
||||
|
||||
void
|
||||
mark_target_live_regs (insns, target, res)
|
||||
rtx insns;
|
||||
rtx target;
|
||||
struct resources *res;
|
||||
mark_target_live_regs (rtx insns, rtx target, struct resources *res)
|
||||
{
|
||||
int b = -1;
|
||||
unsigned int i;
|
||||
@ -1172,8 +1156,7 @@ mark_target_live_regs (insns, target, res)
|
||||
This should be invoked before the first call to mark_target_live_regs. */
|
||||
|
||||
void
|
||||
init_resource_info (epilogue_insn)
|
||||
rtx epilogue_insn;
|
||||
init_resource_info (rtx epilogue_insn)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1249,7 +1232,7 @@ init_resource_info (epilogue_insn)
|
||||
should be invoked after the last call to mark_target_live_regs (). */
|
||||
|
||||
void
|
||||
free_resource_info ()
|
||||
free_resource_info (void)
|
||||
{
|
||||
if (target_hash_table != NULL)
|
||||
{
|
||||
@ -1281,8 +1264,7 @@ free_resource_info ()
|
||||
/* Clear any hashed information that we have stored for INSN. */
|
||||
|
||||
void
|
||||
clear_hashed_info_for_insn (insn)
|
||||
rtx insn;
|
||||
clear_hashed_info_for_insn (rtx insn)
|
||||
{
|
||||
struct target_info *tinfo;
|
||||
|
||||
@ -1301,8 +1283,7 @@ clear_hashed_info_for_insn (insn)
|
||||
/* Increment the tick count for the basic block that contains INSN. */
|
||||
|
||||
void
|
||||
incr_ticks_for_insn (insn)
|
||||
rtx insn;
|
||||
incr_ticks_for_insn (rtx insn)
|
||||
{
|
||||
int b = find_basic_block (insn, MAX_DELAY_SLOT_LIVE_SEARCH);
|
||||
|
||||
@ -1313,9 +1294,7 @@ incr_ticks_for_insn (insn)
|
||||
/* Add TRIAL to the set of resources used at the end of the current
|
||||
function. */
|
||||
void
|
||||
mark_end_of_function_resources (trial, include_delayed_effects)
|
||||
rtx trial;
|
||||
int include_delayed_effects;
|
||||
mark_end_of_function_resources (rtx trial, int include_delayed_effects)
|
||||
{
|
||||
mark_referenced_resources (trial, &end_of_function_needs,
|
||||
include_delayed_effects);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for computing resource usage of specific insns.
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -41,12 +41,12 @@ enum mark_resource_type
|
||||
MARK_DEST = 2
|
||||
};
|
||||
|
||||
extern void mark_target_live_regs PARAMS ((rtx, rtx, struct resources *));
|
||||
extern void mark_set_resources PARAMS ((rtx, struct resources *, int,
|
||||
enum mark_resource_type));
|
||||
extern void mark_referenced_resources PARAMS ((rtx, struct resources *, int));
|
||||
extern void clear_hashed_info_for_insn PARAMS ((rtx));
|
||||
extern void incr_ticks_for_insn PARAMS ((rtx));
|
||||
extern void mark_end_of_function_resources PARAMS ((rtx, int));
|
||||
extern void init_resource_info PARAMS ((rtx));
|
||||
extern void free_resource_info PARAMS ((void));
|
||||
extern void mark_target_live_regs (rtx, rtx, struct resources *);
|
||||
extern void mark_set_resources (rtx, struct resources *, int,
|
||||
enum mark_resource_type);
|
||||
extern void mark_referenced_resources (rtx, struct resources *, int);
|
||||
extern void clear_hashed_info_for_insn (rtx);
|
||||
extern void incr_ticks_for_insn (rtx);
|
||||
extern void mark_end_of_function_resources (rtx, int);
|
||||
extern void init_resource_info (rtx);
|
||||
extern void free_resource_info (void);
|
||||
|
@ -33,19 +33,17 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "intl.h"
|
||||
#include "diagnostic.h"
|
||||
|
||||
static location_t location_for_asm PARAMS ((rtx));
|
||||
static void diagnostic_for_asm PARAMS ((rtx, const char *, va_list *,
|
||||
diagnostic_t));
|
||||
static location_t location_for_asm (rtx);
|
||||
static void diagnostic_for_asm (rtx, const char *, va_list *, diagnostic_t);
|
||||
|
||||
/* Figure the location of the given INSN. */
|
||||
static location_t
|
||||
location_for_asm (insn)
|
||||
rtx insn;
|
||||
location_for_asm (rtx insn)
|
||||
{
|
||||
rtx body = PATTERN (insn);
|
||||
rtx asmop;
|
||||
location_t loc;
|
||||
|
||||
|
||||
/* Find the (or one of the) ASM_OPERANDS in the insn. */
|
||||
if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
|
||||
asmop = SET_SRC (body);
|
||||
@ -74,14 +72,11 @@ location_for_asm (insn)
|
||||
of the insn INSN. This is used only when INSN is an `asm' with operands,
|
||||
and each ASM_OPERANDS records its own source file and line. */
|
||||
static void
|
||||
diagnostic_for_asm (insn, msg, args_ptr, kind)
|
||||
rtx insn;
|
||||
const char *msg;
|
||||
va_list *args_ptr;
|
||||
diagnostic_t kind;
|
||||
diagnostic_for_asm (rtx insn, const char *msg, va_list *args_ptr,
|
||||
diagnostic_t kind)
|
||||
{
|
||||
diagnostic_info diagnostic;
|
||||
|
||||
|
||||
diagnostic_set_info (&diagnostic, msg, args_ptr,
|
||||
location_for_asm (insn), kind);
|
||||
report_diagnostic (&diagnostic);
|
||||
@ -91,7 +86,7 @@ void
|
||||
error_for_asm (rtx insn, const char *msgid, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
||||
va_start (ap, msgid);
|
||||
diagnostic_for_asm (insn, msgid, &ap, DK_ERROR);
|
||||
va_end (ap);
|
||||
@ -101,19 +96,15 @@ void
|
||||
warning_for_asm (rtx insn, const char *msgid, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
|
||||
va_start (ap, msgid);
|
||||
diagnostic_for_asm (insn, msgid, &ap, DK_WARNING);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
void
|
||||
_fatal_insn (msgid, insn, file, line, function)
|
||||
const char *msgid;
|
||||
rtx insn;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *function;
|
||||
_fatal_insn (const char *msgid, rtx insn, const char *file, int line,
|
||||
const char *function)
|
||||
{
|
||||
error ("%s", _(msgid));
|
||||
|
||||
@ -126,11 +117,8 @@ _fatal_insn (msgid, insn, file, line, function)
|
||||
}
|
||||
|
||||
void
|
||||
_fatal_insn_not_found (insn, file, line, function)
|
||||
rtx insn;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *function;
|
||||
_fatal_insn_not_found (rtx insn, const char *file, int line,
|
||||
const char *function)
|
||||
{
|
||||
if (INSN_CODE (insn) < 0)
|
||||
_fatal_insn ("unrecognizable insn:", insn, file, line, function);
|
||||
@ -138,4 +126,3 @@ _fatal_insn_not_found (insn, file, line, function)
|
||||
_fatal_insn ("insn does not satisfy its constraints:",
|
||||
insn, file, line, function);
|
||||
}
|
||||
|
||||
|
74
gcc/rtl.c
74
gcc/rtl.c
@ -240,8 +240,7 @@ const char * const reg_note_name[] =
|
||||
Store the length, and initialize all elements to zero. */
|
||||
|
||||
rtvec
|
||||
rtvec_alloc (n)
|
||||
int n;
|
||||
rtvec_alloc (int n)
|
||||
{
|
||||
rtvec rt;
|
||||
|
||||
@ -257,8 +256,7 @@ rtvec_alloc (n)
|
||||
all the rest is initialized to zero. */
|
||||
|
||||
rtx
|
||||
rtx_alloc (code)
|
||||
RTX_CODE code;
|
||||
rtx_alloc (RTX_CODE code)
|
||||
{
|
||||
rtx rt;
|
||||
int n = GET_RTX_LENGTH (code);
|
||||
@ -280,8 +278,7 @@ rtx_alloc (code)
|
||||
except for those few rtx codes that are sharable. */
|
||||
|
||||
rtx
|
||||
copy_rtx (orig)
|
||||
rtx orig;
|
||||
copy_rtx (rtx orig)
|
||||
{
|
||||
rtx copy;
|
||||
int i, j;
|
||||
@ -386,8 +383,7 @@ copy_rtx (orig)
|
||||
/* Create a new copy of an rtx. Only copy just one level. */
|
||||
|
||||
rtx
|
||||
shallow_copy_rtx (orig)
|
||||
rtx orig;
|
||||
shallow_copy_rtx (rtx orig)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (orig);
|
||||
size_t n = GET_RTX_LENGTH (code);
|
||||
@ -409,8 +405,7 @@ int generating_concat_p;
|
||||
This is the Lisp function EQUAL for rtx arguments. */
|
||||
|
||||
int
|
||||
rtx_equal_p (x, y)
|
||||
rtx x, y;
|
||||
rtx_equal_p (rtx x, rtx y)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
@ -526,12 +521,8 @@ rtx_equal_p (x, y)
|
||||
|
||||
#if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
|
||||
void
|
||||
rtl_check_failed_bounds (r, n, file, line, func)
|
||||
rtx r;
|
||||
int n;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *func;
|
||||
rtl_check_failed_bounds (rtx r, int n, const char *file, int line,
|
||||
const char *func)
|
||||
{
|
||||
internal_error
|
||||
("RTL check: access of elt %d of `%s' with last elt %d in %s, at %s:%d",
|
||||
@ -540,13 +531,8 @@ rtl_check_failed_bounds (r, n, file, line, func)
|
||||
}
|
||||
|
||||
void
|
||||
rtl_check_failed_type1 (r, n, c1, file, line, func)
|
||||
rtx r;
|
||||
int n;
|
||||
int c1;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *func;
|
||||
rtl_check_failed_type1 (rtx r, int n, int c1, const char *file, int line,
|
||||
const char *func)
|
||||
{
|
||||
internal_error
|
||||
("RTL check: expected elt %d type '%c', have '%c' (rtx %s) in %s, at %s:%d",
|
||||
@ -555,14 +541,8 @@ rtl_check_failed_type1 (r, n, c1, file, line, func)
|
||||
}
|
||||
|
||||
void
|
||||
rtl_check_failed_type2 (r, n, c1, c2, file, line, func)
|
||||
rtx r;
|
||||
int n;
|
||||
int c1;
|
||||
int c2;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *func;
|
||||
rtl_check_failed_type2 (rtx r, int n, int c1, int c2, const char *file,
|
||||
int line, const char *func)
|
||||
{
|
||||
internal_error
|
||||
("RTL check: expected elt %d type '%c' or '%c', have '%c' (rtx %s) in %s, at %s:%d",
|
||||
@ -571,12 +551,8 @@ rtl_check_failed_type2 (r, n, c1, c2, file, line, func)
|
||||
}
|
||||
|
||||
void
|
||||
rtl_check_failed_code1 (r, code, file, line, func)
|
||||
rtx r;
|
||||
enum rtx_code code;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *func;
|
||||
rtl_check_failed_code1 (rtx r, enum rtx_code code, const char *file,
|
||||
int line, const char *func)
|
||||
{
|
||||
internal_error ("RTL check: expected code `%s', have `%s' in %s, at %s:%d",
|
||||
GET_RTX_NAME (code), GET_RTX_NAME (GET_CODE (r)), func,
|
||||
@ -584,12 +560,8 @@ rtl_check_failed_code1 (r, code, file, line, func)
|
||||
}
|
||||
|
||||
void
|
||||
rtl_check_failed_code2 (r, code1, code2, file, line, func)
|
||||
rtx r;
|
||||
enum rtx_code code1, code2;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *func;
|
||||
rtl_check_failed_code2 (rtx r, enum rtx_code code1, enum rtx_code code2,
|
||||
const char *file, int line, const char *func)
|
||||
{
|
||||
internal_error
|
||||
("RTL check: expected code `%s' or `%s', have `%s' in %s, at %s:%d",
|
||||
@ -599,12 +571,8 @@ rtl_check_failed_code2 (r, code1, code2, file, line, func)
|
||||
|
||||
/* XXX Maybe print the vector? */
|
||||
void
|
||||
rtvec_check_failed_bounds (r, n, file, line, func)
|
||||
rtvec r;
|
||||
int n;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *func;
|
||||
rtvec_check_failed_bounds (rtvec r, int n, const char *file, int line,
|
||||
const char *func)
|
||||
{
|
||||
internal_error
|
||||
("RTL check: access of elt %d of vector with last elt %d in %s, at %s:%d",
|
||||
@ -614,12 +582,8 @@ rtvec_check_failed_bounds (r, n, file, line, func)
|
||||
|
||||
#if defined ENABLE_RTL_FLAG_CHECKING
|
||||
void
|
||||
rtl_check_failed_flag (name, r, file, line, func)
|
||||
const char *name;
|
||||
rtx r;
|
||||
const char *file;
|
||||
int line;
|
||||
const char *func;
|
||||
rtl_check_failed_flag (const char *name, rtx r, const char *file,
|
||||
int line, const char *func)
|
||||
{
|
||||
internal_error
|
||||
("RTL flag check: %s used with unexpected rtx code `%s' in %s, at %s:%d",
|
||||
|
325
gcc/rtlanal.c
325
gcc/rtlanal.c
@ -1,6 +1,6 @@
|
||||
/* Analyze RTL for C-Compiler
|
||||
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
||||
1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
@ -35,14 +35,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
#include "real.h"
|
||||
|
||||
/* Forward declarations */
|
||||
static int global_reg_mentioned_p_1 PARAMS ((rtx *, void *));
|
||||
static void set_of_1 PARAMS ((rtx, rtx, void *));
|
||||
static void insn_dependent_p_1 PARAMS ((rtx, rtx, void *));
|
||||
static int rtx_referenced_p_1 PARAMS ((rtx *, void *));
|
||||
static int computed_jump_p_1 PARAMS ((rtx));
|
||||
static void parms_set PARAMS ((rtx, rtx, void *));
|
||||
static bool hoist_test_store PARAMS ((rtx, rtx, regset));
|
||||
static void hoist_update_store PARAMS ((rtx, rtx *, rtx, rtx));
|
||||
static int global_reg_mentioned_p_1 (rtx *, void *);
|
||||
static void set_of_1 (rtx, rtx, void *);
|
||||
static void insn_dependent_p_1 (rtx, rtx, void *);
|
||||
static int rtx_referenced_p_1 (rtx *, void *);
|
||||
static int computed_jump_p_1 (rtx);
|
||||
static void parms_set (rtx, rtx, void *);
|
||||
static bool hoist_test_store (rtx, rtx, regset);
|
||||
static void hoist_update_store (rtx, rtx *, rtx, rtx);
|
||||
|
||||
/* Bit flags that specify the machine subtype we are compiling for.
|
||||
Bits are tested using macros TARGET_... defined in the tm.h file
|
||||
@ -56,8 +56,7 @@ int target_flags;
|
||||
(within one function) and so is anything marked `unchanging'. */
|
||||
|
||||
int
|
||||
rtx_unstable_p (x)
|
||||
rtx x;
|
||||
rtx_unstable_p (rtx x)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
int i;
|
||||
@ -132,9 +131,7 @@ rtx_unstable_p (x)
|
||||
The frame pointer and the arg pointer are considered constant. */
|
||||
|
||||
int
|
||||
rtx_varies_p (x, for_alias)
|
||||
rtx x;
|
||||
int for_alias;
|
||||
rtx_varies_p (rtx x, int for_alias)
|
||||
{
|
||||
RTX_CODE code = GET_CODE (x);
|
||||
int i;
|
||||
@ -219,8 +216,7 @@ rtx_varies_p (x, for_alias)
|
||||
/* Return 0 if the use of X as an address in a MEM can cause a trap. */
|
||||
|
||||
int
|
||||
rtx_addr_can_trap_p (x)
|
||||
rtx x;
|
||||
rtx_addr_can_trap_p (rtx x)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
|
||||
@ -283,8 +279,7 @@ rtx_addr_can_trap_p (x)
|
||||
/* Return true if X is an address that is known to not be zero. */
|
||||
|
||||
bool
|
||||
nonzero_address_p (x)
|
||||
rtx x;
|
||||
nonzero_address_p (rtx x)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
|
||||
@ -371,9 +366,7 @@ nonzero_address_p (x)
|
||||
zero, we are slightly more conservative. */
|
||||
|
||||
int
|
||||
rtx_addr_varies_p (x, for_alias)
|
||||
rtx x;
|
||||
int for_alias;
|
||||
rtx_addr_varies_p (rtx x, int for_alias)
|
||||
{
|
||||
enum rtx_code code;
|
||||
int i;
|
||||
@ -409,8 +402,7 @@ rtx_addr_varies_p (x, for_alias)
|
||||
This is used in cse.c with the `related_value' field. */
|
||||
|
||||
HOST_WIDE_INT
|
||||
get_integer_term (x)
|
||||
rtx x;
|
||||
get_integer_term (rtx x)
|
||||
{
|
||||
if (GET_CODE (x) == CONST)
|
||||
x = XEXP (x, 0);
|
||||
@ -429,8 +421,7 @@ get_integer_term (x)
|
||||
Only obvious integer terms are detected. */
|
||||
|
||||
rtx
|
||||
get_related_value (x)
|
||||
rtx x;
|
||||
get_related_value (rtx x)
|
||||
{
|
||||
if (GET_CODE (x) != CONST)
|
||||
return 0;
|
||||
@ -452,9 +443,7 @@ get_related_value (x)
|
||||
insn used in locating the offset was found. */
|
||||
|
||||
rtx
|
||||
get_jump_table_offset (insn, earliest)
|
||||
rtx insn;
|
||||
rtx *earliest;
|
||||
get_jump_table_offset (rtx insn, rtx *earliest)
|
||||
{
|
||||
rtx label;
|
||||
rtx table;
|
||||
@ -582,9 +571,7 @@ get_jump_table_offset (insn, earliest)
|
||||
a global register. */
|
||||
|
||||
static int
|
||||
global_reg_mentioned_p_1 (loc, data)
|
||||
rtx *loc;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
global_reg_mentioned_p_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int regno;
|
||||
rtx x = *loc;
|
||||
@ -633,8 +620,7 @@ global_reg_mentioned_p_1 (loc, data)
|
||||
/* Returns nonzero if X mentions a global register. */
|
||||
|
||||
int
|
||||
global_reg_mentioned_p (x)
|
||||
rtx x;
|
||||
global_reg_mentioned_p (rtx x)
|
||||
{
|
||||
if (INSN_P (x))
|
||||
{
|
||||
@ -657,9 +643,7 @@ global_reg_mentioned_p (x)
|
||||
zero, we do not count occurrences inside the destination of a SET. */
|
||||
|
||||
int
|
||||
count_occurrences (x, find, count_dest)
|
||||
rtx x, find;
|
||||
int count_dest;
|
||||
count_occurrences (rtx x, rtx find, int count_dest)
|
||||
{
|
||||
int i, j;
|
||||
enum rtx_code code;
|
||||
@ -722,8 +706,7 @@ count_occurrences (x, find, count_dest)
|
||||
for a subexpression of IN that is Lisp "equal" to REG. */
|
||||
|
||||
int
|
||||
reg_mentioned_p (reg, in)
|
||||
rtx reg, in;
|
||||
reg_mentioned_p (rtx reg, rtx in)
|
||||
{
|
||||
const char *fmt;
|
||||
int i;
|
||||
@ -788,8 +771,7 @@ reg_mentioned_p (reg, in)
|
||||
no CODE_LABEL insn. */
|
||||
|
||||
int
|
||||
no_labels_between_p (beg, end)
|
||||
rtx beg, end;
|
||||
no_labels_between_p (rtx beg, rtx end)
|
||||
{
|
||||
rtx p;
|
||||
if (beg == end)
|
||||
@ -804,8 +786,7 @@ no_labels_between_p (beg, end)
|
||||
no JUMP_INSN insn. */
|
||||
|
||||
int
|
||||
no_jumps_between_p (beg, end)
|
||||
rtx beg, end;
|
||||
no_jumps_between_p (rtx beg, rtx end)
|
||||
{
|
||||
rtx p;
|
||||
for (p = NEXT_INSN (beg); p != end; p = NEXT_INSN (p))
|
||||
@ -818,8 +799,7 @@ no_jumps_between_p (beg, end)
|
||||
FROM_INSN and TO_INSN (exclusive of those two). */
|
||||
|
||||
int
|
||||
reg_used_between_p (reg, from_insn, to_insn)
|
||||
rtx reg, from_insn, to_insn;
|
||||
reg_used_between_p (rtx reg, rtx from_insn, rtx to_insn)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -841,9 +821,7 @@ reg_used_between_p (reg, from_insn, to_insn)
|
||||
we do not consider it a reference. */
|
||||
|
||||
int
|
||||
reg_referenced_p (x, body)
|
||||
rtx x;
|
||||
rtx body;
|
||||
reg_referenced_p (rtx x, rtx body)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -920,8 +898,7 @@ reg_referenced_p (x, body)
|
||||
not count. */
|
||||
|
||||
int
|
||||
reg_referenced_between_p (reg, from_insn, to_insn)
|
||||
rtx reg, from_insn, to_insn;
|
||||
reg_referenced_between_p (rtx reg, rtx from_insn, rtx to_insn)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -941,8 +918,7 @@ reg_referenced_between_p (reg, from_insn, to_insn)
|
||||
FROM_INSN and TO_INSN (exclusive of those two). */
|
||||
|
||||
int
|
||||
reg_set_between_p (reg, from_insn, to_insn)
|
||||
rtx reg, from_insn, to_insn;
|
||||
reg_set_between_p (rtx reg, rtx from_insn, rtx to_insn)
|
||||
{
|
||||
rtx insn;
|
||||
|
||||
@ -957,8 +933,7 @@ reg_set_between_p (reg, from_insn, to_insn)
|
||||
|
||||
/* Internals of reg_set_between_p. */
|
||||
int
|
||||
reg_set_p (reg, insn)
|
||||
rtx reg, insn;
|
||||
reg_set_p (rtx reg, rtx insn)
|
||||
{
|
||||
/* We can be passed an insn or part of one. If we are passed an insn,
|
||||
check if a side-effect of the insn clobbers REG. */
|
||||
@ -985,9 +960,7 @@ reg_set_p (reg, insn)
|
||||
consider non-registers one way or the other. */
|
||||
|
||||
int
|
||||
regs_set_between_p (x, start, end)
|
||||
rtx x;
|
||||
rtx start, end;
|
||||
regs_set_between_p (rtx x, rtx start, rtx end)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
const char *fmt;
|
||||
@ -1032,9 +1005,7 @@ regs_set_between_p (x, start, end)
|
||||
X contains a MEM; this routine does usememory aliasing. */
|
||||
|
||||
int
|
||||
modified_between_p (x, start, end)
|
||||
rtx x;
|
||||
rtx start, end;
|
||||
modified_between_p (rtx x, rtx start, rtx end)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
const char *fmt;
|
||||
@ -1096,9 +1067,7 @@ modified_between_p (x, start, end)
|
||||
does use memory aliasing. */
|
||||
|
||||
int
|
||||
modified_in_p (x, insn)
|
||||
rtx x;
|
||||
rtx insn;
|
||||
modified_in_p (rtx x, rtx insn)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
const char *fmt;
|
||||
@ -1154,8 +1123,7 @@ modified_in_p (x, insn)
|
||||
anything in insn Y. */
|
||||
|
||||
int
|
||||
insn_dependent_p (x, y)
|
||||
rtx x, y;
|
||||
insn_dependent_p (rtx x, rtx y)
|
||||
{
|
||||
rtx tmp;
|
||||
|
||||
@ -1178,10 +1146,7 @@ insn_dependent_p (x, y)
|
||||
/* A helper routine for insn_dependent_p called through note_stores. */
|
||||
|
||||
static void
|
||||
insn_dependent_p_1 (x, pat, data)
|
||||
rtx x;
|
||||
rtx pat ATTRIBUTE_UNUSED;
|
||||
void *data;
|
||||
insn_dependent_p_1 (rtx x, rtx pat ATTRIBUTE_UNUSED, void *data)
|
||||
{
|
||||
rtx * pinsn = (rtx *) data;
|
||||
|
||||
@ -1197,10 +1162,7 @@ struct set_of_data
|
||||
};
|
||||
|
||||
static void
|
||||
set_of_1 (x, pat, data1)
|
||||
rtx x;
|
||||
rtx pat;
|
||||
void *data1;
|
||||
set_of_1 (rtx x, rtx pat, void *data1)
|
||||
{
|
||||
struct set_of_data *data = (struct set_of_data *) (data1);
|
||||
if (rtx_equal_p (x, data->pat)
|
||||
@ -1211,8 +1173,7 @@ set_of_1 (x, pat, data1)
|
||||
/* Give an INSN, return a SET or CLOBBER expression that does modify PAT
|
||||
(either directly or via STRICT_LOW_PART and similar modifiers). */
|
||||
rtx
|
||||
set_of (pat, insn)
|
||||
rtx pat, insn;
|
||||
set_of (rtx pat, rtx insn)
|
||||
{
|
||||
struct set_of_data data;
|
||||
data.found = NULL_RTX;
|
||||
@ -1226,8 +1187,7 @@ set_of (pat, insn)
|
||||
will not be used, which we ignore. */
|
||||
|
||||
rtx
|
||||
single_set_2 (insn, pat)
|
||||
rtx insn, pat;
|
||||
single_set_2 (rtx insn, rtx pat)
|
||||
{
|
||||
rtx set = NULL;
|
||||
int set_verified = 1;
|
||||
@ -1280,8 +1240,7 @@ single_set_2 (insn, pat)
|
||||
zero. */
|
||||
|
||||
int
|
||||
multiple_sets (insn)
|
||||
rtx insn;
|
||||
multiple_sets (rtx insn)
|
||||
{
|
||||
int found;
|
||||
int i;
|
||||
@ -1312,8 +1271,7 @@ multiple_sets (insn)
|
||||
and there are no side effects. */
|
||||
|
||||
int
|
||||
set_noop_p (set)
|
||||
rtx set;
|
||||
set_noop_p (rtx set)
|
||||
{
|
||||
rtx src = SET_SRC (set);
|
||||
rtx dst = SET_DEST (set);
|
||||
@ -1349,8 +1307,7 @@ set_noop_p (set)
|
||||
value to itself. */
|
||||
|
||||
int
|
||||
noop_move_p (insn)
|
||||
rtx insn;
|
||||
noop_move_p (rtx insn)
|
||||
{
|
||||
rtx pat = PATTERN (insn);
|
||||
|
||||
@ -1400,11 +1357,7 @@ noop_move_p (insn)
|
||||
be the src. */
|
||||
|
||||
rtx
|
||||
find_last_value (x, pinsn, valid_to, allow_hwreg)
|
||||
rtx x;
|
||||
rtx *pinsn;
|
||||
rtx valid_to;
|
||||
int allow_hwreg;
|
||||
find_last_value (rtx x, rtx *pinsn, rtx valid_to, int allow_hwreg)
|
||||
{
|
||||
rtx p;
|
||||
|
||||
@ -1450,10 +1403,8 @@ find_last_value (x, pinsn, valid_to, allow_hwreg)
|
||||
LOC may be zero, meaning don't ignore anything. */
|
||||
|
||||
int
|
||||
refers_to_regno_p (regno, endregno, x, loc)
|
||||
unsigned int regno, endregno;
|
||||
rtx x;
|
||||
rtx *loc;
|
||||
refers_to_regno_p (unsigned int regno, unsigned int endregno, rtx x,
|
||||
rtx *loc)
|
||||
{
|
||||
int i;
|
||||
unsigned int x_regno;
|
||||
@ -1564,8 +1515,7 @@ refers_to_regno_p (regno, endregno, x, loc)
|
||||
conflict because we expect this to be a rare case. */
|
||||
|
||||
int
|
||||
reg_overlap_mentioned_p (x, in)
|
||||
rtx x, in;
|
||||
reg_overlap_mentioned_p (rtx x, rtx in)
|
||||
{
|
||||
unsigned int regno, endregno;
|
||||
|
||||
@ -1641,9 +1591,7 @@ reg_overlap_mentioned_p (x, in)
|
||||
check if a MEM remains unchanged. */
|
||||
|
||||
rtx
|
||||
reg_set_last (x, insn)
|
||||
rtx x;
|
||||
rtx insn;
|
||||
reg_set_last (rtx x, rtx insn)
|
||||
{
|
||||
rtx orig_insn = insn;
|
||||
|
||||
@ -1694,10 +1642,7 @@ reg_set_last (x, insn)
|
||||
the SUBREG will be passed. */
|
||||
|
||||
void
|
||||
note_stores (x, fun, data)
|
||||
rtx x;
|
||||
void (*fun) PARAMS ((rtx, rtx, void *));
|
||||
void *data;
|
||||
note_stores (rtx x, void (*fun) (rtx, rtx, void *), void *data)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -1743,10 +1688,7 @@ note_stores (x, fun, data)
|
||||
partially set, while we do not. */
|
||||
|
||||
void
|
||||
note_uses (pbody, fun, data)
|
||||
rtx *pbody;
|
||||
void (*fun) PARAMS ((rtx *, void *));
|
||||
void *data;
|
||||
note_uses (rtx *pbody, void (*fun) (rtx *, void *), void *data)
|
||||
{
|
||||
rtx body = *pbody;
|
||||
int i;
|
||||
@ -1838,9 +1780,7 @@ note_uses (pbody, fun, data)
|
||||
by INSN. */
|
||||
|
||||
int
|
||||
dead_or_set_p (insn, x)
|
||||
rtx insn;
|
||||
rtx x;
|
||||
dead_or_set_p (rtx insn, rtx x)
|
||||
{
|
||||
unsigned int regno, last_regno;
|
||||
unsigned int i;
|
||||
@ -1867,9 +1807,7 @@ dead_or_set_p (insn, x)
|
||||
called from flow.c. */
|
||||
|
||||
int
|
||||
dead_or_set_regno_p (insn, test_regno)
|
||||
rtx insn;
|
||||
unsigned int test_regno;
|
||||
dead_or_set_regno_p (rtx insn, unsigned int test_regno)
|
||||
{
|
||||
unsigned int regno, endregno;
|
||||
rtx pattern;
|
||||
@ -1952,10 +1890,7 @@ dead_or_set_regno_p (insn, test_regno)
|
||||
If DATUM is nonzero, look for one whose datum is DATUM. */
|
||||
|
||||
rtx
|
||||
find_reg_note (insn, kind, datum)
|
||||
rtx insn;
|
||||
enum reg_note kind;
|
||||
rtx datum;
|
||||
find_reg_note (rtx insn, enum reg_note kind, rtx datum)
|
||||
{
|
||||
rtx link;
|
||||
|
||||
@ -1976,10 +1911,7 @@ find_reg_note (insn, kind, datum)
|
||||
it might be the case that the note overlaps REGNO. */
|
||||
|
||||
rtx
|
||||
find_regno_note (insn, kind, regno)
|
||||
rtx insn;
|
||||
enum reg_note kind;
|
||||
unsigned int regno;
|
||||
find_regno_note (rtx insn, enum reg_note kind, unsigned int regno)
|
||||
{
|
||||
rtx link;
|
||||
|
||||
@ -2006,8 +1938,7 @@ find_regno_note (insn, kind, regno)
|
||||
has such a note. */
|
||||
|
||||
rtx
|
||||
find_reg_equal_equiv_note (insn)
|
||||
rtx insn;
|
||||
find_reg_equal_equiv_note (rtx insn)
|
||||
{
|
||||
rtx link;
|
||||
|
||||
@ -2028,10 +1959,7 @@ find_reg_equal_equiv_note (insn)
|
||||
in the CALL_INSN_FUNCTION_USAGE information of INSN. */
|
||||
|
||||
int
|
||||
find_reg_fusage (insn, code, datum)
|
||||
rtx insn;
|
||||
enum rtx_code code;
|
||||
rtx datum;
|
||||
find_reg_fusage (rtx insn, enum rtx_code code, rtx datum)
|
||||
{
|
||||
/* If it's not a CALL_INSN, it can't possibly have a
|
||||
CALL_INSN_FUNCTION_USAGE field, so don't bother checking. */
|
||||
@ -2078,10 +2006,7 @@ find_reg_fusage (insn, code, datum)
|
||||
in the CALL_INSN_FUNCTION_USAGE information of INSN. */
|
||||
|
||||
int
|
||||
find_regno_fusage (insn, code, regno)
|
||||
rtx insn;
|
||||
enum rtx_code code;
|
||||
unsigned int regno;
|
||||
find_regno_fusage (rtx insn, enum rtx_code code, unsigned int regno)
|
||||
{
|
||||
rtx link;
|
||||
|
||||
@ -2110,8 +2035,7 @@ find_regno_fusage (insn, code, regno)
|
||||
/* Return true if INSN is a call to a pure function. */
|
||||
|
||||
int
|
||||
pure_call_p (insn)
|
||||
rtx insn;
|
||||
pure_call_p (rtx insn)
|
||||
{
|
||||
rtx link;
|
||||
|
||||
@ -2135,9 +2059,7 @@ pure_call_p (insn)
|
||||
/* Remove register note NOTE from the REG_NOTES of INSN. */
|
||||
|
||||
void
|
||||
remove_note (insn, note)
|
||||
rtx insn;
|
||||
rtx note;
|
||||
remove_note (rtx insn, rtx note)
|
||||
{
|
||||
rtx link;
|
||||
|
||||
@ -2165,9 +2087,7 @@ remove_note (insn, note)
|
||||
NODE matches. */
|
||||
|
||||
int
|
||||
in_expr_list_p (listp, node)
|
||||
rtx listp;
|
||||
rtx node;
|
||||
in_expr_list_p (rtx listp, rtx node)
|
||||
{
|
||||
rtx x;
|
||||
|
||||
@ -2184,9 +2104,7 @@ in_expr_list_p (listp, node)
|
||||
A simple equality test is used to determine if NODE matches. */
|
||||
|
||||
void
|
||||
remove_node_from_expr_list (node, listp)
|
||||
rtx node;
|
||||
rtx *listp;
|
||||
remove_node_from_expr_list (rtx node, rtx *listp)
|
||||
{
|
||||
rtx temp = *listp;
|
||||
rtx prev = NULL_RTX;
|
||||
@ -2215,8 +2133,7 @@ remove_node_from_expr_list (node, listp)
|
||||
only volatile asms and UNSPEC_VOLATILE instructions. */
|
||||
|
||||
int
|
||||
volatile_insn_p (x)
|
||||
rtx x;
|
||||
volatile_insn_p (rtx x)
|
||||
{
|
||||
RTX_CODE code;
|
||||
|
||||
@ -2282,8 +2199,7 @@ volatile_insn_p (x)
|
||||
UNSPEC_VOLATILE operations or volatile ASM_OPERANDS expressions. */
|
||||
|
||||
int
|
||||
volatile_refs_p (x)
|
||||
rtx x;
|
||||
volatile_refs_p (rtx x)
|
||||
{
|
||||
RTX_CODE code;
|
||||
|
||||
@ -2347,8 +2263,7 @@ volatile_refs_p (x)
|
||||
incrementing. */
|
||||
|
||||
int
|
||||
side_effects_p (x)
|
||||
rtx x;
|
||||
side_effects_p (rtx x)
|
||||
{
|
||||
RTX_CODE code;
|
||||
|
||||
@ -2424,8 +2339,7 @@ side_effects_p (x)
|
||||
/* Return nonzero if evaluating rtx X might cause a trap. */
|
||||
|
||||
int
|
||||
may_trap_p (x)
|
||||
rtx x;
|
||||
may_trap_p (rtx x)
|
||||
{
|
||||
int i;
|
||||
enum rtx_code code;
|
||||
@ -2557,8 +2471,7 @@ may_trap_p (x)
|
||||
i.e., an inequality. */
|
||||
|
||||
int
|
||||
inequality_comparisons_p (x)
|
||||
rtx x;
|
||||
inequality_comparisons_p (rtx x)
|
||||
{
|
||||
const char *fmt;
|
||||
int len, i;
|
||||
@ -2621,8 +2534,7 @@ inequality_comparisons_p (x)
|
||||
are to be modified. */
|
||||
|
||||
rtx
|
||||
replace_rtx (x, from, to)
|
||||
rtx x, from, to;
|
||||
replace_rtx (rtx x, rtx from, rtx to)
|
||||
{
|
||||
int i, j;
|
||||
const char *fmt;
|
||||
@ -2699,11 +2611,7 @@ replace_rtx (x, from, to)
|
||||
otherwise, only sources are replaced. */
|
||||
|
||||
rtx
|
||||
replace_regs (x, reg_map, nregs, replace_dest)
|
||||
rtx x;
|
||||
rtx *reg_map;
|
||||
unsigned int nregs;
|
||||
int replace_dest;
|
||||
replace_regs (rtx x, rtx *reg_map, unsigned int nregs, int replace_dest)
|
||||
{
|
||||
enum rtx_code code;
|
||||
int i;
|
||||
@ -2794,9 +2702,7 @@ replace_regs (x, reg_map, nregs, replace_dest)
|
||||
DATA is a REPLACE_LABEL_DATA containing the old and new labels. */
|
||||
|
||||
int
|
||||
replace_label (x, data)
|
||||
rtx *x;
|
||||
void *data;
|
||||
replace_label (rtx *x, void *data)
|
||||
{
|
||||
rtx l = *x;
|
||||
rtx tmp;
|
||||
@ -2817,7 +2723,7 @@ replace_label (x, data)
|
||||
{
|
||||
rtx new_c, new_l;
|
||||
replace_label_data *d = (replace_label_data *) data;
|
||||
|
||||
|
||||
/* Create a copy of constant C; replace the label inside
|
||||
but do not update LABEL_NUSES because uses in constant pool
|
||||
are not counted. */
|
||||
@ -2861,9 +2767,7 @@ replace_label (x, data)
|
||||
too, otherwise FOR_EACH_RTX continues traversing *BODY. */
|
||||
|
||||
static int
|
||||
rtx_referenced_p_1 (body, x)
|
||||
rtx *body;
|
||||
void *x;
|
||||
rtx_referenced_p_1 (rtx *body, void *x)
|
||||
{
|
||||
rtx y = (rtx) x;
|
||||
|
||||
@ -2886,9 +2790,7 @@ rtx_referenced_p_1 (body, x)
|
||||
/* Return true if X is referenced in BODY. */
|
||||
|
||||
int
|
||||
rtx_referenced_p (x, body)
|
||||
rtx x;
|
||||
rtx body;
|
||||
rtx_referenced_p (rtx x, rtx body)
|
||||
{
|
||||
return for_each_rtx (&body, rtx_referenced_p_1, x);
|
||||
}
|
||||
@ -2898,10 +2800,7 @@ rtx_referenced_p (x, body)
|
||||
LABEL and TABLE may be NULL. */
|
||||
|
||||
bool
|
||||
tablejump_p (insn, label, table)
|
||||
rtx insn;
|
||||
rtx *label;
|
||||
rtx *table;
|
||||
tablejump_p (rtx insn, rtx *label, rtx *table)
|
||||
{
|
||||
rtx l, t;
|
||||
|
||||
@ -2926,8 +2825,7 @@ tablejump_p (insn, label, table)
|
||||
of an IF_THEN_ELSE. */
|
||||
|
||||
static int
|
||||
computed_jump_p_1 (x)
|
||||
rtx x;
|
||||
computed_jump_p_1 (rtx x)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
int i, j;
|
||||
@ -2981,8 +2879,7 @@ computed_jump_p_1 (x)
|
||||
we can recognize them by a (use (label_ref)). */
|
||||
|
||||
int
|
||||
computed_jump_p (insn)
|
||||
rtx insn;
|
||||
computed_jump_p (rtx insn)
|
||||
{
|
||||
int i;
|
||||
if (GET_CODE (insn) == JUMP_INSN)
|
||||
@ -3031,10 +2928,7 @@ computed_jump_p (insn)
|
||||
implement many of the other routines in this file. */
|
||||
|
||||
int
|
||||
for_each_rtx (x, f, data)
|
||||
rtx *x;
|
||||
rtx_function f;
|
||||
void *data;
|
||||
for_each_rtx (rtx *x, rtx_function f, void *data)
|
||||
{
|
||||
int result;
|
||||
int length;
|
||||
@ -3095,9 +2989,7 @@ for_each_rtx (x, f, data)
|
||||
reference found if any. Otherwise, returns NULL_RTX. */
|
||||
|
||||
rtx
|
||||
regno_use_in (regno, x)
|
||||
unsigned int regno;
|
||||
rtx x;
|
||||
regno_use_in (unsigned int regno, rtx x)
|
||||
{
|
||||
const char *fmt;
|
||||
int i, j;
|
||||
@ -3130,8 +3022,7 @@ regno_use_in (regno, x)
|
||||
and positive values for the second operand. */
|
||||
|
||||
int
|
||||
commutative_operand_precedence (op)
|
||||
rtx op;
|
||||
commutative_operand_precedence (rtx op)
|
||||
{
|
||||
/* Constants always come the second operand. Prefer "nice" constants. */
|
||||
if (GET_CODE (op) == CONST_INT)
|
||||
@ -3165,8 +3056,7 @@ commutative_operand_precedence (op)
|
||||
in order to canonicalize expression. */
|
||||
|
||||
int
|
||||
swap_commutative_operands_p (x, y)
|
||||
rtx x, y;
|
||||
swap_commutative_operands_p (rtx x, rtx y)
|
||||
{
|
||||
return (commutative_operand_precedence (x)
|
||||
< commutative_operand_precedence (y));
|
||||
@ -3175,8 +3065,7 @@ swap_commutative_operands_p (x, y)
|
||||
/* Return 1 if X is an autoincrement side effect and the register is
|
||||
not the stack pointer. */
|
||||
int
|
||||
auto_inc_p (x)
|
||||
rtx x;
|
||||
auto_inc_p (rtx x)
|
||||
{
|
||||
switch (GET_CODE (x))
|
||||
{
|
||||
@ -3206,10 +3095,7 @@ auto_inc_p (x)
|
||||
conditions as well. */
|
||||
|
||||
int
|
||||
insns_safe_to_move_p (from, to, new_to)
|
||||
rtx from;
|
||||
rtx to;
|
||||
rtx *new_to;
|
||||
insns_safe_to_move_p (rtx from, rtx to, rtx *new_to)
|
||||
{
|
||||
int eh_region_count = 0;
|
||||
int past_to_p = 0;
|
||||
@ -3276,8 +3162,7 @@ insns_safe_to_move_p (from, to, new_to)
|
||||
|
||||
/* Return nonzero if IN contains a piece of rtl that has the address LOC. */
|
||||
int
|
||||
loc_mentioned_in_p (loc, in)
|
||||
rtx *loc, in;
|
||||
loc_mentioned_in_p (rtx *loc, rtx in)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (in);
|
||||
const char *fmt = GET_RTX_FORMAT (code);
|
||||
@ -3304,8 +3189,7 @@ loc_mentioned_in_p (loc, in)
|
||||
(counting from the least significant bit of the reg). */
|
||||
|
||||
unsigned int
|
||||
subreg_lsb (x)
|
||||
rtx x;
|
||||
subreg_lsb (rtx x)
|
||||
{
|
||||
enum machine_mode inner_mode = GET_MODE (SUBREG_REG (x));
|
||||
enum machine_mode mode = GET_MODE (x);
|
||||
@ -3350,11 +3234,8 @@ subreg_lsb (x)
|
||||
ymode - The mode of a top level SUBREG (or what may become one).
|
||||
RETURN - The regno offset which would be used. */
|
||||
unsigned int
|
||||
subreg_regno_offset (xregno, xmode, offset, ymode)
|
||||
unsigned int xregno;
|
||||
enum machine_mode xmode;
|
||||
unsigned int offset;
|
||||
enum machine_mode ymode;
|
||||
subreg_regno_offset (unsigned int xregno, enum machine_mode xmode,
|
||||
unsigned int offset, enum machine_mode ymode)
|
||||
{
|
||||
int nregs_xmode, nregs_ymode;
|
||||
int mode_multiple, nregs_multiple;
|
||||
@ -3396,11 +3277,8 @@ subreg_regno_offset (xregno, xmode, offset, ymode)
|
||||
ymode - The mode of a top level SUBREG (or what may become one).
|
||||
RETURN - The regno offset which would be used. */
|
||||
bool
|
||||
subreg_offset_representable_p (xregno, xmode, offset, ymode)
|
||||
unsigned int xregno;
|
||||
enum machine_mode xmode;
|
||||
unsigned int offset;
|
||||
enum machine_mode ymode;
|
||||
subreg_offset_representable_p (unsigned int xregno, enum machine_mode xmode,
|
||||
unsigned int offset, enum machine_mode ymode)
|
||||
{
|
||||
int nregs_xmode, nregs_ymode;
|
||||
int mode_multiple, nregs_multiple;
|
||||
@ -3436,9 +3314,9 @@ subreg_offset_representable_p (xregno, xmode, offset, ymode)
|
||||
/* The XMODE value can be seen as a vector of NREGS_XMODE
|
||||
values. The subreg must represent an lowpart of given field.
|
||||
Compute what field it is. */
|
||||
offset -= subreg_lowpart_offset (ymode,
|
||||
mode_for_size (GET_MODE_BITSIZE (xmode)
|
||||
/ nregs_xmode,
|
||||
offset -= subreg_lowpart_offset (ymode,
|
||||
mode_for_size (GET_MODE_BITSIZE (xmode)
|
||||
/ nregs_xmode,
|
||||
MODE_INT, 0));
|
||||
|
||||
/* size of ymode must not be greater than the size of xmode. */
|
||||
@ -3458,8 +3336,7 @@ subreg_offset_representable_p (xregno, xmode, offset, ymode)
|
||||
|
||||
/* Return the final regno that a subreg expression refers to. */
|
||||
unsigned int
|
||||
subreg_regno (x)
|
||||
rtx x;
|
||||
subreg_regno (rtx x)
|
||||
{
|
||||
unsigned int ret;
|
||||
rtx subreg = SUBREG_REG (x);
|
||||
@ -3480,9 +3357,7 @@ struct parms_set_data
|
||||
|
||||
/* Helper function for noticing stores to parameter registers. */
|
||||
static void
|
||||
parms_set (x, pat, data)
|
||||
rtx x, pat ATTRIBUTE_UNUSED;
|
||||
void *data;
|
||||
parms_set (rtx x, rtx pat ATTRIBUTE_UNUSED, void *data)
|
||||
{
|
||||
struct parms_set_data *d = data;
|
||||
if (REG_P (x) && REGNO (x) < FIRST_PSEUDO_REGISTER
|
||||
@ -3496,8 +3371,7 @@ parms_set (x, pat, data)
|
||||
/* Look backward for first parameter to be loaded.
|
||||
Do not skip BOUNDARY. */
|
||||
rtx
|
||||
find_first_parameter_load (call_insn, boundary)
|
||||
rtx call_insn, boundary;
|
||||
find_first_parameter_load (rtx call_insn, rtx boundary)
|
||||
{
|
||||
struct parms_set_data parm;
|
||||
rtx p, before;
|
||||
@ -3555,8 +3429,7 @@ find_first_parameter_load (call_insn, boundary)
|
||||
call instruction. */
|
||||
|
||||
bool
|
||||
keep_with_call_p (insn)
|
||||
rtx insn;
|
||||
keep_with_call_p (rtx insn)
|
||||
{
|
||||
rtx set;
|
||||
|
||||
@ -3590,9 +3463,7 @@ keep_with_call_p (insn)
|
||||
whose value will be used. */
|
||||
|
||||
static bool
|
||||
hoist_test_store (x, val, live)
|
||||
rtx x, val;
|
||||
regset live;
|
||||
hoist_test_store (rtx x, rtx val, regset live)
|
||||
{
|
||||
if (GET_CODE (x) == SCRATCH)
|
||||
return true;
|
||||
@ -3648,9 +3519,7 @@ hoist_test_store (x, val, live)
|
||||
and used by the hoisting pass. */
|
||||
|
||||
bool
|
||||
can_hoist_insn_p (insn, val, live)
|
||||
rtx insn, val;
|
||||
regset live;
|
||||
can_hoist_insn_p (rtx insn, rtx val, regset live)
|
||||
{
|
||||
rtx pat = PATTERN (insn);
|
||||
int i;
|
||||
@ -3717,8 +3586,7 @@ can_hoist_insn_p (insn, val, live)
|
||||
be updated to NEW. */
|
||||
|
||||
static void
|
||||
hoist_update_store (insn, xp, val, new)
|
||||
rtx insn, *xp, val, new;
|
||||
hoist_update_store (rtx insn, rtx *xp, rtx val, rtx new)
|
||||
{
|
||||
rtx x = *xp;
|
||||
|
||||
@ -3755,8 +3623,7 @@ hoist_update_store (insn, xp, val, new)
|
||||
and each other side effect to pseudo register by new pseudo register. */
|
||||
|
||||
rtx
|
||||
hoist_insn_after (insn, after, val, new)
|
||||
rtx insn, after, val, new;
|
||||
hoist_insn_after (rtx insn, rtx after, rtx val, rtx new)
|
||||
{
|
||||
rtx pat;
|
||||
int i;
|
||||
@ -3820,9 +3687,7 @@ hoist_insn_after (insn, after, val, new)
|
||||
}
|
||||
|
||||
rtx
|
||||
hoist_insn_to_edge (insn, e, val, new)
|
||||
rtx insn, val, new;
|
||||
edge e;
|
||||
hoist_insn_to_edge (rtx insn, edge e, rtx val, rtx new)
|
||||
{
|
||||
rtx new_insn;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user