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]

[obvoius] Fix segfault in cfgrtl.c


Hello,

this patch fixes a segfault in cfgrtl.c when using debug dumps.
The problem was that the edge being redirected was deleted in 
redirect_edge_succ_nodup so when we then printed the debug message
we got segfault.

Bootstrappe/regtested x86-64, commited as obvious.

Josef

2004-03-21  Josef Zlomek  <zlomekj@suse.cz>

	* cfgrtl.c (cfg_layout_redirect_edge_and_branch): Print the debug
	message before redirecting the edge.

Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc-cvs/gcc/gcc/cfgrtl.c,v
retrieving revision 1.112
diff -c -p -c -3 -p -r1.112 cfgrtl.c
*** cfgrtl.c	17 Mar 2004 11:42:10 -0000	1.112
--- cfgrtl.c	20 Mar 2004 08:31:53 -0000
*************** cfg_layout_redirect_edge_and_branch (edg
*** 2439,2448 ****
  	      && onlyjump_p (BB_END (src)))
  	    delete_insn (BB_END (src));
  	}
!       redirect_edge_succ_nodup (e, dest);
        if (dump_file)
  	fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
  		 e->src->index, e->dest->index, dest->index);
  
        ret = true;
      }
--- 2439,2449 ----
  	      && onlyjump_p (BB_END (src)))
  	    delete_insn (BB_END (src));
  	}
! 
        if (dump_file)
  	fprintf (dump_file, "Fallthru edge %i->%i redirected to %i\n",
  		 e->src->index, e->dest->index, dest->index);
+       redirect_edge_succ_nodup (e, dest);
  
        ret = true;
      }


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