
Index: alias.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/alias.c,v
retrieving revision 1.186
diff -r1.186 alias.c
42a43,44
> #include "c-pragma.h"
> #include "df.h"
203a206,214
> /* Vector indexed by N storing the list of pointers the register N
>    is known to not alias with.  The register holds a pointer value.
>  */
> static struct indep_ptr_list *reg_known_indep_ptrs;
> 
> 
> /* Indecates number of valid entries in reg_known_indep_ptrs */
> static unsigned int reg_known_indep_ptrs_size;
> 
1030c1041,1043
<     new_reg_base_value[regno] = find_base_value (src);
---
>   {
>       rtx tmpx;
>       new_reg_base_value[regno] = tmpx = find_base_value (src);
1031a1045,1067
>       if(tmpx)
>       {
> 	  if(GET_CODE(tmpx) == ADDRESS)
> 	      tmpx = XEXP(tmpx,0);
> 
> 	  if(!REG_ATTRS(dest))
> 	  {     
> 	      if(GET_CODE(tmpx) == REG)
> 		  set_reg_attrs_from_reg(dest, tmpx, 0);
> 	      else if(GET_CODE(tmpx) == MEM)
> 		  set_reg_attrs_from_mem(dest, tmpx);
> 	  }      
> 	  else if(tmpx && REG_ATTRS(dest) && GET_CODE(tmpx) == REG
> 		  && !REG_ATTRS(tmpx)
> 		  && FUNCTION_ARG_REGNO_P(REGNO(tmpx)))
> 	  {
> 	  /* Argument registers are now visible here, but the actual
> 	     hard registers aren't annotated, so flow back here so
> 	     other descendants of the argument register get the annotation */
> 	      set_reg_attrs_from_reg(tmpx, dest, 0);	  
> 	  }
>       }      
>   }  
1034a1071,1092
> /* I need a version that takes an rtx for updating
>    indep ptr decl info */
> void
> record_base_value_rtx (r, val, invariant)
>      rtx r;
>      rtx val;
>      int invariant;
> {
>     unsigned int regno = REGNO(r);
>     record_base_value(regno, val, invariant);
> 
>     if(GET_CODE (val) == REG)    
> 	set_reg_attrs_from_reg(r, val, 0);
>     else if(regno < reg_base_value_size && reg_base_value[regno])
>     {
> 	if(GET_CODE(reg_base_value[regno]) == REG)
> 	    set_reg_attrs_from_reg(r, reg_base_value[regno], 0);
> 	else if(GET_CODE(reg_base_value[regno]) == MEM)
> 	    set_reg_attrs_from_mem(r, reg_base_value[regno]);
>     }
> }
>      
1057d1114
< 
1556a1614,2113
> typedef struct memprof_reglist_t
> {
>     rtx xreg;
>     rtx yreg;
>     struct memprof_reglist_t *next;
>     
> } memprof_reglist;
> 
> typedef struct memprof_hashnode_t
> {
>     /* the pair (xdecl,ydecl) of memory references is the key,
>        they can hash in either order */
>     tree xdecl;
>     tree ydecl;
>     memprof_reglist *xyregs; /* list of all the pair of registers that correspond to these decls */
>     int cnt; /* number of reference to this pair */
>     /* more? */
> 
>     struct memprof_hashnode_t *next; /*for chaining */
> } memprof_hashnode;
> 
> /* implement resizing hashtable.. someday..*/
> #define MEMPROF_HASH_SIZE 1021
> static memprof_hashnode *memprof_hashtable[MEMPROF_HASH_SIZE];
> 
> static int memprof_hash(tree xdecl, tree ydecl)
> {
>     int x = xdecl;
>     int y = ydecl;
>     int ret = abs((x*y)%MEMPROF_HASH_SIZE);
>     return ret;
> }
> 
> /* deallocate memprof hashtable and reinitialize */
> static void memprof_free_table()
> {
>     int i;
>     for(i = 0; i < MEMPROF_HASH_SIZE; i++)
>     {
> 	memprof_hashnode *next = NULL;
> 	memprof_hashnode *node = memprof_hashtable[i];
> 	while(node != NULL)
> 	{
> 	    next = node->next;
> 	    free(node);
> 	    node = next;
> 	}
>     }
> 
>     memset(memprof_hashtable, 0, sizeof(memprof_hashtable));
> }
> 
> /* Add this pair of memory references to the table.  If it isn't there,
>    create an entry, otherwise increment the count and if the register
>    pair isn't in the list, add it. */
> static void memprof_add_to_table(tree xdecl, tree ydecl, rtx xreg, rtx yreg)
> {
>     int index = 0;
>     tree tmp = NULL;
>     rtx tmpr = NULL;
>     memprof_hashnode *node = NULL;
>     memprof_reglist *rnode = NULL;
>     memprof_reglist *rprev = NULL;
> 
>     /* normalize xdecl and ydecl.. smaller first */
>     if(((int)ydecl) < ((int)xdecl))
>     {
> 	tmp = xdecl;
> 	xdecl = ydecl;
> 	ydecl = tmp;
>     }
>     /* same with xreg and yreg */
>     if(((int)yreg) < ((int)xreg))
>     {
> 	tmpr = xreg;
> 	xreg = yreg;
> 	yreg = tmpr;
>     }
>     
>     index = memprof_hash(xdecl,ydecl);
> 
>     if(memprof_hashtable[index] == NULL)
>     {
> 	memprof_hashtable[index] = node = (memprof_hashnode*)xmalloc(sizeof(memprof_hashnode));
> 	memset(node,0,sizeof(memprof_hashnode));
> 	node->xdecl = xdecl;
> 	node->ydecl = ydecl;
>     }
>     else /* find the right node in the chain */
>     {
> 	memprof_hashnode *prev = NULL;
> 	node = memprof_hashtable[index];
> 
> 	while(node != NULL && node->xdecl != xdecl && node->ydecl != ydecl)
> 	{
> 	    prev = node;
> 	    node = node->next;
> 	}
> 	
> 	if(node == NULL) /* didn't find it, create a new one */
> 	{
> 	    prev->next = node = (memprof_hashnode*)xmalloc(sizeof(memprof_hashnode));
> 	    memset(node,0,sizeof(memprof_hashnode));
> 	    node->xdecl = xdecl;
> 	    node->ydecl = ydecl;
> 	}
>     }
> 
>     /* at this point node should be pointing to somthing with xdecl
>        and ydecl in it, but cnt and xyregs not updated */
> 
>     node->cnt++;
> 
>     /* insert regs */
>     rnode = node->xyregs;
> 
>     while(rnode != NULL && rnode->xreg != xreg && rnode->yreg != yreg)
>     {
> 	rprev = rnode;
> 	rnode = rnode->next;
>     }
> 
>     if(rnode == NULL) /* have to add it*/
>     {
> 	rnode = (memprof_reglist *)xmalloc(sizeof(memprof_reglist));
> 	rnode->next = NULL;
> 	rnode->xreg = xreg;
> 	rnode->yreg = yreg;
> 
> 	/*link it in */
> 	if(rprev == NULL)
> 	    node->xyregs = rnode;
> 	else
> 	    rprev->next = rnode;
>     }
> }
> 
> typedef struct memprof_hashnode_list_t
> {
>     memprof_hashnode* node;
>     struct memprof_hashnode_list_t *next;
> } memprof_hashnode_list;
> 
> /* return a 'goodness' of this pair.. higher better*/
> static int score(memprof_hashnode *x)
> {
>     return x->cnt;
> }
> 
> /* deallocate a list l*/
> static void memprof_free_list(memprof_hashnode_list *l)
> {
>     memprof_hashnode_list *next = NULL;
>     while(l != NULL)
>     {
> 	next = l->next;
> 	free(l);
> 	l = next;
>     }
> }
> 
> /* insert x in sorted order (based on it's score) into the list
>    pointed to lptr.  Always inserts x (doesn't check for duplicates
>    Assumes list is sorted.
>    */
> static void memprof_insert_inorder(memprof_hashnode_list **lptr, memprof_hashnode* x)
> {
>     int xscore;
>     memprof_hashnode_list *node = (memprof_hashnode_list*)xmalloc(sizeof(memprof_hashnode_list));
>     memset(node, 0, sizeof(memprof_hashnode_list));
>     node->node = x;
>     
>     if(*lptr == NULL)
>     {	
> 	*lptr = node;
> 	return;
>     }
> 
>     xscore = score(x);
>     if(xscore <= score((*lptr)->node)) /* insert at beginning */
>     {
> 	node->next = *lptr;
> 	*lptr = node;
>     }
>     else
>     {
> 	memprof_hashnode_list *l = *lptr;
> 	while(l->next && (xscore > score(l->next->node)))
> 	    l = l->next;
> 	/* l->node is smaller than x, but l->next isn't */
> 	node->next = l->next;
> 	l->next = node;
>     }
>     
> }
> 
> /* Returns true if insn1 dominates or partially dominates insn2.
>  */
> int insn_dominates_insn(struct df *df, dominance_info dominators, dominance_info post_dominators, rtx insn1, rtx insn2)
> {
>     basic_block bb1 = BLOCK_FOR_INSN(insn1);
>     basic_block bb2 = BLOCK_FOR_INSN(insn2);
> 
>     if(bb1 == bb2) /* easy case, same basic block */
>     {
> 	return (DF_INSN_LUID(df, insn1) < DF_INSN_LUID(df, insn2));
>     }
> 
>     if(dominated_by_p(dominators, bb2, bb1))
> 	return 1;
>     if(dominated_by_p(post_dominators, bb1, bb2))
> 	return 1;
>     return 0;
> }
> 
> /*
> rtx gen_memchk2(rtx x, rtx y, rtx c)
> {
>   //  return gen_nop();
>     return gen_memchk(x,y,c,x,y);
> }
> */
> 
> /* Return a (hopefully) unique 16 bit id from three strings */
> static int unique_id16(char const *s1, char const *s2, char const *s3)
> {
>     unsigned int ret = 0;
>     if(s1)
>     {
> 	while(*s1)
> 	{
> 	    ret = ret << 8;
> 	    ret += *s1;
> 	    ret = ret % 65063;
> 	    s1++;
> 	}
>     }
>     if(s2)
>     {
> 	while(*s2)
> 	{
> 	    ret = ret << 8;
> 	    ret += *s2;
> 	    ret = ret % 65063;
> 	    s2++;
> 	}
>     }
>     if(s3)
>     {
> 	while(*s3)
> 	{
> 	    ret = ret << 8;
> 	    ret += *s3;
> 	    ret = ret % 65063;
> 	    s3++;
> 	}
>     }
>     return ret&0x7fff;
> }
> 
> #define last_insn (cfun->emit->x_last_insn)
> 
> /* Perform analysises and print out info on possible pointers to unalias */
> void profile_mem()
> {
>     int i;
>     int cnt = 0;
>     memprof_hashnode_list *l = NULL;
>     memprof_hashnode_list *itr = NULL;
>     struct df *df;
>     dominance_info post_dominators, dominators;
> 
>     df = df_init();
> 
>     /* we'll use the defuse stuff to insert the check instructions */
>     df_analyse (df, 0, DF_ALL);
> 
>     post_dominators = calculate_dominance_info (CDI_POST_DOMINATORS);
>     dominators = calculate_dominance_info (CDI_DOMINATORS);
> 
>     //df_dump(df, DF_ALL, stderr);
>     
>     /* print out a sorted list of pointers that we'd like
>        to not be aliased */
>     for(i = 0; i < MEMPROF_HASH_SIZE; i++)
>     {
> 	memprof_hashnode *node = memprof_hashtable[i];
> 	while(node != NULL)
> 	{
> 	    memprof_insert_inorder(&l, node);	    
> 	    node = node->next;
> 	}
>     }
> 
>     /* only print something out if we found something */
>     if(l != NULL)
>     {
> 	/* Actually insert memchk instructions. */
> 	/* For each possible pair of registers, insert a check before
> 	   each use of either register that is dominated by both
> 	   registers' definitions */
> 	for(itr = l; itr != NULL; itr = itr->next)
> 	{
> 	    int id = unique_id16(current_function_name,
> 		    IDENTIFIER_POINTER (DECL_NAME (itr->node->xdecl)),
> 		    IDENTIFIER_POINTER (DECL_NAME (itr->node->ydecl)));
> 	    memprof_reglist *regs = itr->node->xyregs;
> 	    for( ; regs != NULL; regs = regs->next)
> 	    {
> 		struct df_link *uses;
> 		struct df_link *defs;
> 		rtx xreg = regs->xreg;
> 		rtx yreg = regs->yreg;
> 		
> 		/* for each of xreg's uses, check to see if
> 		   it's dominated by at least one of yreg's defs */
> 		uses = df->regs[REGNO(xreg)].uses;
> 
> 		for( ; uses != NULL; uses = uses->next)
> 		{
> 		    defs = df->regs[REGNO(yreg)].defs;
> 		    for( ; defs != NULL; defs = defs->next)
> 		    {
> 			if(insn_dominates_insn(df, dominators, post_dominators, defs->ref->insn, uses->ref->insn))
> 			{
> 			    /* use emit_library_call to insert a memory checking function call */
> 			    /*This is a hack since we aren't actually emitting code.. */
> 			    rtx saved_last_insn = last_insn;
> 			    last_insn = PREV_INSN(uses->ref->insn); /* I feel so dirty */
> 			    emit_library_call(gen_rtx(SYMBOL_REF, Pmode, "__memchk"), 0,
> 				    VOIDmode, 3, xreg, Pmode, yreg, Pmode, GEN_INT(id), SImode);
> 			    /* splice back in the rest of the list */
> 			    NEXT_INSN(last_insn) = uses->ref->insn;
> 			    PREV_INSN(uses->ref->insn) = last_insn;
> 			    last_insn = saved_last_insn;
> 			    /* insert a memory check before use 
> 			    add_insn_before(
> 				    make_insn_raw(gen_memchk2(xreg, yreg, GEN_INT(id))),
> 				    uses->ref->insn);
> 			    */
> 			}
> 		    }
> 		}
> 
> 		/* now check the other way */
> 		uses = df->regs[REGNO(yreg)].uses;
> 
> 		for( ; uses != NULL; uses = uses->next)
> 		{
> 		    defs = df->regs[REGNO(xreg)].defs;
> 		    for( ; defs != NULL; defs = defs->next)
> 		    {
> 			if(insn_dominates_insn(df,dominators, post_dominators, defs->ref->insn, uses->ref->insn))
> 			{
> 			    /* use emit_library_call to insert a memory checking function call */
> 			    /*This is a hack since we aren't actually emitting code.. */
> 			    rtx saved_last_insn = last_insn;
> 			    last_insn = PREV_INSN(uses->ref->insn); /* I feel so dirty */
> 			    emit_library_call(gen_rtx(SYMBOL_REF, Pmode, "__memchk"), 0,
> 				    VOIDmode, 3, xreg, Pmode, yreg, Pmode, GEN_INT(id), SImode);
> 			    /* splice back in the rest of the list */
> 			    NEXT_INSN(last_insn) = uses->ref->insn;
> 			    PREV_INSN(uses->ref->insn) = last_insn;			    
> 			    last_insn = saved_last_insn;
> 			    /* insert a memory check before use 
> 			    add_insn_before(
> 				    make_insn_raw(gen_memchk2(xreg, yreg, GEN_INT(id))),
> 				    uses->ref->insn);
> 			    */			    
> 			    /* insert a memory check before use */
> 			}
> 		    }
> 		}
> 		
> 	    }
> 	    cnt++; /* each pair has a unique number */
> 	}
> 
> 	cnt = 0;
> 	fprintf(stderr,"%s:%s\n===================\n",input_filename,current_function_name );
> 
>     /* now print out list */
> 	for(itr = l; itr != NULL; itr = itr->next)
> 	{
> 	    int id = unique_id16(current_function_name,
> 		    IDENTIFIER_POINTER (DECL_NAME (itr->node->xdecl)),
> 		    IDENTIFIER_POINTER (DECL_NAME (itr->node->ydecl)));
> 	    
> 	    fprintf (stderr, "%d:\t", id);
> 	    fprintf (stderr, "%s:%d:%s\t",
> 		    DECL_SOURCE_FILE(itr->node->xdecl),
> 		    DECL_SOURCE_LINE(itr->node->xdecl),
> 		    IDENTIFIER_POINTER (DECL_NAME (itr->node->xdecl)));
> 	    fprintf (stderr, "%s:%d:%s\t",
> 		    DECL_SOURCE_FILE(itr->node->ydecl),
> 		    DECL_SOURCE_LINE(itr->node->ydecl),
> 		    IDENTIFIER_POINTER (DECL_NAME (itr->node->ydecl)));
> 	    fprintf (stderr, "%d\n",itr->node->cnt);
> 	    cnt++;
> 	}
> 	fprintf(stderr,"Pairs: %d\n\n",cnt);
> 
>     }
>     memprof_free_table();
>     memprof_free_list(l);
>     free_dominance_info (post_dominators);
>     free_dominance_info (dominators);
> 
>     df_finish(df);
> 
>   //  print_rtl_with_bb(stderr, get_insns());
> }
> 
> void init_profile_mem()
> {
>     memprof_free_table();
> }
> 
> extern int flag_profile_mem;
> 
> /* dkoes
>    Uses information from indep pragma to determine if the
>    variables defined by xdecl and ydecl have been declared
>    as being independant pointers.
>    Returns 1 if they are independant, 0 otherwise.
> */
> static int decls_are_indep_pointers(tree xdecl, tree ydecl)
> {
>     struct indep_ptr_list_type *xlist, *ylist, *tmp;
>     
>     /* now get indep ptr lists */
>     xlist = DECL_INDEP_PTR_LIST(xdecl);
>     ylist = DECL_INDEP_PTR_LIST(ydecl);
> 
>     /* if x and y are independant, then they'd
>        have each other in their lists */
>     if(xlist == NULL || ylist == NULL)
> 	return 0;
> 
>     /* loop over just one list */
>     for(tmp = xlist; tmp != NULL; tmp = tmp->next)
>     {
> 	if((tree)tmp->decl == ydecl)
> 	    return 1;
>     }
>     return 0;
> 
> }
> 
> 
> /* dkoes
>    Uses information from indep pragma to determine if x and
>    y have been declared as containing independant pointers.
>    x and y must be a REG.  Uses reg_expr
>    to get at the decls associated with regs.  Is this safe
>    to do after regiser allocation??
>    Returns 1 if the two variables have been declared indep.
>    Note that it's comparing _addresses_ so it would be invalid
>    to pass a mem here..
>  */
> static int are_indep_pointers(rtx x, rtx y)
> {
>     tree xdecl, ydecl;
>     
>     /* get associated decls; if they don't exist of
>        these aren't regs/mems, return 0 */
>     if(GET_CODE(x) == REG)    
> 	xdecl = REG_EXPR(x);    
>     else
> 	return 0;
> 
>     if(GET_CODE(y) == REG)    
> 	ydecl = REG_EXPR(y);    
>     else
> 	return 0;
> 
>     if(xdecl == NULL || ydecl == NULL)
> 	return 0;
> 
>     if(!(TREE_CODE (xdecl) == PARM_DECL ||
> 	    TREE_CODE (xdecl) == VAR_DECL))
> 	return 0;
> 
>     if(!(TREE_CODE (ydecl) == PARM_DECL ||
> 	    TREE_CODE (ydecl) == VAR_DECL))
> 	return 0;
> 
>     if(flag_profile_mem && DECL_NAME (xdecl) && DECL_NAME (ydecl) &&
> 	    (IDENTIFIER_POINTER (DECL_NAME (xdecl)) != IDENTIFIER_POINTER (DECL_NAME (ydecl))))
>     {
> 	/* only add pointers and arrays (anything else would just get ignored anyway */
> 	if((POINTER_TYPE_P(TREE_TYPE(xdecl)) || TREE_CODE(TREE_TYPE(xdecl)) != ARRAY_TYPE) &&
> 		(POINTER_TYPE_P(TREE_TYPE(ydecl)) || TREE_CODE(TREE_TYPE(ydecl)) != ARRAY_TYPE))
> 	    memprof_add_to_table(xdecl, ydecl, x, y);
>     }
> 
> 
>     return decls_are_indep_pointers(xdecl, ydecl);
> }	
> 
1688c2245,2248
< 	/* Are these registers known not to be equal?  */
---
> 	  if(are_indep_pointers(x,y))
> 	    return 0;
> 
> 	  /* Are these registers known not to be equal?  */
2773a3334,3350
>       /* Remove any annotation of hard registers from previous runs.. ick */
>       if(static_reg_base_value)
>       {
> 	  for(i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> 	  {
> 	      if(static_reg_base_value[i])
> 	      {
> 		  if(GET_CODE(static_reg_base_value[i]) == ADDRESS &&
> 			  REG_ATTRS(XEXP(static_reg_base_value[i],0)))
> 		      REG_ATTRS(XEXP(static_reg_base_value[i],0)) = NULL;
> 		  new_reg_base_value[i] = static_reg_base_value[i];
> 	      }
> 	      else
> 		  new_reg_base_value[i] = NULL;
> 	  }
>       }
>   
2813,2820d3389
<       /* Mark all hard registers which may contain an address.
< 	 The stack, frame and argument pointers may contain an address.
< 	 An argument register which can hold a Pmode value may contain
< 	 an address even if it is not in BASE_REGS.
< 
< 	 The address expression is VOIDmode for an argument and
< 	 Pmode for other registers.  */
< 
2823c3392
< 
---
>       
2972a3542
> 
Index: c-config-lang.in
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-config-lang.in,v
retrieving revision 1.1
diff -r1.1 c-config-lang.in
26c26
< gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-objc-common.c"
---
> gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-parse.in \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-pragma.h \$(srcdir)/c-objc-common.c"
Index: c-lang.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-lang.c,v
retrieving revision 1.101
diff -r1.101 c-lang.c
29a30
> #include "c-pragma.h"
Index: c-pragma.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-pragma.c,v
retrieving revision 1.57
diff -r1.57 c-pragma.c
36a37
> #include "c-tree.h"
485a487,572
> static void handle_pragma_indep PARAMS ((cpp_reader *));
> 
> static tree pending_indep;
> 
> /*dkoes
>   #pragma indep a,b
>    Asserts that a and b (which have be pointers) will never alias. Ever.
>    */
> static void
> handle_pragma_indep (dumdum)
>      cpp_reader *dumdum ATTRIBUTE_UNUSED;
> {
>   tree x, y, xdecl, ydecl, dummy;
>   enum cpp_ttype t;
>   struct indep_ptr_list_type *xlist, *ylist;
>   int clexret;
>   
>   if (c_lex (&x) != CPP_NAME)
>     {
>       warning ("malformed #pragma independent, ignored: can't understand first identifier");
>       return;
>     }
> 
>   clexret = c_lex(&y);
>   
>   if (clexret == CPP_COMMA)
>       clexret = c_lex(&y);
> 
>   if (clexret != CPP_NAME)
>     {
>       warning ("malformed #pragma independent, ignored: can't understand second identifier");
>       return;
>     }
>   
>   t = c_lex (&dummy);
>   if (t != CPP_EOF)
>     warning ("junk at end of #pragma independent");
> 
>   xdecl = identifier_global_value (x);
>   if(xdecl == NULL) xdecl = IDENTIFIER_LOCAL_VALUE (x);
> 
>   ydecl = identifier_global_value (y);
>   if(ydecl == NULL) ydecl = IDENTIFIER_LOCAL_VALUE (y);
> 
>   if(xdecl == NULL ||
> 	  !(TREE_CODE (xdecl) == PARM_DECL ||
> 		  TREE_CODE (xdecl) == VAR_DECL))
>   {
>       warning("%s unknown at pragma definition, ignored", IDENTIFIER_POINTER(x));
>       return;
>   }
> 
>   if(ydecl == NULL  ||
> 	  !(TREE_CODE (ydecl) == PARM_DECL ||
> 		  TREE_CODE (ydecl) == VAR_DECL))
>   {
>       warning("%s unknown at pragma definition, ignored", IDENTIFIER_POINTER(y));
>       return;
>   }
> 
>   if(!POINTER_TYPE_P(TREE_TYPE(xdecl)) && TREE_CODE(TREE_TYPE(xdecl)) != ARRAY_TYPE)
>   {
>       warning("%s not pointer type, ignored", IDENTIFIER_POINTER(x));
>       return;
>   }
>   
>   if(!POINTER_TYPE_P(TREE_TYPE(ydecl))&& TREE_CODE(TREE_TYPE(ydecl)) != ARRAY_TYPE)
>   {
>       warning("%s not pointer type, ignored", IDENTIFIER_POINTER(y));
>       return;
>   }
> 
>   /* everything checks out, put x and y on each other's indep lists */
>   xlist = (struct indep_ptr_list_type*)ggc_alloc(sizeof(struct indep_ptr_list_type));
>   xlist->next = DECL_INDEP_PTR_LIST(xdecl);
>   xlist->decl = (struct tree_decl *)ydecl;
>   DECL_INDEP_PTR_LIST(xdecl) = xlist;
>   
>   ylist = (struct indep_ptr_list_type*)ggc_alloc(sizeof(struct indep_ptr_list_type));
>   ylist->next = DECL_INDEP_PTR_LIST(ydecl);
>   ylist->decl = (struct tree_decl *)xdecl;
>   DECL_INDEP_PTR_LIST(ydecl) = ylist;
>   
> }
> 
> 
516a604,606
> 
>     c_register_pragma (0, "independent", handle_pragma_indep);
> 
519a610
> 
Index: c-pragma.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-pragma.h,v
retrieving revision 1.32
diff -r1.32 c-pragma.h
63a64
> 
Index: config.gcc
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.277
diff -r1.277 config.gcc
1781a1782,2101
> 	else
> 		tm_file=mips/iris5.h
> 	fi
> 	tmake_file=mips/t-iris
> 	xm_defines=POSIX
> 	xm_file=mips/xm-iris5.h
> 	# mips-tfile doesn't work yet
> 	# See comment in mips/iris5.h file.
> 	use_collect2=yes
> #	if test x$enable_threads = xyes; then
> #		thread_file='irix'
> #	fi
> 	;;
> mips-sgi-irix4loser*)		# Mostly like a MIPS.
> 	tm_file="mips/iris4loser.h mips/iris3.h ${tm_file} mips/iris4.h"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	tmake_file=mips/t-iris
> 	xm_defines=POSIX
> 	if test x$gas = xyes
> 	then	:
> 	else
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> #	if test x$enable_threads = xyes; then
> #		thread_file='irix'
> #	fi
> 	;;
> mips-sgi-irix4*)		# Mostly like a MIPS.
> 	tm_file="mips/iris3.h ${tm_file} mips/iris4.h"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	tmake_file=mips/t-iris
> 	xm_defines=POSIX
> 	if test x$gas = xyes
> 	then	:
> 	else
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> #	if test x$enable_threads = xyes; then
> #		thread_file='irix'
> #	fi
> 	;;
> mips-sgi-*)			# Mostly like a MIPS.
> 	tm_file="mips/iris3.h ${tm_file}"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	xm_defines=POSIX
> 	if test x$gas = xyes
> 	then	:
> 	else
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> 	;;
> mips-dec-osfrose*)		# Decstation running OSF/1 reference port with OSF/rose.
> 	tm_file="mips/osfrose.h ${tm_file}"
> 	extra_objs=halfpic.o
> 	use_collect2=yes
> 	;;
> mips-dec-osf*)			# Decstation running OSF/1 as shipped by DIGITAL
> 	tm_file=mips/dec-osf1.h
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	if test x$gas = xyes
> 	then	:
> 	else
> 		tmake_file=mips/t-ultrix
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> 	;;
> mips-dec-bsd*)                  # Decstation running 4.4 BSD
>       tm_file=mips/dec-bsd.h
>       if test x$gas = xyes
>       then	:
>       else
> 		tmake_file=mips/t-ultrix
> 		extra_passes="mips-tfile mips-tdump"
>       fi
>       if test x$gnu_ld != xyes
>       then
> 		use_collect2=yes
>       fi
>       ;;
> mips*-*-netbsd*)			# NetBSD/mips, either endian.
> 	tm_file="elfos.h mips/netbsd.h"
> 	case $machine in
> 	mips*el-*)
> 		tm_file="mips/little.h $tm_file" 
> 		;;
> 	esac
> 	tmake_file="${tmake_file} mips/t-netbsd"
> 	;;
> mips*-*-linux*)				# Linux MIPS, either endian.
>         tm_file="dbxelf.h elfos.h svr4.h linux.h mips/linux.h"
> 	case $machine in
>         mipsisa32*-*)
>                 tm_file="$tm_file mips/isa32-linux.h"
>                 target_cpu_default="MASK_SOFT_FLOAT"
>                 ;;
>         esac
>         case $machine in
>         mips*el-*)
>                 tm_file="mips/little.h $tm_file"
>                 ;;
> 	esac
> 	tmake_file="t-slibgcc-elf-ver t-linux mips/t-linux"
> 	extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
> 	gnu_ld=yes
> 	gas=yes
> 	;;
> mips*el-*-openbsd*)	# mips little endian
> 	target_cpu_default="MASK_GAS|MASK_ABICALLS"
> 	;;
> mips*-*-openbsd*)		# mips big endian
> 	target_cpu_default="MASK_GAS|MASK_ABICALLS"
> 	tm_file="mips/openbsd-be.h ${tm_file}"
> 	;;
> mips-sony-bsd* | mips-sony-newsos*)	# Sony NEWS 3600 or risc/news.
> 	tm_file="mips/news4.h ${tm_file}"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	if test x$gas = xyes
> 	then	:
> 	else
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> 	;;
> mips-sony-sysv*)		# Sony NEWS 3800 with NEWSOS5.0.
> 				# That is based on svr4.
> 	# t-svr4 is not right because this system doesn't use ELF.
> 	tm_file="mips/news5.h ${tm_file}"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	xm_defines=POSIX
> 	if test x$gas = xyes
> 	then	:
> 	else
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> 	;;
> mips-tandem-sysv4*)		# Tandem S2 running NonStop UX
> 	tm_file="mips/svr4-5.h mips/svr4-t.h"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	xm_defines=POSIX
> 	if test x$gas = xyes
> 	then
> 		extra_parts="crtbegin.o crtend.o"
> 	else
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> 	;;
> ssbig-na-sstrix)			# simplescalar big
> 	cpu_type=ss
> 		tm_file=ss/ssbig.h
> 		xm_file=ss/xm-ss.h
> 		xmake_file=ss/x-sstrix
> 		tmake_file=ss/t-ss-gas
> 		use_collect2=yes
> 		;;
> sslittle-na-sstrix)			# simplescalar little
> 	cpu_type=ss
> 		tm_file=ss/sslittle.h
> 		xm_file=ss/xm-ss.h
> 		xmake_file=ss/x-sstrix
> 		tmake_file=ss/t-ss-gas
> 		use_collect2=yes
> 		;;
> 
> mips-*-ultrix* | mips-dec-mach3)	# Decstation.
> 	tm_file="mips/ultrix.h ${tm_file}"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	if test x$gas = xyes
> 	then	:
> 	else
> 		tmake_file=mips/t-ultrix
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
>         ;;
> mips-*-riscos[56789]bsd*)
> 	tm_file=mips/bsd-5.h	# MIPS BSD 4.3, RISC-OS 5.0
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	if test x$gas = xyes
> 	then
> 		tmake_file=mips/t-bsd-gas
> 	else
> 		tmake_file=mips/t-bsd
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
>         ;;
> mips-*-bsd* | mips-*-riscosbsd* | mips-*-riscos[1234]bsd*)
> 	tm_file="mips/bsd-4.h ${tm_file}" # MIPS BSD 4.3, RISC-OS 4.0
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	if test x$gas = xyes
> 	then
> 		tmake_file=mips/t-bsd-gas
> 	else
> 		tmake_file=mips/t-bsd
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
>         ;;
> mips-*-riscos[56789]sysv4*)
> 	tm_file=mips/svr4-5.h	# MIPS System V.4., RISC-OS 5.0
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	if test x$gas = xyes
> 	then
> 		tmake_file=mips/t-svr4-gas
> 	else
> 		tmake_file=mips/t-svr4
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> 	;;
> mips-*-sysv4* | mips-*-riscos[1234]sysv4* | mips-*-riscossysv4*)
> 	tm_file="mips/svr4-4.h ${tm_file}"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	xm_defines=POSIX
> 	if test x$gas = xyes
> 	then
> 		tmake_file=mips/t-svr4-gas
> 	else
> 		tmake_file=mips/t-svr4
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> 	;;
> mips-*-riscos[56789]sysv*)
> 	tm_file=mips/svr3-5.h	# MIPS System V.3, RISC-OS 5.0
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	xm_defines=POSIX
> 	if test x$gas = xyes
> 	then
> 		tmake_file=mips/t-svr3-gas
> 	else
> 		tmake_file=mips/t-svr3
> 		extra_passes="mips-tfile mips-tdump"
> 	fi
> 	if test x$gnu_ld != xyes
> 	then
> 		use_collect2=yes
> 	fi
> 	;;
> mips-*-sysv* | mips-*-riscos*sysv*)
> 	tm_file="mips/svr3-4.h ${tm_file}"
> 	if test x$stabs = xyes; then
> 		tm_file="${tm_file} dbx.h"
> 	fi
> 	xm_defines=POSIX
> 	if test x$gas = xyes
> 	then
> 		tm_file="mips/iris5.h mips/iris5gas.h"
> 		if test x$stabs = xyes
> 		then
> 			tm_file="${tm_file} dbx.h"
> 		fi
Index: emit-rtl.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/emit-rtl.c,v
retrieving revision 1.308
diff -r1.308 emit-rtl.c
917a918,928
> /* set the src's reg attrs to be the same dst's
>    with additional offset */
> void
> set_reg_attrs_from_reg (dst, src, offset)
>     rtx dst;
>     rtx src;
>     int offset;
> {
>     REG_ATTRS(dst) = get_reg_attrs(REG_EXPR(src), REG_OFFSET(src));
> }
> 
Index: explow.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/explow.c,v
retrieving revision 1.105
diff -r1.105 explow.c
780a781,786
>   /* Also fill in the expression for this temp */
>   if(GET_CODE(x) == MEM && MEM_EXPR(x) &&
> 	  (TREE_CODE(MEM_EXPR(x)) == PARM_DECL ||
> 		  TREE_CODE(MEM_EXPR(x)) == VAR_DECL))
>       set_reg_attrs_from_mem(temp,x);      
> 
Index: expr.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/expr.h,v
retrieving revision 1.128
diff -r1.128 expr.h
336a337
> extern void record_base_value_rtx	PARAMS ((rtx, rtx, int));
Index: final.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/final.c,v
retrieving revision 1.275
diff -r1.275 final.c
2546a2547,2548
> 
>   fflush(file);
Index: function.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/function.c,v
retrieving revision 1.398
diff -r1.398 function.c
1030a1031,1042
>       /* I think if we're here then we've basically created a new
> 	 expression (new) which points to the same place as old,
> 	 but rewritten.  So it should have a pointer back to the same
> 	 declaration.
> 	 */
>       if(GET_CODE(old) == REG && GET_CODE(new) == REG &&
> 	      REG_EXPR(old) && !REG_EXPR(new))
> 	  set_reg_attrs_from_reg(new, old, 0);
> 
>       if(GET_CODE(new) == REG && GET_CODE(old) == MEM)
> 	  set_reg_attrs_from_mem(new, old);
> 	        
6101c6113,6136
< 
---
> 
> /* Our entry is a indep_ptr struct, just hash on the rtx (the key)
>    Just do pointer stuff.
>    */
> hashval_t get_indep_ptr_hash(const void *entry)
> {
>     indep_ptr_hash_table_entry *e = (indep_ptr_hash_table_entry*)entry;    
>     return ((unsigned int)e->x)>>2;
> }
> 
> /* The equality test for our hash table.  The first argument ENTRY is a table
>    element (i.e. a indep_ptr_hash_table_entry), while the second arg X is an rtx.
>    Just compare pointers.
>    */
> 
> static int
> indep_ptr_entry_and_rtx_equal_p (const void *entry, const void *x_arg)
> {
>     rtx x = (rtx)x_arg;
>     indep_ptr_hash_table_entry *e = (indep_ptr_hash_table_entry*)entry;
> 
>     return x == e->x;
> }
> 
6196a6232,6235
>   /* allocate htable for indep ptr info */
>   cfun->indep_ptr_hash_table = htab_create_ggc (31, get_indep_ptr_hash,
> 	  indep_ptr_entry_and_rtx_equal_p, NULL);
>   
Index: function.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/function.h,v
retrieving revision 1.92
diff -r1.92 function.h
21a22,23
> #include "hashtab.h"
> 
162a165,172
> /* node for a hash table which associates expressions (temp regs, symbols, etc)
>    with the declration of a pointer with indep information */
> typedef struct indep_ptr_hash_table_entry GTY(())
> {
>     rtx x; /* an rtx expression that's a pointer with indep info */
>     struct tree_decl *decl; /* the original declaration of the pointer */
> } indep_ptr_hash_table_entry;
> 
325a336,338
>   /* pragma indep data structures */
>   htab_t GTY((param_is (struct indep_ptr_hash_table_entry))) indep_ptr_hash_table;
>   
618a632
> 
Index: longlong.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/longlong.h,v
retrieving revision 1.33
diff -r1.33 longlong.h
560c560,569
< #if defined (__mips__) && W_TYPE_SIZE == 32
---
> #if defined (__simplescalar__)
> #define umul_ppmm(w1, w0, u, v) \
>   __asm__ ("multu %2,%3\n	mflo %0\n	mfhi %1"			\
> 	  : "=d" ((USItype)(w0)),				\
> 	  "=d" ((USItype)(w1))					\
> 	  : "d" ((USItype)(u)),					\
> 	  "d" ((USItype)(v)))
> #define UMUL_TIME 10
> #define UDIV_TIME 100
> #elif defined (__mips__) && W_TYPE_SIZE == 32
Index: loop.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/loop.c,v
retrieving revision 1.439
diff -r1.439 loop.c
7787c7787
< 	    record_base_value (REGNO (SET_DEST (set)), SET_SRC (set), 0);
---
> 	    record_base_value_rtx (SET_DEST (set), SET_SRC (set), 0);
7794c7794
<     record_base_value (REGNO (SET_DEST (seq)), SET_SRC (seq), 0);
---
>     record_base_value_rtx (SET_DEST (seq), SET_SRC (seq), 0);
Index: rtl.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/rtl.c,v
retrieving revision 1.122
diff -r1.122 rtl.c
295c295
<     case REG:
---
>       case REG:  
Index: rtl.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.382
diff -r1.382 rtl.h
1390a1391
> extern void set_reg_attrs_from_reg	PARAMS ((rtx, rtx, int));
Index: toplev.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.703
diff -r1.703 toplev.c
101a102,103
> extern void profile_mem PARAMS ((void));
> extern void init_profile_mem PARAMS ((void));
890a893,895
> /* If nonzero, do our wacky memory analysis stuff.. */
> int flag_profile_mem;
> 
1195a1201,1203
>    { "prof-mem", &flag_profile_mem, 1,
>    N_("Do wacky memory profiling.") },
>  
2409a2418,2420
>   if(flag_profile_mem)
>       init_profile_mem();
> 
3247a3259,3268
>   if(flag_profile_mem)
>   {
>       profile_mem();
>       /* if we added chkmem instructions, register lifetimes changed */
>       compute_bb_for_insn();
>       allocate_reg_life_data ();
>       update_life_info (NULL, UPDATE_LIFE_GLOBAL, PROP_REG_INFO);
> 
>   }
>   
Index: tree.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/tree.h,v
retrieving revision 1.377
diff -r1.377 tree.h
1781a1782,1786
> /* A list of tree decls which the user has specified
>    as not aliasing with this decl using #pragma indep */
> #define DECL_INDEP_PTR_LIST(NODE) \
>   (DECL_CHECK (NODE)->decl.indep_ptr_list)
> 
1796a1802,1808
> /* dkoes -- A list of tree_decls which the user asserts will never alias.
>  */
> struct indep_ptr_list_type GTY(())
> {
>     struct tree_decl *decl;
>     struct indep_ptr_list_type *next;
> };
1896a1909,1910
>   struct indep_ptr_list_type *indep_ptr_list;
>   
Index: unroll.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/unroll.c,v
retrieving revision 1.187
diff -r1.187 unroll.c
1074c1074
< 		    record_base_value (REGNO (map->reg_map[r]),
---
> 		    record_base_value_rtx ((map->reg_map[r]),
1224c1224
< 	    record_base_value (REGNO (map->reg_map[r]),
---
> 	    record_base_value_rtx ( (map->reg_map[r]),
2017c2017
< 		      record_base_value (REGNO (tem),
---
> 		      record_base_value_rtx ((tem),
2584c2584
< 		  record_base_value (REGNO (tem), bl->biv->add_val, 0);
---
> 		  record_base_value_rtx ((tem), bl->biv->add_val, 0);
2641c2641
< 	      record_base_value (REGNO (tem), bl->biv->add_val, 0);
---
> 	      record_base_value_rtx ( (tem), bl->biv->add_val, 0);
2791c2791
< 	      record_base_value (REGNO (tem), bl->biv->add_val, 0);
---
> 	      record_base_value_rtx ( (tem), bl->biv->add_val, 0);
2833c2833
< 		  record_base_value (REGNO (tem), v->add_val, 0);
---
> 		  record_base_value_rtx ( (tem), v->add_val, 0);
3021c3021
< 	  record_base_value (REGNO (tem), bl->biv->add_val, 0);
---
> 	  record_base_value_rtx ( (tem), bl->biv->add_val, 0);
3120c3120
< 	  record_base_value (REGNO (tem), bl->biv->add_val, 0);
---
> 	  record_base_value_rtx ( (tem), bl->biv->add_val, 0);
Index: config/i386/i386.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.516
diff -r1.516 i386.c
1402a1403,1405
> 
>     extern int flag_profile_mem;
> 
1405c1408
<       && !optimize_size)
---
>       && !optimize_size && !flag_profile_mem)
1407a1411
> 
1415a1420
> 
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.141
diff -r1.141 inclhack.def
2681a2682
>     files     = "signal.h";
