* cfgexpand.c (tree_expand_cfg): Fix comment.
* calls.c (expand_call): Ignore rtx_equal_function_value_matters.
* function.c (purge_single_hard_subreg_set, purge_hard_subreg_sets):
Remove.
(prepare_function_start): Don't set rtx_equal_function_value_matters.
* integrate.c (copy_rtx_and_substitute): Don't test for it.
* passes.c (rest_of_compilation): Don't call purge_hard_subreg_sets.
Don't set rtx_equal_function_value_matters. Don't register RTL hooks
here again. Update leading comment.
* rtl.c (rtx_equal_function_value_matters): Remove.
(rtx_equal_p): Don't test for it.
* simplify-rtx.c (simplify_binary_operation, simplify_subreg):
Likewise.
* rtl.h (enum insn_note): Remove NOTE_INSN_LOOP_END_TOP_COND.
* rtl.c (note_insn_name): Likewise.
* emit-rtl.c (remove_unnecessary_notes): Don't handle it.
* final.c (final_scan_insn): Likewise.
* except.c (finish_eh_generation): Don't call cfg_cleanup from here.
* passes.c (rest_of_handle_eh): Do it here.
* stmt.c (struct nesting): Remove struct nesting block member.
(struct stmt_status): Remove x_block_start_count field.
(current_block_start_count): Remove.
From-SVN: r85228
+2004-07-27 Steven Bosscher <stevenb@suse.de>
+
+ * cfgexpand.c (tree_expand_cfg): Fix comment.
+
+ * calls.c (expand_call): Ignore rtx_equal_function_value_matters.
+ * function.c (purge_single_hard_subreg_set, purge_hard_subreg_sets):
+ Remove.
+ (prepare_function_start): Don't set rtx_equal_function_value_matters.
+ * integrate.c (copy_rtx_and_substitute): Don't test for it.
+ * passes.c (rest_of_compilation): Don't call purge_hard_subreg_sets.
+ Don't set rtx_equal_function_value_matters. Don't register RTL hooks
+ here again. Update leading comment.
+ * rtl.c (rtx_equal_function_value_matters): Remove.
+ (rtx_equal_p): Don't test for it.
+ * simplify-rtx.c (simplify_binary_operation, simplify_subreg):
+ Likewise.
+
+ * rtl.h (enum insn_note): Remove NOTE_INSN_LOOP_END_TOP_COND.
+ * rtl.c (note_insn_name): Likewise.
+ * emit-rtl.c (remove_unnecessary_notes): Don't handle it.
+ * final.c (final_scan_insn): Likewise.
+
+ * except.c (finish_eh_generation): Don't call cfg_cleanup from here.
+ * passes.c (rest_of_handle_eh): Do it here.
+
+ * stmt.c (struct nesting): Remove struct nesting block member.
+ (struct stmt_status): Remove x_block_start_count field.
+ (current_block_start_count): Remove.
+
2004-07-27 Brian Booth <bbooth@redhat.com>
* tree-optimize.c (register_one_dump_file): Update condition that uses
2004-07-26 Paolo Bonzini <bonzini@gnu.org>
- * config/i386/i386.c (function_arg): Always treat 8-
- and 16-byte wide vectors the same, even if MMX/SSE
- are disabled.
- (contains_128bit_aligned_vector_p): Add comment.
+ * config/i386/i386.c (function_arg): Always treat 8-
+ and 16-byte wide vectors the same, even if MMX/SSE
+ are disabled.
+ (contains_128bit_aligned_vector_p): Add comment.
2004-07-26 J"orn Rennecke <joern.rennecke@superh.com>
/* Tail calls can make things harder to debug, and we've traditionally
pushed these optimizations into -O2. Don't try if we're already
expanding a call, as that means we're an argument. Don't try if
- there's cleanups, as we know there's code to follow the call.
-
- If rtx_equal_function_value_matters is false, that means we've
- finished with regular parsing. Which means that some of the
- machinery we use to generate tail-calls is no longer in place.
- This is most often true of sjlj-exceptions, which we couldn't
- tail-call to anyway. */
+ there's cleanups, as we know there's code to follow the call. */
if (currently_expanding_call++ != 0
|| !flag_optimize_sibling_calls
- || !rtx_equal_function_value_matters
|| args_size.var
|| lookup_stmt_eh_region (exp) >= 0)
try_tail_call = 0;
&& DECL_FILE_SCOPE_P (current_function_decl))
expand_main_function ();
- /* Write the flowgraph to a dot file. */
+ /* Register rtl specific functions for cfg. */
rtl_register_cfg_hooks ();
init_block = construct_init_block ();
switch (NOTE_LINE_NUMBER (insn))
{
case NOTE_INSN_DELETED:
- case NOTE_INSN_LOOP_END_TOP_COND:
remove_insn (insn);
break;
connect many of the handlers, and then type information will not
be effective. Still, this is a win over previous implementations. */
- cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
-
/* These registers are used by the landing pads. Make sure they
have been generated. */
get_exception_pointer (cfun);
if (eh)
rtl_make_eh_edge (NULL, bb, BB_END (bb));
}
- cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
}
\f
static hashval_t
case NOTE_INSN_DELETED:
case NOTE_INSN_LOOP_BEG:
case NOTE_INSN_LOOP_END:
- case NOTE_INSN_LOOP_END_TOP_COND:
case NOTE_INSN_LOOP_CONT:
case NOTE_INSN_LOOP_VTOP:
case NOTE_INSN_FUNCTION_END:
#ifdef HAVE_return
static void emit_return_into_block (basic_block, rtx);
#endif
-static void purge_single_hard_subreg_set (rtx);
#if defined(HAVE_epilogue) && defined(INCOMING_RETURN_ADDR_RTX)
static rtx keep_stack_depressed (rtx);
#endif
lang_hooks.function.leave_nested (p);
/* Reset variables that have known state during rtx generation. */
- rtx_equal_function_value_matters = 1;
virtuals_instantiated = 0;
generating_concat_p = 1;
}
#define ARG_POINTER_CFA_OFFSET(FNDECL) FIRST_PARM_OFFSET (FNDECL)
#endif
-\f
-/* Convert a SET of a hard subreg to a set of the appropriate hard
- register. A subroutine of purge_hard_subreg_sets. */
-
-static void
-purge_single_hard_subreg_set (rtx pattern)
-{
- rtx reg = SET_DEST (pattern);
- enum machine_mode mode = GET_MODE (SET_DEST (pattern));
- int offset = 0;
-
- if (GET_CODE (reg) == SUBREG && REG_P (SUBREG_REG (reg))
- && REGNO (SUBREG_REG (reg)) < FIRST_PSEUDO_REGISTER)
- {
- offset = subreg_regno_offset (REGNO (SUBREG_REG (reg)),
- GET_MODE (SUBREG_REG (reg)),
- SUBREG_BYTE (reg),
- GET_MODE (reg));
- reg = SUBREG_REG (reg);
- }
-
-
- if (REG_P (reg) && REGNO (reg) < FIRST_PSEUDO_REGISTER)
- {
- reg = gen_rtx_REG (mode, REGNO (reg) + offset);
- SET_DEST (pattern) = reg;
- }
-}
-
-/* Eliminate all occurrences of SETs of hard subregs from INSNS. The
- only such SETs that we expect to see are those left in because
- integrate can't handle sets of parts of a return value register.
-
- We don't use alter_subreg because we only want to eliminate subregs
- of hard registers. */
-
-void
-purge_hard_subreg_sets (rtx insn)
-{
- for (; insn; insn = NEXT_INSN (insn))
- {
- if (INSN_P (insn))
- {
- rtx pattern = PATTERN (insn);
- switch (GET_CODE (pattern))
- {
- case SET:
- if (GET_CODE (SET_DEST (pattern)) == SUBREG)
- purge_single_hard_subreg_set (pattern);
- break;
- case PARALLEL:
- {
- int j;
- for (j = XVECLEN (pattern, 0) - 1; j >= 0; j--)
- {
- rtx inner_pattern = XVECEXP (pattern, 0, j);
- if (GET_CODE (inner_pattern) == SET
- && GET_CODE (SET_DEST (inner_pattern)) == SUBREG)
- purge_single_hard_subreg_set (inner_pattern);
- }
- }
- break;
- default:
- break;
- }
- }
- }
-}
\f
/* Pass through the INSNS of function FNDECL and convert virtual register
references to hard register references. */
/* We haven't done register allocation yet. */
reg_renumber = 0;
- /* Indicate that we need to distinguish between the return value of the
- present function and the return value of a function being called. */
- rtx_equal_function_value_matters = 1;
-
/* Indicate that we have not instantiated virtual registers yet. */
virtuals_instantiated = 0;
emit_insn_after (seq, map->insns_at_start);
return temp;
}
- else if (REG_FUNCTION_VALUE_P (orig))
- {
- if (rtx_equal_function_value_matters)
- /* This is an ignored return value. We must not
- leave it in with REG_FUNCTION_VALUE_P set, since
- that would confuse subsequent inlining of the
- current function into a later function. */
- return gen_rtx_REG (GET_MODE (orig), regno);
- else
- /* Must be unrolling loops or replicating code if we
- reach here, so return the register unchanged. */
- return orig;
- }
else
return orig;
timevar_push (TV_JUMP);
open_dump_file (DFI_eh, current_function_decl);
+ cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
+
finish_eh_generation ();
+ cleanup_cfg (CLEANUP_PRE_LOOP | CLEANUP_NO_INSN_DEL);
+
close_dump_file (DFI_eh, print_rtl, get_insns ());
timevar_pop (TV_JUMP);
}
}
\f
-/* This is called from finish_function (within langhooks.parse_file)
- after each top-level definition is parsed.
- It is supposed to compile that function or variable
- and output the assembler code for it.
- After we return, the tree storage is freed. */
+/* This function is called from the pass manager in tree-optimize.c
+ after all tree passes have finished for a single function, and we
+ have expanded the function body from trees to RTL.
+ Once we are here, we have decided that we're supposed to output
+ that function, ie. that we should write assembler code for it.
+
+ We run a series of low-level passes here on the function's RTL
+ representation. Each pass is called via a rest_of_* function. */
void
rest_of_compilation (void)
know we want to output it. */
DECL_DEFER_OUTPUT (current_function_decl) = 0;
- /* Register rtl specific functions for cfg. */
- rtl_register_cfg_hooks ();
-
- /* Now that we're out of the frontend, we shouldn't have any more
- CONCATs anywhere. */
+ /* Now that we're done expanding trees to RTL, we shouldn't have any
+ more CONCATs anywhere. */
generating_concat_p = 0;
/* When processing delayed functions, prepare_function_start () won't
TREE_ASM_WRITTEN (current_function_decl) = 1;
- /* Now that integrate will no longer see our rtl, we need not
- distinguish between the return value of this function and the
- return value of called functions. Also, we can remove all SETs
- of subregs of hard registers; they are only here because of
- integrate. Also, we can now initialize pseudos intended to
- carry magic hard reg data throughout the function.
-
- FIXME: All this looks thoroughly obsolete... maybe we can
- get rid of both these lines unconditionally? */
- rtx_equal_function_value_matters = 0;
- purge_hard_subreg_sets (get_insns ());
-
/* Early return if there were errors. We can run afoul of our
consistency checks, and there's not really much point in fixing them. */
if (rtl_dump_and_exit || flag_syntax_only || errorcount || sorrycount)
"NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END",
"NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END",
"NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP",
- "NOTE_INSN_LOOP_END_TOP_COND", "NOTE_INSN_FUNCTION_END",
+ "NOTE_INSN_FUNCTION_END",
"NOTE_INSN_PROLOGUE_END", "NOTE_INSN_EPILOGUE_BEG",
"NOTE_INSN_DELETED_LABEL", "NOTE_INSN_FUNCTION_BEG",
"NOTE_INSN_EH_REGION_BEG", "NOTE_INSN_EH_REGION_END",
return copy;
}
\f
-/* This is 1 until after the rtl generation pass. */
-int rtx_equal_function_value_matters;
-
/* Nonzero when we are generating CONCATs. */
int generating_concat_p;
\f
switch (code)
{
case REG:
- /* Until rtl generation is complete, don't consider a reference
- to the return register of the current function the same as
- the return from a called function. This eases the job of
- function integration. Once the distinction is no longer
- needed, they can be considered equivalent. */
- return (REGNO (x) == REGNO (y)
- && (! rtx_equal_function_value_matters
- || REG_FUNCTION_VALUE_P (x) == REG_FUNCTION_VALUE_P (y)));
+ return (REGNO (x) == REGNO (y));
case LABEL_REF:
return XEXP (x, 0) == XEXP (y, 0);
/* Generated at the start of a duplicated exit test. */
NOTE_INSN_LOOP_VTOP,
- /* Generated at the end of a conditional at the top of the loop.
- This is used to perform a lame form of loop rotation in lieu
- of actually understanding the loop structure. The note is
- discarded after rotation is complete. */
- NOTE_INSN_LOOP_END_TOP_COND,
-
/* This kind of note is generated at the end of the function body,
just before the return insn or return label. In an optimizing
compilation it is deleted by the first jump optimization, after
#define USE_STORE_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
#endif
\f
-/* Nonzero if we need to distinguish between the return value of this function
- and the return value of a function called by this function. This helps
- integrate.c.
- This is 1 until after the rtl generation pass.
- ??? It appears that this is 1 only when expanding trees to RTL. */
-extern int rtx_equal_function_value_matters;
-
/* Nonzero when we are generating CONCATs. */
extern int generating_concat_p;
extern int sibcall_epilogue_contains (rtx);
extern void mark_temp_addr_taken (rtx);
extern void update_temp_slot_address (rtx, rtx);
-extern void purge_hard_subreg_sets (rtx);
/* In stmt.c */
extern void set_file_and_line_for_stmt (location_t);
uppermost bit is set, then this isn't a power of two due
to implicit sign extension. */
&& (width <= HOST_BITS_PER_WIDE_INT
- || val != HOST_BITS_PER_WIDE_INT - 1)
- && ! rtx_equal_function_value_matters)
+ || val != HOST_BITS_PER_WIDE_INT - 1))
return simplify_gen_binary (ASHIFT, mode, op0, GEN_INT (val));
/* x*2 is x+x and x*(-1) is -x */
frame, or argument pointer, leave this as a SUBREG. */
if (REG_P (op)
- && (! REG_FUNCTION_VALUE_P (op)
- || ! rtx_equal_function_value_matters)
&& REGNO (op) < FIRST_PSEUDO_REGISTER
#ifdef CANNOT_CHANGE_MODE_CLASS
&& ! (REG_CANNOT_CHANGE_MODE_P (REGNO (op), innermode, outermode)
This may be the end of the if or the next else/elseif. */
rtx next_label;
} GTY ((tag ("COND_NESTING"))) cond;
- /* For variable binding contours. */
- struct nesting_block
- {
- /* Sequence number of this binding contour within the function,
- in order of entry. */
- int block_start_count;
- /* The NOTE that starts this contour.
- Used by expand_goto to check whether the destination
- is within each contour or not. */
- rtx first_insn;
- /* The saved target_temp_slot_level from our outer block.
- We may reset target_temp_slot_level to be the level of
- this block, if that is done, target_temp_slot_level
- reverts to the saved target_temp_slot_level at the very
- end of the block. */
- int block_target_temp_slot_level;
- } GTY ((tag ("BLOCK_NESTING"))) block;
/* For switch (C) or case (Pascal) statements. */
struct nesting_case
{
/* Number of entries on nesting_stack now. */
int x_nesting_depth;
- /* Number of binding contours started so far in this function. */
- int x_block_start_count;
-
/* Location of last line-number note, whether we actually
emitted it or not. */
location_t x_emit_locus;
#define case_stack (cfun->stmt->x_case_stack)
#define nesting_stack (cfun->stmt->x_nesting_stack)
#define nesting_depth (cfun->stmt->x_nesting_depth)
-#define current_block_start_count (cfun->stmt->x_block_start_count)
#define emit_locus (cfun->stmt->x_emit_locus)
static int n_occurrences (int, const char *);