This is the mail archive of the gcc@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]

Re: bug in flow.c


On Mon, Aug 21, 2000 at 06:20:54AM -0600, Andrew Phillips wrote:
> --- flow.c.orig	Mon Jul 31 11:33:28 2000
> +++ flow.c	Mon Aug  7 12:22:16 2000
> @@ -2530,6 +2530,9 @@
>  
>    /* Selectively unlink the sequence.  */
>    if (q != PREV_INSN (c->head))
> +     /* check that we will not orphan b->end 
> +      * in the case of NEXT_INSN(b->head) == b->end. */
> +      if (b->end == NEXT_INSN(q))  b->end = q;   
>      flow_delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head));
>  
>    e->flags |= EDGE_FALLTHRU;

Hi,

shouldn't there be parenthness ? I'm not familiar with flow.c, but it seems
(according to last CVS) that flow_delete_insn_chain should be executed only 
when that first 'if' is in case. So coorected (and updated position against
latest CVS) can looks like:

--- flow.c.orig Mon Aug 21 11:18:05 2000
+++ flow.c      Mon Aug 21 15:19:07 2000
@@ -2559,8 +2559,14 @@

   /* Selectively unlink the sequence.  */
   if (q != PREV_INSN (c->head))
-    flow_delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head));
-
+    {
+     /* check that we will not orphan b->end
+      * in the case of NEXT_INSN(b->head) == b->end. */
+      if (b->end == NEXT_INSN(q))
+        b->end = q;
+      flow_delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head));
+    }
+
   e->flags |= EDGE_FALLTHRU;
 }


Jan Dvorak <johnydog@go.cz>




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