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]

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


Hi,

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

http://gcc.gnu.org/ml/gcc/2005-01/msg01036.html

This bug was found by inspection.

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

Kazu Hirata

2005-01-18  Kazu Hirata  <kazu@cs.umass.edu>

	* 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
       && DECL_NONLOCAL (LABEL_EXPR_LABEL (label)))


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