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]

Re: [tree-ssa] COND_EXPR lowering.


Hello,

> > > > Is BIND_EXPR dependant in any way on SWITCH? ie, do we need to get
> > > > SWITCH and COND in before a BIND_EXPR patch has any hope of applying?
> > > 
> > > no, bind_exprs are completely independent issue.  I will try to create
> > > the SWITCH_EXPR lowering patch tomorrow (although the fact that
> > > COND_EXPR lowering is not in is complicating this; the two patches
> > > will neccesarily conflict with each other).
> > 
> > Hold off for a day or two then, we'll get COND_EXPR in shortly, then you
> > can produce the SWITCH patch..
> > 
> In fact, if your run bootstraps, check in COND_EXPR and produce the
> switch patch.

it does, except for a problem with tree-ssa-pre (the garbage collector
is freeing data allocated for dominance information).  The following
patch fixes it (it makes the data non-gc allocated).  This may be
reverted once split_critical_edges works; I will commit it for now as
obvious.

Zdenek

	* dominance.c (BB_NODE): Use VARRAY_GENERIC_PTR_NOGC.
	(calculate_dominance_info): Use VARRAY_GENERIC_PTR_NOGC_INIT.
	* varray.c (element): Add GENERIC_PTR_NOGC entry.
	* varray.h (enum varray_data_enum): Add VARRAY_DATA_GENERIC_NOGC.
	(union varray_data_tag): Add generic_nogc.
	(VARRAY_GENERIC_PTR_NOGC_INIT,  VARRAY_GENERIC_PTR_NOGC,
	VARRAY_PUSH_GENERIC_PTR_NOGC, VARRAY_TOP_GENERIC_PTR_NOGC): New.

Index: dominance.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dominance.c,v
retrieving revision 1.10.2.8
diff -c -3 -p -r1.10.2.8 dominance.c
*** dominance.c	28 Sep 2003 06:06:18 -0000	1.10.2.8
--- dominance.c	25 Oct 2003 16:35:32 -0000
*************** struct dominance_info
*** 51,59 ****
  };
  
  #define BB_NODE(info, bb) \
!   ((et_forest_node_t)VARRAY_GENERIC_PTR ((info)->varray, (bb)->index + 2))
  #define SET_BB_NODE(info, bb, node) \
!   (VARRAY_GENERIC_PTR ((info)->varray, (bb)->index + 2) = (node))
  
  /* We name our nodes with integers, beginning with 1.  Zero is reserved for
     'undefined' or 'end of list'.  The name of each node is given by the dfs
--- 51,59 ----
  };
  
  #define BB_NODE(info, bb) \
!   ((et_forest_node_t)VARRAY_GENERIC_PTR_NOGC ((info)->varray, (bb)->index + 2))
  #define SET_BB_NODE(info, bb, node) \
!   (VARRAY_GENERIC_PTR_NOGC ((info)->varray, (bb)->index + 2) = (node))
  
  /* We name our nodes with integers, beginning with 1.  Zero is reserved for
     'undefined' or 'end of list'.  The name of each node is given by the dfs
*************** calculate_dominance_info (enum cdi_direc
*** 551,557 ****
    info->forest = et_forest_create ();
    info->idom = xcalloc (last_basic_block, sizeof (basic_block));
  
!   VARRAY_GENERIC_PTR_INIT (info->varray, last_basic_block + 3, "dominance info");
  
    /* Add the two well-known basic blocks.  */
    SET_BB_NODE (info, ENTRY_BLOCK_PTR, et_forest_add_node (info->forest,
--- 551,557 ----
    info->forest = et_forest_create ();
    info->idom = xcalloc (last_basic_block, sizeof (basic_block));
  
!   VARRAY_GENERIC_PTR_NOGC_INIT (info->varray, last_basic_block + 3, "dominance info");
  
    /* Add the two well-known basic blocks.  */
    SET_BB_NODE (info, ENTRY_BLOCK_PTR, et_forest_add_node (info->forest,
Index: varray.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varray.c,v
retrieving revision 1.15.2.7
diff -c -3 -p -r1.15.2.7 varray.c
*** varray.c	13 Sep 2003 20:21:26 -0000	1.15.2.7
--- varray.c	25 Oct 2003 16:35:33 -0000
*************** static const struct {
*** 48,53 ****
--- 48,54 ----
    { sizeof (HOST_WIDE_INT), 1 },
    { sizeof (unsigned HOST_WIDE_INT), 1 },
    { sizeof (void *), 1 },
+   { sizeof (void *), 0 },
    { sizeof (char *), 1 },
    { sizeof (struct rtx_def *), 1 },
    { sizeof (struct rtvec_def *), 1 },
Index: varray.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varray.h,v
retrieving revision 1.28.2.6
diff -c -3 -p -r1.28.2.6 varray.h
*** varray.h	13 Sep 2003 20:21:26 -0000	1.28.2.6
--- varray.h	25 Oct 2003 16:35:33 -0000
*************** enum varray_data_enum {
*** 72,77 ****
--- 72,78 ----
    VARRAY_DATA_HINT,
    VARRAY_DATA_UHINT,
    VARRAY_DATA_GENERIC,
+   VARRAY_DATA_GENERIC_NOGC,
    VARRAY_DATA_CPTR,
    VARRAY_DATA_RTX,
    VARRAY_DATA_RTVEC,
*************** typedef union varray_data_tag GTY (()) {
*** 110,115 ****
--- 111,118 ----
  				tag ("VARRAY_DATA_UHINT")))	uhint[1];
    PTR			  GTY ((length ("%0.num_elements"), use_param (""),
  				tag ("VARRAY_DATA_GENERIC")))	generic[1];
+   PTR			  GTY ((length ("%0.num_elements"), skip (""),
+ 				tag ("VARRAY_DATA_GENERIC_NOGC")))	generic_nogc[1];
    char			 *GTY ((length ("%0.num_elements"),
  				tag ("VARRAY_DATA_CPTR")))	cptr[1];
    rtx			  GTY ((length ("%0.num_elements"),
*************** extern varray_type varray_init (size_t, 
*** 183,188 ****
--- 186,194 ----
  #define VARRAY_GENERIC_PTR_INIT(va, num, name) \
    va = varray_init (num, VARRAY_DATA_GENERIC, name)
  
+ #define VARRAY_GENERIC_PTR_NOGC_INIT(va, num, name) \
+   va = varray_init (num, VARRAY_DATA_GENERIC_NOGC, name)
+ 
  #define VARRAY_CHAR_PTR_INIT(va, num, name) \
    va = varray_init (num, VARRAY_DATA_CPTR, name)
  
*************** extern void varray_check_failed (varray_
*** 280,285 ****
--- 286,292 ----
  #define VARRAY_WIDE_INT(VA, N)		VARRAY_CHECK (VA, N, hint)
  #define VARRAY_UWIDE_INT(VA, N)		VARRAY_CHECK (VA, N, uhint)
  #define VARRAY_GENERIC_PTR(VA,N)	VARRAY_CHECK (VA, N, generic)
+ #define VARRAY_GENERIC_PTR_NOGC(VA,N)	VARRAY_CHECK (VA, N, generic_nogc)
  #define VARRAY_CHAR_PTR(VA,N)		VARRAY_CHECK (VA, N, cptr)
  #define VARRAY_RTX(VA, N)		VARRAY_CHECK (VA, N, rtx)
  #define VARRAY_RTVEC(VA, N)		VARRAY_CHECK (VA, N, rtvec)
*************** extern void varray_check_failed (varray_
*** 304,309 ****
--- 311,317 ----
  #define VARRAY_PUSH_WIDE_INT(VA, X)	VARRAY_PUSH (VA, hint, X)
  #define VARRAY_PUSH_UWIDE_INT(VA, X)	VARRAY_PUSH (VA, uhint, X)
  #define VARRAY_PUSH_GENERIC_PTR(VA, X)	VARRAY_PUSH (VA, generic, X)
+ #define VARRAY_PUSH_GENERIC_PTR_NOGC(VA, X)	VARRAY_PUSH (VA, generic_nogc, X)
  #define VARRAY_PUSH_CHAR_PTR(VA, X)	VARRAY_PUSH (VA, cptr, X)
  #define VARRAY_PUSH_RTX(VA, X)		VARRAY_PUSH (VA, rtx, X)
  #define VARRAY_PUSH_RTVEC(VA, X)	VARRAY_PUSH (VA, rtvec, X)
*************** extern void varray_check_failed (varray_
*** 327,332 ****
--- 335,341 ----
  #define VARRAY_TOP_WIDE_INT(VA)	        VARRAY_TOP (VA, hint)
  #define VARRAY_TOP_UWIDE_INT(VA)	VARRAY_TOP (VA, uhint)
  #define VARRAY_TOP_GENERIC_PTR(VA)	VARRAY_TOP (VA, generic)
+ #define VARRAY_TOP_GENERIC_PTR_NOGC(VA)	VARRAY_TOP (VA, generic_nogc)
  #define VARRAY_TOP_CHAR_PTR(VA)		VARRAY_TOP (VA, cptr)
  #define VARRAY_TOP_RTX(VA)		VARRAY_TOP (VA, rtx)
  #define VARRAY_TOP_RTVEC(VA)	        VARRAY_TOP (VA, rtvec)


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