diff options
author | zadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-01-03 00:31:39 +0000 |
---|---|---|
committer | zadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-01-03 00:31:39 +0000 |
commit | 7e009ff528f39d010bb8d274713dc653dcf7f684 (patch) | |
tree | acfc015900a56222cebb9128e55478b27fa44d40 | |
parent | 1758595d2011f9a5841c25b0a9aaf61ba4b664f4 (diff) | |
download | gcc-7e009ff528f39d010bb8d274713dc653dcf7f684.tar.gz |
2009-01-02 Kenneth Zadeck <zadeck@naturalbridge.com>
PR rtl-optimization/35805
* df-problems.c (df_lr_finalize): Add recursive call to resolve lr
problem if fast dce is able to remove any instructions.
* dce.c (dce_process_block): Fix dump message.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143027 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/dce.c | 2 | ||||
-rw-r--r-- | gcc/df-problems.c | 33 |
3 files changed, 29 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b52ed16a1ce..ba31727eaf1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2009-01-02 Kenneth Zadeck <zadeck@naturalbridge.com> + + PR rtl-optimization/35805 + * df-problems.c (df_lr_finalize): Add recursive call to resolve lr + problem if fast dce is able to remove any instructions. + * dce.c (dce_process_block): Fix dump message. + 2009-01-02 Mark Mitchell <mark@codesourcery.com> PR 33649 diff --git a/gcc/dce.c b/gcc/dce.c index 1adea75570d..08a0f5048e3 100644 --- a/gcc/dce.c +++ b/gcc/dce.c @@ -601,7 +601,7 @@ dce_process_block (basic_block bb, bool redo_out, bitmap au) if (dump_file) { - fprintf (dump_file, "processing block %d live out = ", bb->index); + fprintf (dump_file, "processing block %d lr out = ", bb->index); df_print_regset (dump_file, DF_LR_OUT (bb)); } diff --git a/gcc/df-problems.c b/gcc/df-problems.c index 9175f106c96..0bfef8a08eb 100644 --- a/gcc/df-problems.c +++ b/gcc/df-problems.c @@ -1001,25 +1001,34 @@ df_lr_transfer_function (int bb_index) /* Run the fast dce as a side effect of building LR. */ static void -df_lr_finalize (bitmap all_blocks ATTRIBUTE_UNUSED) +df_lr_finalize (bitmap all_blocks) { + df_lr->solutions_dirty = false; if (df->changeable_flags & DF_LR_RUN_DCE) { run_fast_df_dce (); - if (df_lr->problem_data && df_lr->solutions_dirty) + + /* If dce deletes some instructions, we need to recompute the lr + solution before proceeding further. The problem is that fast + dce is a pessimestic dataflow algorithm. In the case where + it deletes a statement S inside of a loop, the uses inside of + S may not be deleted from the dataflow solution because they + were carried around the loop. While it is conservatively + correct to leave these extra bits, the standards of df + require that we maintain the best possible (least fixed + point) solution. The only way to do that is to redo the + iteration from the beginning. See PR35805 for an + example. */ + if (df_lr->solutions_dirty) { - /* If we are here, then it is because we are both verifying - the solution and the dce changed the function. In that case - the verification info built will be wrong. So we leave the - dirty flag true so that the verifier will skip the checking - part and just clean up.*/ - df_lr->solutions_dirty = true; + df_clear_flags (DF_LR_RUN_DCE); + df_lr_alloc (all_blocks); + df_lr_local_compute (all_blocks); + df_worklist_dataflow (df_lr, all_blocks, df->postorder, df->n_blocks); + df_lr_finalize (all_blocks); + df_set_flags (DF_LR_RUN_DCE); } - else - df_lr->solutions_dirty = false; } - else - df_lr->solutions_dirty = false; } |