This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [3.3/mainline] cfg_cleanup speedup
> On Sun, Mar 09, 2003 at 05:53:37PM +0100, Jan Hubicka wrote:
> > * cfgcleanup.c (merge_blocks): Return where to iterate next.
> > (try_optimize_cfg): Use return value of merge_blocks
>
> Ok.
Hi,
while compiling SPEC2000 GCC on x86-64->i386 cross I noticed that it
crashes when the block #6 is moved before block #5 as pointer to removed
block #5 is used to continu in iteration.
Regtested/bootstrapped x86-64/commited as obivous
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ChangeLog,v
retrieving revision 1.17010
diff -c -3 -p -r1.17010 ChangeLog
*** ChangeLog 10 Mar 2003 14:31:10 -0000 1.17010
--- ChangeLog 10 Mar 2003 18:29:25 -0000
***************
*** 1,5 ****
--- 1,7 ----
Mon Mar 10 15:30:36 CET 2003 Jan Hubicka <jh at suse dot cz>
+ * cfgcleanup.c (try_optimize_cfg): Fix thinko in previous patch.
+
* cfgcleanup.c (merge_blocks): Return where to iterate next.
(try_optimize_cfg): Use return value of merge_blocks
Index: cfgcleanup.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
retrieving revision 1.75
diff -c -3 -p -r1.75 cfgcleanup.c
*** cfgcleanup.c 10 Mar 2003 14:31:09 -0000 1.75
--- cfgcleanup.c 10 Mar 2003 18:29:26 -0000
*************** merge_blocks (e, b, c, mode)
*** 861,866 ****
--- 861,868 ----
b_has_incoming_fallthru = (tmp_edge != NULL);
b_fallthru_edge = tmp_edge;
next = b->prev_bb;
+ if (next == c)
+ next = next->prev_bb;
/* Otherwise, we're going to try to move C after B. If C does
not have an outgoing fallthru, then it can be moved