jump.c (jump_optimize_1): If we did cross-jumping, and the data will matter, rebuild the CFG.
* 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. From-SVN: r30223
This commit is contained in:
parent
163537f7f1
commit
e218fc41a8
@ -1,3 +1,12 @@
|
||||
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.
|
||||
|
23
gcc/jump.c
23
gcc/jump.c
@ -66,6 +66,8 @@ Boston, MA 02111-1307, USA. */
|
||||
#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
|
||||
@ -190,6 +192,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
|
||||
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;
|
||||
@ -2127,6 +2130,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
|
||||
|
||||
if (newjpos != 0)
|
||||
{
|
||||
did_cross_jump = 1;
|
||||
do_cross_jump (insn, newjpos, newlpos);
|
||||
/* Make the old conditional jump
|
||||
into an unconditional one. */
|
||||
@ -2179,6 +2183,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
|
||||
|
||||
if (newjpos != 0)
|
||||
{
|
||||
did_cross_jump = 1;
|
||||
do_cross_jump (insn, newjpos, newlpos);
|
||||
changed = 1;
|
||||
next = insn;
|
||||
@ -2210,6 +2215,7 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
|
||||
|
||||
if (newjpos != 0)
|
||||
{
|
||||
did_cross_jump = 1;
|
||||
do_cross_jump (insn, newjpos, newlpos);
|
||||
changed = 1;
|
||||
next = insn;
|
||||
@ -2274,6 +2280,23 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
|
||||
|
||||
/* 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
|
||||
}
|
||||
|
||||
/* Initialize LABEL_NUSES and JUMP_LABEL fields. Delete any REG_LABEL
|
||||
|
@ -406,8 +406,7 @@ pop_stack (regstack, regno)
|
||||
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. */
|
||||
@ -430,16 +429,19 @@ reg_to_stack (first, file)
|
||||
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));
|
||||
@ -488,9 +490,6 @@ reg_to_stack (first, file)
|
||||
{
|
||||
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);
|
||||
|
12
gcc/toplev.c
12
gcc/toplev.c
@ -4333,12 +4333,6 @@ rest_of_compilation (decl)
|
||||
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));
|
||||
@ -4356,6 +4350,12 @@ rest_of_compilation (decl)
|
||||
ggc_collect ();
|
||||
#endif
|
||||
|
||||
/* Shorten branches. */
|
||||
TIMEVAR (shorten_branch_time,
|
||||
{
|
||||
shorten_branches (get_insns ());
|
||||
});
|
||||
|
||||
/* Now turn the rtl into assembler code. */
|
||||
|
||||
TIMEVAR (final_time,
|
||||
|
Loading…
Reference in New Issue
Block a user