From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24720 invoked by alias); 29 Aug 2007 13:56:15 -0000 Received: (qmail 24616 invoked by uid 48); 29 Aug 2007 13:56:14 -0000 Date: Wed, 29 Aug 2007 13:56:00 -0000 Message-ID: <20070829135614.24614.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/32758] [4.3 Regression] ecj1 hangs In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "jakub at gcc dot gnu dot org" Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2007-q3/txt/msg00142.txt.bz2 ------- Comment #26 from jakub at gcc dot gnu dot org 2007-08-29 13:56 ------- Apparently dce is the only user of df_simulate_* which at the start of the basic block compares the resulting bitmap with DF_LR_IN. All other users of these interfaces don't do that (ifcvt, rtl-factoring, peephole2). And df-problems.c which computes DF_LR_IN doesn't or in the regular or eh artificial uses bitmap in every step. So, if fast dce is to keep comparing the local_live bitmap with DF_LR_IN (and it probably needs to, since if some insns are marked to be deleted, it needs to update it), local_live has to be computed the same way as it is now. So either we just check either local_live or au bitmaps: --- dce.c.jj 2007-08-13 15:11:18.000000000 +0200 +++ dce.c 2007-08-29 15:37:57.000000000 +0200 @@ -527,6 +527,7 @@ static bool dce_process_block (basic_block bb, bool redo_out) { bitmap local_live = BITMAP_ALLOC (&dce_tmp_bitmap_obstack); + bitmap au; rtx insn; bool block_changed; struct df_ref **def_rec, **use_rec; @@ -569,6 +570,15 @@ dce_process_block (basic_block bb, bool bitmap_set_bit (local_live, DF_REF_REGNO (use)); } + /* These regs are considered always live so if they end up dying + because of some def, we need to bring the back again. + Calling df_simulate_fixup_sets has the disadvantage of calling + df_has_eh_preds once per insn, so we cache the information here. */ + if (df_has_eh_preds (bb)) + au = df->eh_block_artificial_uses; + else + au = df->regular_block_artificial_uses; + FOR_BB_INSNS_REVERSE (bb, insn) if (INSN_P (insn)) { @@ -580,7 +590,8 @@ dce_process_block (basic_block bb, bool /* The insn is needed if there is someone who uses the output. */ for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) - if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec))) + if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec)) + || bitmap_bit_p (au, DF_REG_REGNO (*def_rec))) { needed = true; break; or add another bitmap: --- dce.c.jj 2007-08-13 15:11:18.000000000 +0200 +++ dce.c 2007-08-29 15:41:48.000000000 +0200 @@ -527,6 +527,8 @@ static bool dce_process_block (basic_block bb, bool redo_out) { bitmap local_live = BITMAP_ALLOC (&dce_tmp_bitmap_obstack); + bitmap local_live_or_au = BITMAP_ALLOC (&dce_tmp_bitmap_obstack); + bitmap au; rtx insn; bool block_changed; struct df_ref **def_rec, **use_rec; @@ -569,6 +571,16 @@ dce_process_block (basic_block bb, bool bitmap_set_bit (local_live, DF_REF_REGNO (use)); } + /* These regs are considered always live so if they end up dying + because of some def, we need to bring the back again. + Calling df_simulate_fixup_sets has the disadvantage of calling + df_has_eh_preds once per insn, so we cache the information here. */ + if (df_has_eh_preds (bb)) + au = df->eh_block_artificial_uses; + else + au = df->regular_block_artificial_uses; + bitmap_ior (local_live_or_au, local_live, au); + FOR_BB_INSNS_REVERSE (bb, insn) if (INSN_P (insn)) { @@ -580,7 +592,7 @@ dce_process_block (basic_block bb, bool /* The insn is needed if there is someone who uses the output. */ for (def_rec = DF_INSN_DEFS (insn); *def_rec; def_rec++) - if (bitmap_bit_p (local_live, DF_REF_REGNO (*def_rec))) + if (bitmap_bit_p (local_live_or_au, DF_REF_REGNO (*def_rec))) { needed = true; break; @@ -600,6 +612,7 @@ dce_process_block (basic_block bb, bool if (dump_file) fprintf (dump_file, "needed libcall %d\n", INSN_UID (insn)); mark_libcall (insn, true); + BITMAP_FREE (local_live_or_au); BITMAP_FREE (local_live); return dce_process_block (bb, false); } @@ -616,6 +629,8 @@ dce_process_block (basic_block bb, bool anything in local_live. */ if (marked_insn_p (insn)) df_simulate_uses (insn, local_live); + + bitmap_ior (local_live_or_au, local_live, au); } for (def_rec = df_get_artificial_defs (bb_index); *def_rec; def_rec++) @@ -640,6 +655,7 @@ dce_process_block (basic_block bb, bool if (block_changed) bitmap_copy (DF_LR_IN (bb), local_live); + BITMAP_FREE (local_live_or_au); BITMAP_FREE (local_live); return block_changed; } The latter might be faster, but I'm not 100% sure about that. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32758