aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Sturm <jsturm@one-point.com>2003-12-01 17:53:10 +0000
committerJeff Sturm <jsturm@gcc.gnu.org>2003-12-01 17:53:10 +0000
commitfccab17eadb0b80031502a66403aa9541d531ce9 (patch)
tree005d5e86d024919a81e7b140971c58373890eb19 /gcc
parent095c3bbdbb5402b86d078a57e3c5f62abdba7d8b (diff)
downloadgcc-fccab17eadb0b80031502a66403aa9541d531ce9.zip
gcc-fccab17eadb0b80031502a66403aa9541d531ce9.tar.gz
gcc-fccab17eadb0b80031502a66403aa9541d531ce9.tar.bz2
re PR rtl-optimization/13024 (gcj can't build current rhug)
PR optimization/13024 * toplev.c (rest_of_handle_new_regalloc): Remove rebuild_notes parameter. (rest_of_handle_old_regalloc): Likewise. Add rebuild_notes declaration. Rebuild jump labels following local_alloc if necessary. (rest_of_compilation): Remove rebuild_label_notes_after_reload declaration. Don't pass rebuild_notes parameter to rest_of_handle_new_regalloc and rest_of_handle_old_regalloc. Don't rebuild jump labels. From-SVN: r74113
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/toplev.c45
2 files changed, 33 insertions, 24 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 00e4063..fbfad2b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2003-12-01 Jeff Sturm <jsturm@one-point.com>
+
+ PR optimization/13024
+ * toplev.c (rest_of_handle_new_regalloc): Remove rebuild_notes
+ parameter.
+ (rest_of_handle_old_regalloc): Likewise. Add rebuild_notes
+ declaration. Rebuild jump labels following local_alloc if necessary.
+ (rest_of_compilation): Remove rebuild_label_notes_after_reload
+ declaration. Don't pass rebuild_notes parameter to
+ rest_of_handle_new_regalloc and rest_of_handle_old_regalloc.
+ Don't rebuild jump labels.
+
2003-12-01 Jeff Law <law@redhat.com>
* flow.c (count_or_remove_death_notes_bb): New. Extracted from
diff --git a/gcc/toplev.c b/gcc/toplev.c
index bd1f37d..2956ac6 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -146,8 +146,8 @@ static void rest_of_handle_regmove (tree, rtx);
static void rest_of_handle_sched (tree, rtx);
static void rest_of_handle_sched2 (tree, rtx);
#endif
-static bool rest_of_handle_new_regalloc (tree, rtx, int *);
-static bool rest_of_handle_old_regalloc (tree, rtx, int *);
+static bool rest_of_handle_new_regalloc (tree, rtx);
+static bool rest_of_handle_old_regalloc (tree, rtx);
static void rest_of_handle_regrename (tree, rtx);
static void rest_of_handle_reorder_blocks (tree, rtx);
#ifdef STACK_REGS
@@ -2166,7 +2166,7 @@ rest_of_handle_machine_reorg (tree decl, rtx insns)
/* Run new register allocator. Return TRUE if we must exit
rest_of_compilation upon return. */
static bool
-rest_of_handle_new_regalloc (tree decl, rtx insns, int *rebuild_notes)
+rest_of_handle_new_regalloc (tree decl, rtx insns)
{
int failure;
@@ -2205,7 +2205,6 @@ rest_of_handle_new_regalloc (tree decl, rtx insns, int *rebuild_notes)
return true;
reload_completed = 1;
- *rebuild_notes = 0;
return false;
}
@@ -2213,9 +2212,10 @@ rest_of_handle_new_regalloc (tree decl, rtx insns, int *rebuild_notes)
/* Run old register allocator. Return TRUE if we must exit
rest_of_compilation upon return. */
static bool
-rest_of_handle_old_regalloc (tree decl, rtx insns, int *rebuild_notes)
+rest_of_handle_old_regalloc (tree decl, rtx insns)
{
int failure;
+ int rebuild_notes;
/* Allocate the reg_renumber array. */
allocate_reg_info (max_regno, FALSE, TRUE);
@@ -2226,10 +2226,23 @@ rest_of_handle_old_regalloc (tree decl, rtx insns, int *rebuild_notes)
allocate_initial_values (reg_equiv_memory_loc);
regclass (insns, max_reg_num (), rtl_dump_file);
- *rebuild_notes = local_alloc ();
+ rebuild_notes = local_alloc ();
timevar_pop (TV_LOCAL_ALLOC);
+ /* Local allocation may have turned an indirect jump into a direct
+ jump. If so, we must rebuild the JUMP_LABEL fields of jumping
+ instructions. */
+ if (rebuild_notes)
+ {
+ timevar_push (TV_JUMP);
+
+ rebuild_jump_labels (insns);
+ purge_all_dead_edges (0);
+
+ timevar_pop (TV_JUMP);
+ }
+
if (dump_file[DFI_lreg].enabled)
{
timevar_push (TV_DUMP);
@@ -3056,7 +3069,6 @@ void
rest_of_compilation (tree decl)
{
rtx insns;
- int rebuild_label_notes_after_reload;
timevar_push (TV_REST_OF_COMPILATION);
@@ -3360,14 +3372,12 @@ rest_of_compilation (tree decl)
if (flag_new_regalloc)
{
- if (rest_of_handle_new_regalloc (decl, insns,
- &rebuild_label_notes_after_reload))
+ if (rest_of_handle_new_regalloc (decl, insns))
goto exit_rest_of_compilation;
}
else
{
- if (rest_of_handle_old_regalloc (decl, insns,
- &rebuild_label_notes_after_reload))
+ if (rest_of_handle_old_regalloc (decl, insns))
goto exit_rest_of_compilation;
}
@@ -3383,19 +3393,6 @@ rest_of_compilation (tree decl)
timevar_pop (TV_RELOAD_CSE_REGS);
}
- /* Register allocation and reloading may have turned an indirect jump into
- a direct jump. If so, we must rebuild the JUMP_LABEL fields of
- jumping instructions. */
- if (rebuild_label_notes_after_reload)
- {
- timevar_push (TV_JUMP);
-
- rebuild_jump_labels (insns);
- purge_all_dead_edges (0);
-
- timevar_pop (TV_JUMP);
- }
-
close_dump_file (DFI_postreload, print_rtl_with_bb, insns);
/* Re-create the death notes which were deleted during reload. */