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] Remove the use of bb.aux field in cfgloop.c


Hi,

This patch removes the use of the basic_block.aux field from cfgloop.c as 
suggested by Zdenek.  It avoids some problems in the tree-ssa branch where 
the aux field is used for different purposes.

Bootstrapped on i686.  Ok for mainline?


2003-04-05  Sebastian Pop  <s dot pop at laposte dot net>

	* cfgloop.c (blocks_headers): Defined.
	(HEADER_BLOCK): Use blocks_headers instead of the .aux field.
	(redirect_edge_with_latch_update): Modified to use blocks_headers.
	(make_forwarder_block): Likewise.
	(canonicalize_loop_headers): Likewise.
	


Index: cfgloop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cfgloop.c,v
retrieving revision 1.21
diff -d -u -p -r1.21 cfgloop.c
--- cfgloop.c	5 Mar 2003 22:05:18 -0000	1.21
+++ cfgloop.c	5 Apr 2003 10:27:59 -0000
@@ -583,7 +583,8 @@ flow_loop_scan (loops, loop, flags)
   return 1;
 }
 
-#define HEADER_BLOCK(B) (* (int *) (B)->aux)
+static varray_type blocks_headers;
+#define HEADER_BLOCK(B) (VARRAY_INT (blocks_headers, B->index))
 #define LATCH_EDGE(E) (*(int *) (E)->aux)
 
 /* Redirect edge and update latch and header info.  */
@@ -597,7 +598,7 @@ redirect_edge_with_latch_update (e, to)
   jump = redirect_edge_and_branch_force (e, to);
   if (jump)
     {
-      alloc_aux_for_block (jump, sizeof (int));
+      VARRAY_GROW (blocks_headers, last_basic_block);
       HEADER_BLOCK (jump) = 0;
       alloc_aux_for_edge (jump->pred, sizeof (int));
       LATCH_EDGE (jump->succ) = LATCH_EDGE (e);
@@ -634,7 +635,7 @@ make_forwarder_block (bb, redirect_latch
   dummy = fallthru->src;
   bb = fallthru->dest;
 
-  bb->aux = xmalloc (sizeof (int));
+  VARRAY_GROW (blocks_headers, last_basic_block);
   HEADER_BLOCK (dummy) = 0;
   HEADER_BLOCK (bb) = 1;
 
@@ -673,7 +674,7 @@ canonicalize_loop_headers ()
   /* Compute the dominators.  */
   dom = calculate_dominance_info (CDI_DOMINATORS);
 
-  alloc_aux_for_blocks (sizeof (int));
+  VARRAY_INT_INIT (blocks_headers, last_basic_block, "blocks_headers");
   alloc_aux_for_edges (sizeof (int));
 
   /* Split blocks so that each loop has only single latch.  */
@@ -712,7 +713,7 @@ canonicalize_loop_headers ()
  
       alloc_aux_for_edge (bb->succ, sizeof (int));
       LATCH_EDGE (bb->succ) = 0;
-      alloc_aux_for_block (bb, sizeof (int));
+      VARRAY_GROW (blocks_headers, last_basic_block);
       HEADER_BLOCK (bb) = 0;
     }
 
@@ -765,7 +766,7 @@ canonicalize_loop_headers ()
 	make_forwarder_block (header, true, false, NULL, 1);
     }
 
-  free_aux_for_blocks ();
+  VARRAY_CLEAR (blocks_headers);
   free_aux_for_edges ();
   free_dominance_info (dom);
 }


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