+Wed Oct 27 15:21:46 1999 Richard Henderson <rth@cygnus.com>
+
+ * jump.c (jump_optimize_1): If we did cross-jumping, and
+ the data will matter, rebuild the CFG.
+ * reg-stack.c (reg_to_stack): Only (re)build the CFG if
+ not optimizing. Don't run shorten_branches.
+ * toplev.c (rest_of_compilation): Run shorten_branches after
+ reg_to_stack.
+
Wed Oct 27 12:33:40 1999 Mark Mitchell <mark@codesourcery.com>
* rtl.h (note_stores): Add additional paramter.
#include "expr.h"
#include "real.h"
#include "except.h"
+#include "basic-block.h"
+#include "output.h"
#include "toplev.h"
/* ??? Eventually must record somehow the labels used by jumps
int first = 1;
int max_uid = 0;
rtx last_insn;
+ int did_cross_jump = 0;
cross_jump_death_matters = (cross_jump == 2);
max_uid = init_label_info (f) + 1;
if (newjpos != 0)
{
+ did_cross_jump = 1;
do_cross_jump (insn, newjpos, newlpos);
/* Make the old conditional jump
into an unconditional one. */
if (newjpos != 0)
{
+ did_cross_jump = 1;
do_cross_jump (insn, newjpos, newlpos);
changed = 1;
next = insn;
if (newjpos != 0)
{
+ did_cross_jump = 1;
do_cross_jump (insn, newjpos, newlpos);
changed = 1;
next = insn;
/* Show JUMP_CHAIN no longer valid. */
jump_chain = 0;
+
+#if defined(DELAY_SLOTS) || defined(STACK_REGS)
+ /* ??? Keep the CFG up to date after cross-jumping. */
+ if (did_cross_jump && !cross_jump_death_matters)
+ {
+ sbitmap blocks;
+
+ find_basic_blocks (f, old_max_reg, NULL, 0);
+
+ blocks = sbitmap_alloc (n_basic_blocks);
+ sbitmap_ones (blocks);
+ count_or_remove_death_notes (blocks, 1);
+ sbitmap_free (blocks);
+
+ life_analysis (f, old_max_reg, NULL, 0);
+ }
+#endif
}
\f
/* Initialize LABEL_NUSES and JUMP_LABEL fields. Delete any REG_LABEL
register file. FIRST is the first insn in the function, FILE is the
dump file, if used.
- Construct a CFG and run life analysis. (When optimizing, the data
- was corruped by jump2's cross-jumping.) Then convert each insn one
+ Construct a CFG and run life analysis. Then convert each insn one
by one. Run a last jump_optimize pass, if optimizing, to eliminate
code duplication created when the converter inserts pop insns on
the edges. */
if (i > LAST_STACK_REG)
return;
- /* Ok, floating point instructions exist. Rebuild the CFG and run
- life analysis. */
- find_basic_blocks (first, max_reg_num (), file, 0);
+ /* Ok, floating point instructions exist. If not optimizing,
+ build the CFG and run life analysis. */
+ if (! optimize)
+ {
+ find_basic_blocks (first, max_reg_num (), file, 0);
- blocks = sbitmap_alloc (n_basic_blocks);
- sbitmap_ones (blocks);
- count_or_remove_death_notes (blocks, 1);
- sbitmap_free (blocks);
+ blocks = sbitmap_alloc (n_basic_blocks);
+ sbitmap_ones (blocks);
+ count_or_remove_death_notes (blocks, 1);
+ sbitmap_free (blocks);
- life_analysis (first, max_reg_num (), file, 0);
+ life_analysis (first, max_reg_num (), file, 0);
+ }
/* Set up block info for each basic block. */
bi = (block_info) alloca ((n_basic_blocks + 1) * sizeof (*bi));
{
jump_optimize (first, JUMP_CROSS_JUMP_DEATH_MATTERS,
!JUMP_NOOP_MOVES, !JUMP_AFTER_REGSCAN);
-
- /* This has the effect of resetting label alignments around loops. */
- shorten_branches (get_insns ());
}
VARRAY_FREE (stack_regs_mentioned_data);
ggc_collect ();
#endif
- /* Shorten branches. */
- TIMEVAR (shorten_branch_time,
- {
- shorten_branches (get_insns ());
- });
-
#ifdef STACK_REGS
if (stack_reg_dump)
open_dump_file (".20.stack", decl_printable_name (decl, 2));
ggc_collect ();
#endif
+ /* Shorten branches. */
+ TIMEVAR (shorten_branch_time,
+ {
+ shorten_branches (get_insns ());
+ });
+
/* Now turn the rtl into assembler code. */
TIMEVAR (final_time,