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] fixed two issues in handling debug_insn.


On Fri, Jul 16, 2010 at 05:27:40AM -0700, Bingfeng Mei wrote:
> Well, I don't know that function. Here is the updated patch. OK for
> trunk & 4.5? 

> +      rtx prev_insn = prev_nondebug_insn (doloop_pat);
> 
>        /* We expect the decrement to immediately precede the branch.  */
> 
>        if ((PREV_INSN (doloop_pat) == NULL_RTX)
> -          || !INSN_P (PREV_INSN (doloop_pat)))
> +          || !INSN_P (prev_insn))
>          return 0;

This will crash if PREV_INSN is non-NULL, but prev_nondebug_insn returns
NULL.  And, please remove the redundant parens and unnecessary splitting
of the condition on two lines, i.e. what I wrote:

       if (prev_insn == NULL_RTX || !INSN_P (prev_insn))

It looks good to me with those changes (also the ddg.c change), but I can't
approve this.

	Jakub


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