This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR33009, -frtl-abstract-sequences causes an infinite loop


Gabor Loki <loki@gcc.gnu.org> writes:

> 2008-03-03  Gabor Loki  <loki@gcc.gnu.org>
> 
> 	PR gcc/33009
> 	* rtl-factoring.c (clear_regs_live_in_seq): Fix backward steps.
> 	(asplit_block): New. Split basic block and rebuild dataflow.
> 	(block_label_after): Use ASPLIT_BLOCK instead of SPLIT_BLOCK.
> 	(split_pattern_seq): Likewise.
> 	(erase_matching_seqs): Likewise.
> 	(split_pattern_seq): Skip return insn in case of REG_NORETURN note.

Please give asplit_block a different name.  I suggest
split_block_and_df_analyze.  Anything reasonably descriptive is fine.


> Index: gcc/rtl-factoring.c
> ===================================================================
> --- gcc/rtl-factoring.c	(revision 132833)
> +++ gcc/rtl-factoring.c	(working copy)
> @@ -551,8 +551,8 @@
>    df_simulate_artificial_refs_at_end (bb, &live);
>  
>    /* Propagate until INSN if found.  */
> -  for (x = BB_END (bb); x != insn;)
> -    df_simulate_one_insn_backwards (bb, insn, &live);
> +  for (x = BB_END (bb); x != insn; x = PREV_INSN(x))
> +    df_simulate_one_insn_backwards (bb, x, &live);

Add space after "PREV_INSN".


> +/* Splits basic block at the requested insn and rebuilds dataflow.  */
> +
> +static basic_block
> +asplit_block(basic_block bb, rtx insn)

When renaming the function, add a space before the left parenthesis.


> @@ -1008,8 +1019,9 @@
>  
>    /* Emit an indirect jump via the link register after the sequence acting
>       as the return insn.  Also emit a barrier and update the basic block.  */
> -  retjmp = emit_jump_insn_after (gen_indirect_jump (pattern_seqs->link_reg),
> -                                 BB_END (bb));
> +  if (!find_reg_note (BB_END(bb), REG_NORETURN, NULL))
> +    retjmp = emit_jump_insn_after (gen_indirect_jump (pattern_seqs->link_reg),
> +                                   BB_END (bb));
>    emit_barrier_after (BB_END (bb));

Space after "BB_END".


OK with those changes.

Next time, send the testsuite patches with the code patches.

Thanks.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]