Commit d29c259b by Richard Henderson Committed by Richard Henderson

stupid.c: Die die die.

	* stupid.c: Die die die.
	* Makefile.in (OBJS): Remove stupid.o.
	(stupid.o): Likewise.

	* except.c (emit_eh_context): Don't emit USEs for stupid.
	* explow.c (probe_stack_range): Likewise.
	* flags.h (obey_regdecls): Remove.
	* flow.c (find_basic_blocks): Don't run try_merge_blocks
	when not optimizing.
	(life_analysis): Limit data collection when not optimizing.
	(mark_regs_live_at_end): Always mark the return value registers.
	(mark_used_regs): Remove dummy RETURN case.
	(print_rtl_with_bb): Don't consult obey_regdecls.
	* function.c (use_variable, use_variable_after): Remove.
	(assign_parms): Consult optimize not obey_regdecls.
	(expand_function_start): Don't emit USEs for stupid.
	(expand_function_end): Likewise.
	* global.c (build_insn_chain): Export.
	* integrate.c (expand_inline_function): Kill return-value USE
	handling code.
	* jump.c (jump_optimize_1): Do simple jump optimizations and
	dead code elimination.
	(calculate_can_reach_end): Remove check_deleted argument.
	(delete_insn): Patch out insns even when not optimizing.
	* local-alloc.c (block_alloc): Don't do tying when not optimizing.
	* rtl.h (use_variable, use_variable_after): Remove declarations.
	(build_insn_chain): Declare.
	* stmt.c (expand_value_return): Don't emit USEs for stupid.
	(expand_end_bindings): Likewise.
	(expand_decl): Likewise.  Consult optimize not obey_regdecls.
	* toplev.c (obey_regdecls): Remove.
	(rest_of_compilation): Don't set it.  Kill stupid in favour of
	flow1, local-alloc, and reload.
	(main): Don't set obey_regdecls.

	* config/nextstep.c (handle_pragma): Likewise.

	* alpha/alpha.md (allocate_stack): Don't emit USEs for stupid.

	* arm/arm.h (CONDITIONAL_REGISTER_USAGE): Don't fix reg 0 for stupid.

From-SVN: r31499
parent 301e21af
2000-01-19 Richard Henderson <rth@cygnus.com>
* stupid.c: Die die die.
* Makefile.in (OBJS): Remove stupid.o.
(stupid.o): Likewise.
* except.c (emit_eh_context): Don't emit USEs for stupid.
* explow.c (probe_stack_range): Likewise.
* flags.h (obey_regdecls): Remove.
* flow.c (find_basic_blocks): Don't run try_merge_blocks
when not optimizing.
(life_analysis): Limit data collection when not optimizing.
(mark_regs_live_at_end): Always mark the return value registers.
(mark_used_regs): Remove dummy RETURN case.
(print_rtl_with_bb): Don't consult obey_regdecls.
* function.c (use_variable, use_variable_after): Remove.
(assign_parms): Consult optimize not obey_regdecls.
(expand_function_start): Don't emit USEs for stupid.
(expand_function_end): Likewise.
* global.c (build_insn_chain): Export.
* integrate.c (expand_inline_function): Kill return-value USE
handling code.
* jump.c (jump_optimize_1): Do simple jump optimizations and
dead code elimination.
(calculate_can_reach_end): Remove check_deleted argument.
(delete_insn): Patch out insns even when not optimizing.
* local-alloc.c (block_alloc): Don't do tying when not optimizing.
* rtl.h (use_variable, use_variable_after): Remove declarations.
(build_insn_chain): Declare.
* stmt.c (expand_value_return): Don't emit USEs for stupid.
(expand_end_bindings): Likewise.
(expand_decl): Likewise. Consult optimize not obey_regdecls.
* toplev.c (obey_regdecls): Remove.
(rest_of_compilation): Don't set it. Kill stupid in favour of
flow1, local-alloc, and reload.
(main): Don't set obey_regdecls.
* config/nextstep.c (handle_pragma): Likewise.
* alpha/alpha.md (allocate_stack): Don't emit USEs for stupid.
* arm/arm.h (CONDITIONAL_REGISTER_USAGE): Don't fix reg 0 for stupid.
2000-01-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* alpha-protos.h: PROTO -> PARAMS.
......
......@@ -667,7 +667,7 @@ OBJS = diagnostic.o \
function.o stmt.o except.o expr.o calls.o expmed.o explow.o optabs.o real.o \
builtins.o intl.o varasm.o rtl.o print-rtl.o rtlanal.o emit-rtl.o genrtl.o \
dbxout.o sdbout.o dwarfout.o dwarf2out.o xcoffout.o bitmap.o alias.o gcse.o \
integrate.o jump.o cse.o loop.o unroll.o flow.o stupid.o combine.o varray.o \
integrate.o jump.o cse.o loop.o unroll.o flow.o combine.o varray.o \
regclass.o regmove.o local-alloc.o global.o reload.o reload1.o caller-save.o \
insn-peep.o reorg.o haifa-sched.o final.o recog.o reg-stack.o \
insn-opinit.o insn-recog.o insn-extract.o insn-output.o insn-emit.o lcm.o \
......@@ -1546,8 +1546,6 @@ integrate.o : integrate.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) flags.h \
jump.o : jump.c $(CONFIG_H) system.h $(RTL_H) flags.h hard-reg-set.h $(REGS_H) \
insn-config.h insn-flags.h $(RECOG_H) $(EXPR_H) real.h except.h function.h \
toplev.h insn-attr.h
stupid.o : stupid.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) hard-reg-set.h \
$(BASIC_BLOCK_H) insn-config.h reload.h flags.h function.h toplev.h
simplify-rtx.o : simplify-rtx.c $(CONFIG_H) system.h $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h real.h insn-config.h $(RECOG_H) $(EXPR_H) toplev.h \
......
......@@ -5116,8 +5116,6 @@
emit_insn (gen_adddi3 (tmp, tmp, GEN_INT(-8192)));
emit_insn (gen_cmpdi (tmp, want));
emit_jump_insn (gen_bgtu (loop_label));
if (obey_regdecls)
gen_rtx_USE (VOIDmode, tmp);
memref = gen_rtx_MEM (DImode, want);
MEM_VOLATILE_P (memref) = 1;
......
......@@ -736,14 +736,8 @@ extern const char * structure_size_string;
#define SUBTARGET_CONDITIONAL_REGISTER_USAGE
#endif
/* If doing stupid life analysis, avoid a bug causing a return value r0 to be
trampled. This effectively reduces the number of available registers by 1.
XXX It is a hack, I know.
XXX Is this still needed? */
#define CONDITIONAL_REGISTER_USAGE \
{ \
if (obey_regdecls) \
fixed_regs[0] = 1; \
if (TARGET_SOFT_FLOAT) \
{ \
int regno; \
......
......@@ -61,13 +61,13 @@ handle_pragma (p_getc, p_ungetc, pname)
if (strcmp (pname, "CC_OPT_ON") == 0)
{
optimize = 1, obey_regdecls = 0;
optimize = 1;
warning ("optimization turned on");
retval = 1;
}
else if (strcmp (pname, "CC_OPT_OFF") == 0)
{
optimize = 0, obey_regdecls = 1;
optimize = 0;
warning ("optimization turned off");
retval = 1;
}
......@@ -76,13 +76,7 @@ handle_pragma (p_getc, p_ungetc, pname)
extern int initial_optimize_flag;
if (optimize != initial_optimize_flag)
{
if (initial_optimize_flag)
obey_regdecls = 0;
else
obey_regdecls = 1;
optimize = initial_optimize_flag;
}
optimize = initial_optimize_flag;
warning ("optimization level restored");
retval = 1;
}
......
......@@ -2364,14 +2364,6 @@ emit_eh_context ()
end_sequence ();
emit_insns_before (insns, insn);
/* At -O0, we must make the context register stay alive so
that the stupid.c register allocator doesn't get confused. */
if (obey_regdecls != 0)
{
insns = gen_rtx_USE (GET_MODE (XEXP (reg,0)), XEXP (reg,0));
emit_insn_before (insns, get_last_insn ());
}
}
}
}
......
......@@ -1556,10 +1556,6 @@ probe_stack_range (first, size)
emit_note (NULL_PTR, NOTE_INSN_LOOP_END);
emit_label (end_lab);
/* If will be doing stupid optimization, show test_addr is still live. */
if (obey_regdecls)
emit_insn (gen_rtx_USE (VOIDmode, test_addr));
emit_stack_probe (last_addr);
}
}
......
......@@ -57,11 +57,6 @@ extern int optimize;
extern int optimize_size;
/* Nonzero means do stupid register allocation. -noreg.
Currently, this is 1 if `optimize' is 0. */
extern int obey_regdecls;
/* Don't print functions as they are compiled and don't print
times taken by the various passes. -quiet. */
......
......@@ -436,7 +436,8 @@ find_basic_blocks (f, nregs, file, do_cleanup)
delete_unreachable_blocks ();
move_stray_eh_region_notes ();
record_active_eh_regions (f);
try_merge_blocks ();
if (optimize)
try_merge_blocks ();
}
/* Mark critical edges. */
......@@ -2447,9 +2448,14 @@ life_analysis (f, nregs, file, remove_dead_code)
/* We want alias analysis information for local dead store elimination. */
init_alias_analysis ();
flags = PROP_FINAL;
if (! remove_dead_code)
flags &= ~(PROP_SCAN_DEAD_CODE | PROP_KILL_DEAD_CODE);
if (! optimize)
flags = PROP_DEATH_NOTES | PROP_REG_INFO;
else
{
flags = PROP_FINAL;
if (! remove_dead_code)
flags &= ~(PROP_SCAN_DEAD_CODE | PROP_KILL_DEAD_CODE);
}
life_analysis_1 (f, nregs, flags);
if (! reload_completed)
......@@ -2835,15 +2841,9 @@ mark_regs_live_at_end (set)
}
/* Mark function return value. */
/* ??? Only do this after reload. Consider a non-void function that
omits a return statement. Across that edge we'll have the return
register live, and no set for it. Thus the return register will
be live back through the CFG to the entry, and thus we die. A
possible solution is to emit a clobber at exits without returns. */
type = TREE_TYPE (DECL_RESULT (current_function_decl));
if (reload_completed
&& type != void_type_node)
if (type != void_type_node)
{
rtx outgoing;
......@@ -4643,12 +4643,6 @@ mark_used_regs (needed, live, x, flags, insn)
}
break;
case RETURN:
/* ??? This info should have been gotten from mark_regs_live_at_end,
as applied to the EXIT block, and propagated along the edge that
connects this block to the EXIT. */
break;
case ASM_OPERANDS:
case UNSPEC_VOLATILE:
case TRAP_IF:
......@@ -5112,8 +5106,7 @@ print_rtl_with_bb (outf, rtx_first)
if (in_bb_p[INSN_UID(tmp_rtx)] == NOT_IN_BB
&& GET_CODE (tmp_rtx) != NOTE
&& GET_CODE (tmp_rtx) != BARRIER
&& ! obey_regdecls)
&& GET_CODE (tmp_rtx) != BARRIER)
fprintf (outf, ";; Insn is not within a basic block\n");
else if (in_bb_p[INSN_UID(tmp_rtx)] == IN_MULTIPLE_BB)
fprintf (outf, ";; Insn is in multiple basic blocks\n");
......
......@@ -3916,45 +3916,6 @@ delete_handlers ()
}
}
/* Output a USE for any register use in RTL.
This is used with -noreg to mark the extent of lifespan
of any registers used in a user-visible variable's DECL_RTL. */
void
use_variable (rtl)
rtx rtl;
{
if (GET_CODE (rtl) == REG)
/* This is a register variable. */
emit_insn (gen_rtx_USE (VOIDmode, rtl));
else if (GET_CODE (rtl) == MEM
&& GET_CODE (XEXP (rtl, 0)) == REG
&& (REGNO (XEXP (rtl, 0)) < FIRST_VIRTUAL_REGISTER
|| REGNO (XEXP (rtl, 0)) > LAST_VIRTUAL_REGISTER)
&& XEXP (rtl, 0) != current_function_internal_arg_pointer)
/* This is a variable-sized structure. */
emit_insn (gen_rtx_USE (VOIDmode, XEXP (rtl, 0)));
}
/* Like use_variable except that it outputs the USEs after INSN
instead of at the end of the insn-chain. */
void
use_variable_after (rtl, insn)
rtx rtl, insn;
{
if (GET_CODE (rtl) == REG)
/* This is a register variable. */
emit_insn_after (gen_rtx_USE (VOIDmode, rtl), insn);
else if (GET_CODE (rtl) == MEM
&& GET_CODE (XEXP (rtl, 0)) == REG
&& (REGNO (XEXP (rtl, 0)) < FIRST_VIRTUAL_REGISTER
|| REGNO (XEXP (rtl, 0)) > LAST_VIRTUAL_REGISTER)
&& XEXP (rtl, 0) != current_function_internal_arg_pointer)
/* This is a variable-sized structure. */
emit_insn_after (gen_rtx_USE (VOIDmode, XEXP (rtl, 0)), insn);
}
int
max_parm_reg_num ()
{
......@@ -4495,7 +4456,8 @@ assign_parms (fndecl)
}
DECL_RTL (parm) = stack_parm;
}
else if (! ((obey_regdecls && ! DECL_REGISTER (parm)
else if (! ((! optimize
&& ! DECL_REGISTER (parm)
&& ! DECL_INLINE (fndecl))
/* layout_decl may set this. */
|| TREE_ADDRESSABLE (parm)
......@@ -4579,7 +4541,8 @@ assign_parms (fndecl)
/* If we were passed a pointer but the actual value
can safely live in a register, put it in one. */
if (passed_pointer && TYPE_MODE (TREE_TYPE (parm)) != BLKmode
&& ! ((obey_regdecls && ! DECL_REGISTER (parm)
&& ! ((! optimize
&& ! DECL_REGISTER (parm)
&& ! DECL_INLINE (fndecl))
/* layout_decl may set this. */
|| TREE_ADDRESSABLE (parm)
......@@ -6064,32 +6027,19 @@ expand_function_start (subr, parms_have_cleanups)
as opposed to parm setup. */
emit_note (NULL_PTR, NOTE_INSN_FUNCTION_BEG);
/* If doing stupid allocation, mark parms as born here. */
if (GET_CODE (get_last_insn ()) != NOTE)
emit_note (NULL_PTR, NOTE_INSN_DELETED);
parm_birth_insn = get_last_insn ();
if (obey_regdecls)
{
for (i = LAST_VIRTUAL_REGISTER + 1; i < max_parm_reg; i++)
use_variable (regno_reg_rtx[i]);
if (current_function_internal_arg_pointer != virtual_incoming_args_rtx)
use_variable (current_function_internal_arg_pointer);
}
context_display = 0;
if (current_function_needs_context)
{
/* Fetch static chain values for containing functions. */
tem = decl_function_context (current_function_decl);
/* If not doing stupid register allocation copy the static chain
pointer into a pseudo. If we have small register classes, copy
the value from memory if static_chain_incoming_rtx is a REG. If
we do stupid register allocation, we use the stack address
generated above. */
if (tem && ! obey_regdecls)
/* Copy the static chain pointer into a pseudo. If we have
small register classes, copy the value from memory if
static_chain_incoming_rtx is a REG. */
if (tem)
{
/* If the static chain originally came in a register, put it back
there, then move it out in the next insn. The reason for
......@@ -6349,27 +6299,6 @@ expand_function_end (filename, line, end_bindings)
until next function's body starts. */
immediate_size_expand--;
/* If doing stupid register allocation,
mark register parms as dying here. */
if (obey_regdecls)
{
rtx tem;
for (i = LAST_VIRTUAL_REGISTER + 1; i < max_parm_reg; i++)
use_variable (regno_reg_rtx[i]);
/* Likewise for the regs of all the SAVE_EXPRs in the function. */
for (tem = save_expr_regs; tem; tem = XEXP (tem, 1))
{
use_variable (XEXP (tem, 0));
use_variable_after (XEXP (tem, 0), parm_birth_insn);
}
if (current_function_internal_arg_pointer != virtual_incoming_args_rtx)
use_variable (current_function_internal_arg_pointer);
}
clear_pending_stack_adjust ();
do_pending_stack_adjust ();
......@@ -6488,7 +6417,6 @@ expand_function_end (filename, line, end_bindings)
GET_MODE (DECL_RTL (DECL_RESULT (current_function_decl))));
emit_move_insn (real_decl_result,
DECL_RTL (DECL_RESULT (current_function_decl)));
emit_insn (gen_rtx_USE (VOIDmode, real_decl_result));
/* The delay slot scheduler assumes that current_function_return_rtx
holds the hard register containing the return value, not a temporary
......@@ -6522,7 +6450,6 @@ expand_function_end (filename, line, end_bindings)
REG_FUNCTION_VALUE_P (outgoing) = 1;
emit_move_insn (outgoing, value_address);
use_variable (outgoing);
}
/* If this is an implementation of __throw, do what's necessary to
......
......@@ -305,7 +305,6 @@ static void dump_conflicts PARAMS ((FILE *));
static void reg_becomes_live PARAMS ((rtx, rtx, void *));
static void reg_dies PARAMS ((int, enum machine_mode,
struct insn_chain *));
static void build_insn_chain PARAMS ((rtx));
/* Perform allocation of pseudo-registers not allocated by local_alloc.
FILE is a file to output debugging information on,
......@@ -1757,7 +1756,7 @@ reg_dies (regno, mode, chain)
/* Walk the insns of the current function and build reload_insn_chain,
and record register life information. */
static void
void
build_insn_chain (first)
rtx first;
{
......
......@@ -1099,13 +1099,6 @@ expand_inline_function (fndecl, parms, target, ignore, type,
pattern = PATTERN (insn);
set = single_set (insn);
copy = 0;
if (GET_CODE (pattern) == USE
&& GET_CODE (XEXP (pattern, 0)) == REG
&& REG_FUNCTION_VALUE_P (XEXP (pattern, 0)))
/* The (USE (REG n)) at return from the function should
be ignored since we are changing (REG n) into
inline_target. */
break;
/* If the inline fn needs eh context, make sure that
the current fn has one. */
......
......@@ -112,7 +112,7 @@ static void delete_barrier_successors PARAMS ((rtx));
static void mark_all_labels PARAMS ((rtx, int));
static rtx delete_unreferenced_labels PARAMS ((rtx));
static void delete_noop_moves PARAMS ((rtx));
static int calculate_can_reach_end PARAMS ((rtx, int, int));
static int calculate_can_reach_end PARAMS ((rtx, int));
static int duplicate_loop_exit_test PARAMS ((rtx));
static void find_cross_jump PARAMS ((rtx, rtx, int, rtx *, rtx *));
static void do_cross_jump PARAMS ((rtx, rtx, rtx));
......@@ -232,24 +232,8 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
last_insn = delete_unreferenced_labels (f);
if (optimize == 0)
{
/* CAN_REACH_END is persistent for each function. Once set it should
not be cleared. This is especially true for the case where we
delete the NOTE_FUNCTION_END note. CAN_REACH_END is cleared by
the front-end before compiling each function. */
if (calculate_can_reach_end (last_insn, 1, 0))
can_reach_end = 1;
/* Zero the "deleted" flag of all the "deleted" insns. */
for (insn = f; insn; insn = NEXT_INSN (insn))
INSN_DELETED_P (insn) = 0;
goto end;
}
#ifdef HAVE_return
if (HAVE_return)
if (optimize && HAVE_return)
{
/* If we fall through to the epilogue, see if we can insert a RETURN insn
in front of it. If the machine allows it at this point (we might be
......@@ -275,7 +259,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
This helps some of the optimizations below by having less insns
being jumped around. */
if (! reload_completed && after_regscan)
if (optimize && ! reload_completed && after_regscan)
for (insn = f; insn; insn = next)
{
rtx set = single_set (insn);
......@@ -389,6 +373,9 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
}
}
if (! optimize)
continue;
/* If a jump references the end of the function, try to turn
it into a RETURN insn, possibly a conditional one. */
if (JUMP_LABEL (insn) != 0
......@@ -986,7 +973,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
CALL_INSN, which some machines, such as the ARC, can do, but
this is a very minor optimization. */
if (this_is_condjump && ! this_is_simplejump
&& cse_not_expected && optimize > 0 && ! reload_completed
&& cse_not_expected && ! reload_completed
&& BRANCH_COST > 2
&& can_reverse_comparison_p (XEXP (SET_SRC (PATTERN (insn)), 0),
insn))
......@@ -2008,8 +1995,6 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
#endif
else
{
/* Detect a jump to a jump. */
/* Look for if (foo) bar; else break; */
/* The insns look like this:
insn = condjump label1;
......@@ -2300,7 +2285,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
not be cleared. This is especially true for the case where we
delete the NOTE_FUNCTION_END note. CAN_REACH_END is cleared by
the front-end before compiling each function. */
if (calculate_can_reach_end (last_insn, 0, 1))
if (calculate_can_reach_end (last_insn, optimize != 0))
can_reach_end = 1;
end:
......@@ -2711,9 +2696,8 @@ delete_noop_moves (f)
if we find it. */
static int
calculate_can_reach_end (last, check_deleted, delete_final_note)
calculate_can_reach_end (last, delete_final_note)
rtx last;
int check_deleted;
int delete_final_note;
{
rtx insn = last;
......@@ -2751,9 +2735,7 @@ calculate_can_reach_end (last, check_deleted, delete_final_note)
/* See if we backed up to the appropriate type of note. */
if (insn != NULL_RTX
&& GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_END
&& (check_deleted == 0
|| ! INSN_DELETED_P (insn)))
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_FUNCTION_END)
{
if (delete_final_note)
delete_insn (insn);
......@@ -4320,8 +4302,7 @@ delete_insn (insn)
/* Don't delete user-declared labels. Convert them to special NOTEs
instead. */
if (was_code_label && LABEL_NAME (insn) != 0
&& optimize && ! dont_really_delete)
if (was_code_label && LABEL_NAME (insn) != 0 && ! dont_really_delete)
{
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED_LABEL;
......@@ -4347,7 +4328,7 @@ delete_insn (insn)
/* Patch out INSN (and the barrier if any) */
if (optimize && ! dont_really_delete)
if (! dont_really_delete)
{
if (prev)
{
......
......@@ -1110,7 +1110,8 @@ block_alloc (b)
If tying is done, WIN is set nonzero. */
if (recog_data.n_operands > 1
if (optimize
&& recog_data.n_operands > 1
&& recog_data.constraints[0][0] == '='
&& recog_data.constraints[0][1] != '&')
{
......@@ -1194,7 +1195,8 @@ block_alloc (b)
destination register won't have had a quantity number
assigned, since that would prevent combining. */
if (GET_CODE (PATTERN (insn)) == CLOBBER
if (optimize
&& GET_CODE (PATTERN (insn)) == CLOBBER
&& (r0 = XEXP (PATTERN (insn), 0),
GET_CODE (r0) == REG)
&& (link = find_reg_note (insn, REG_LIBCALL, NULL_RTX)) != 0
......
......@@ -1503,12 +1503,10 @@ extern void record_excess_regs PARAMS ((rtx, rtx, rtx *));
extern void reposition_prologue_and_epilogue_notes PARAMS ((rtx));
extern void thread_prologue_and_epilogue_insns PARAMS ((rtx));
extern int prologue_epilogue_contains PARAMS ((rtx));
extern void use_variable PARAMS ((rtx));
extern HOST_WIDE_INT get_frame_size PARAMS ((void));
extern void preserve_rtl_expr_result PARAMS ((rtx));
extern void mark_temp_addr_taken PARAMS ((rtx));
extern void update_temp_slot_address PARAMS ((rtx, rtx));
extern void use_variable_after PARAMS ((rtx, rtx));
extern void purge_addressof PARAMS ((rtx));
/* In reload.c */
......@@ -1562,6 +1560,7 @@ extern void dump_global_regs PARAMS ((FILE *));
#ifdef HARD_CONST
extern void retry_global_alloc PARAMS ((int, HARD_REG_SET));
#endif
extern void build_insn_chain PARAMS ((rtx));
/* In regclass.c */
extern int reg_classes_intersect_p PARAMS ((enum reg_class, enum reg_class));
......
......@@ -2722,8 +2722,6 @@ expand_value_return (val)
emit_move_insn (return_reg, val);
}
diddle_return_value (USE);
/* Does any pending block have cleanups? */
while (block && block->data.block.cleanups == 0)
......@@ -3689,14 +3687,6 @@ expand_end_bindings (vars, mark_ends, dont_jump_in)
/* Get rid of the beginning-mark if we don't make an end-mark. */
NOTE_LINE_NUMBER (thisblock->data.block.first_insn) = NOTE_INSN_DELETED;
/* If doing stupid register allocation, make sure lives of all
register variables declared here extend thru end of scope. */
if (obey_regdecls)
for (decl = vars; decl; decl = TREE_CHAIN (decl))
if (TREE_CODE (decl) == VAR_DECL && DECL_RTL (decl))
use_variable (DECL_RTL (decl));
/* Restore the temporary level of TARGET_EXPRs. */
target_temp_slot_level = thisblock->data.block.block_target_temp_slot_level;
......@@ -3757,7 +3747,7 @@ expand_decl (decl)
&& TREE_CODE (type) == REAL_TYPE)
&& ! TREE_THIS_VOLATILE (decl)
&& ! TREE_ADDRESSABLE (decl)
&& (DECL_REGISTER (decl) || ! obey_regdecls)
&& (DECL_REGISTER (decl) || optimize)
/* if -fcheck-memory-usage, check all variables. */
&& ! current_function_check_memory_usage)
{
......@@ -3889,15 +3879,7 @@ expand_decl (decl)
if (TREE_READONLY (decl))
RTX_UNCHANGING_P (DECL_RTL (decl)) = 1;
#endif
/* If doing stupid register allocation, make sure life of any
register variable starts here, at the start of its scope. */
if (obey_regdecls)
use_variable (DECL_RTL (decl));
}
/* Emit code to perform the initialization of a declaration DECL. */
......
......@@ -362,11 +362,6 @@ int pedantic = 0;
int in_system_header = 0;
/* Nonzero means do stupid register allocation.
Currently, this is 1 if `optimize' is 0. */
int obey_regdecls = 0;
/* Don't print functions as they are compiled and don't print
times taken by the various passes. -quiet. */
......@@ -3207,13 +3202,6 @@ rest_of_compilation (decl)
ggc_collect ();
}
/* Now we choose between stupid (pcc-like) register allocation
(if we got the -noreg switch and not -opt)
and smart register allocation. */
if (optimize > 0) /* Stupid allocation probably won't work */
obey_regdecls = 0; /* if optimizations being done. */
regclass_init ();
/* Print function header into flow dump now
......@@ -3222,34 +3210,23 @@ rest_of_compilation (decl)
if (flow_dump)
open_dump_file (".08.flow", decl_printable_name (decl, 2));
if (obey_regdecls)
{
TIMEVAR (flow_time,
{
regclass (insns, max_reg_num (), NULL);
stupid_life_analysis (insns, max_reg_num (),
rtl_dump_file);
});
}
else
{
/* Do control and data flow analysis,
and write some of the results to dump file. */
/* Do control and data flow analysis; wrote some of the results to
the dump file. */
TIMEVAR
(flow_time,
{
find_basic_blocks (insns, max_reg_num (), rtl_dump_file, 1);
calculate_loop_depth (rtl_dump_file);
life_analysis (insns, max_reg_num (), rtl_dump_file, 1);
});
TIMEVAR
(flow_time,
{
find_basic_blocks (insns, max_reg_num (), rtl_dump_file, 1);
if (optimize)
calculate_loop_depth (rtl_dump_file);
life_analysis (insns, max_reg_num (), rtl_dump_file, 1);
});
if (warn_uninitialized || extra_warnings)
{
uninitialized_vars_warning (DECL_INITIAL (decl));
if (extra_warnings)
setjmp_args_warning ();
}
if (warn_uninitialized || extra_warnings)
{
uninitialized_vars_warning (DECL_INITIAL (decl));
if (extra_warnings)
setjmp_args_warning ();
}
/* Dump rtl after flow analysis. */
......@@ -3344,24 +3321,20 @@ rest_of_compilation (decl)
if (local_reg_dump)
open_dump_file (".12.lreg", decl_printable_name (decl, 2));
/* Unless we did stupid register allocation,
allocate pseudo-regs that are used only within 1 basic block.
/* Allocate pseudo-regs that are used only within 1 basic block.
RUN_JUMP_AFTER_RELOAD records whether or not we need to rerun the
jump optimizer after register allocation and reloading are finished. */
if (!obey_regdecls)
TIMEVAR (local_alloc_time,
{
/* We recomputed reg usage as part of updating the rest
of life info during sched. */
if (! flag_schedule_insns)
recompute_reg_usage (insns, ! optimize_size);
regclass (insns, max_reg_num (), rtl_dump_file);
rebuild_label_notes_after_reload = local_alloc ();
});
else
rebuild_label_notes_after_reload = 0;
TIMEVAR (local_alloc_time,
{
/* We recomputed reg usage as part of updating the rest
of life info during sched. */
if (! flag_schedule_insns)
recompute_reg_usage (insns, ! optimize_size);
regclass (insns, max_reg_num (), rtl_dump_file);
rebuild_label_notes_after_reload = local_alloc ();
});
/* Dump rtl code after allocating regs within basic blocks. */
......@@ -3381,19 +3354,20 @@ rest_of_compilation (decl)
if (global_reg_dump)
open_dump_file (".13.greg", decl_printable_name (decl, 2));
/* Unless we did stupid register allocation,
allocate remaining pseudo-regs, then do the reload pass
fixing up any insns that are invalid. */
/* If optimizing, allocate remaining pseudo-regs. Do the reload
pass fixing up any insns that are invalid. */
TIMEVAR (global_alloc_time,
{
if (!obey_regdecls)
if (optimize)
failure = global_alloc (rtl_dump_file);
else
failure = reload (insns, 0, rtl_dump_file);
{
build_insn_chain (insns);
failure = reload (insns, 0, rtl_dump_file);
}
});
if (failure)
goto exit_rest_of_compilation;
......@@ -3507,10 +3481,8 @@ rest_of_compilation (decl)
= optimize > 0 && only_leaf_regs_used () && leaf_function_p ();
#endif
/* One more attempt to remove jumps to .+1
left by dead-store-elimination.
Also do cross-jumping this time
and delete no-op move insns. */
/* One more attempt to remove jumps to .+1 left by dead-store elimination.
Also do cross-jumping this time and delete no-op move insns. */
if (optimize > 0)
{
......@@ -4573,8 +4545,6 @@ main (argc, argv)
}
}
obey_regdecls = (optimize == 0);
if (optimize >= 1)
{
flag_defer_pop = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment