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

[patch] tree-cfg.c: Fix remove_forwarder_block.


Attached is a patch to fix remove_forwarder_block so that a nonlocal
label won't end up appearing in the middle of a basic block.

This patch is based on the thread starting at

This bug was found by inspection.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2005-01-18  Kazu Hirata  <>

	* tree-cfg.c (remove_forwarder_block): Fix the check to
	prevent a nonlocal label from appearing in the middle of a
	basic block.

Index: tree-cfg.c
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.139
diff -u -d -p -r2.139 tree-cfg.c
--- tree-cfg.c	17 Jan 2005 18:44:18 -0000	2.139
+++ tree-cfg.c	18 Jan 2005 16:34:40 -0000
@@ -3973,7 +3973,7 @@ remove_forwarder_block (basic_block bb, 
   /* If the destination block consists of an nonlocal label, do not merge
      it.  */
-  label = first_stmt (bb);
+  label = first_stmt (dest);
   if (label
       && TREE_CODE (label) == LABEL_EXPR

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