This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Another edge insertion fix
- From: Diego Novillo <dnovillo at redhat dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 14 Aug 2003 11:41:54 -0400
- Subject: [tree-ssa] Another edge insertion fix
- Organization: Red Hat Canada
Fixes the case where we insert a statement after the last statement
inside a scope. In that case, there is no need to update the chaining
with the first statement of the next block.
Bootstrapped and tested on x86.
Diego.
* tree-cfg.c (bsi_insert_on_edge_immediate): Only update the
container for the head tree of the next block if the new statement
needs to be linked to it.
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-cfg.c,v
retrieving revision 1.1.4.145
diff -d -u -p -r1.1.4.145 tree-cfg.c
--- tree-cfg.c 13 Aug 2003 19:56:51 -0000 1.1.4.145
+++ tree-cfg.c 14 Aug 2003 12:29:22 -0000
@@ -4405,13 +4405,15 @@ bsi_insert_on_edge_immediate (edge e, tr
case EDGE_INSERT_LOCATION_BEFORE:
case EDGE_INSERT_LOCATION_AFTER:
- /* The container for the head of the dest block has been changed.
- (we've linked a new stmt in front of it.) */
-
tsi_next (&tsi);
- if (dest->end_tree_p == dest->head_tree_p)
- dest->end_tree_p = tsi_container (tsi);
- dest->head_tree_p = tsi_container (tsi);
+ if (!tsi_end_p (tsi))
+ {
+ /* The container for the head of the dest block has been
+ changed. (we've linked a new stmt in front of it.) */
+ if (dest->end_tree_p == dest->head_tree_p)
+ dest->end_tree_p = tsi_container (tsi);
+ dest->head_tree_p = tsi_container (tsi);
+ }
break;
case EDGE_INSERT_LOCATION_NEW_ELSE: