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.


Well, I don't know that function. Here is the updated patch. OK for
trunk & 4.5? 


Index: ddg.c
===================================================================
--- ddg.c       (revision 162258)
+++ ddg.c       (working copy)
@@ -488,7 +488,7 @@
     }

   /* There is nothing to do for this BB.  */
-  if (num_nodes <= 1)
+  if ((num_nodes - g->num_debug) <= 1)
     {
       free (g);
       return NULL;
Index: loop-doloop.c
===================================================================
--- loop-doloop.c       (revision 162258)
+++ loop-doloop.c       (working copy)
@@ -104,11 +104,12 @@
   if (GET_CODE (pattern) != PARALLEL)
     {
       rtx cond;
+      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;

       cmp = pattern;
> -----Original Message-----
> From: Jakub Jelinek [mailto:jakub@redhat.com]
> Sent: 16 July 2010 13:24
> To: Bingfeng Mei
> Cc: gcc-patches@gcc.gnu.org
> Subject: Re: [PATCH] fixed two issues in handling debug_insn.
> 
> On Fri, Jul 16, 2010 at 05:15:21AM -0700, Bingfeng Mei wrote:
> 
> > --- loop-doloop.c       (revision 162258)
> > +++ loop-doloop.c       (working copy)
> > @@ -104,11 +104,15 @@
> >    if (GET_CODE (pattern) != PARALLEL)
> >      {
> >        rtx cond;
> > +      rtx prev_insn = PREV_INSN (doloop_pat);
> >
> > -      /* We expect the decrement to immediately precede the branch.
> */
> > +      /* We expect the decrement to immediately precede the branch.
> > +         Need to skip possible debug_insn */
> > +      while (prev_insn != NULL_RTX && DEBUG_INSN_P (prev_insn))
> > +        prev_insn = PREV_INSN (prev_insn);
> >
> > -      if ((PREV_INSN (doloop_pat) == NULL_RTX)
> > -          || !INSN_P (PREV_INSN (doloop_pat)))
> > +      if ((prev_insn == NULL_RTX)
> > +          || !INSN_P (prev_insn))
> >          return 0;
> >
> >        cmp = pattern;
> 
> Why don't you just do
>       rtx prev_insn = prev_nondebug_insn (doloop_pat);
> 
>       if (prev_insn == NULL_RTX || !INSN_P (prev_insn))
> 	return 0;
> 
> ?
> 

> 	Jakub



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