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 alias-set-based restrict implementation


This rips out the old restrict implementation.  No free lunch for
removing DECL_POINTER_ALIAS_SET - it is still used by LABEL_DECL_UID.

Bootstrapped and tested on x86_64-unknown-linux-gnu, consider it applied
the rev before the new implementations lands.

Richard.

2009-06-24  Richard Guenther  <rguenther@suse.de>

	PR middle-end/38212
	* alias.c (find_base_decl): Remove.
	(get_deref_alias_set_1): Remove restrict handling.
	* c-common.c (c_apply_type_quals_to_decl): Do not set
	DECL_POINTER_ALIAS_SET.
	* gimplify.c (find_single_pointer_decl_1): Remove.
	(find_single_pointer_decl): Likewise.
	(internal_get_tmp_var): Remove restrict handling.
	(gimple_regimplify_operands): Likewise.
	* omp-low.c (expand_omp_atomic_pipeline): Do not set
	DECL_POINTER_ALIAS_SET. Use ref-all pointers.
	* print-tree.c (print_node): Do not print DECL_POINTER_ALIAS_SET.
	* tree.c (restrict_base_for_decl): Remove.
	(init_ttree): Do not allocate it.
	(make_node_stat): Do not set DECL_POINTER_ALIAS_SET.  Set
	LABEL_DECL_UID for label decls.
	(copy_node_stat): Do not copy restrict information.
	(decl_restrict_base_lookup): Remove.
	(decl_restrict_base_insert): Likewise.
	(print_restrict_base_statistics): Likewise.
	(dump_tree_statistics): Do not call print_restrict_base_statistics.
	* tree.h (DECL_POINTER_ALIAS_SET): Remove.
	(DECL_POINTER_ALIAS_SET_KNOWN_P): Likewise.
	(struct tree_decl_common): Rename pointer_alias_set to label_decl_uid.
	(LABEL_DECL_UID): Adjust.
	(DECL_BASED_ON_RESTRICT_P): Remove.
	(DECL_GET_RESTRICT_BASE): Likewise.
	(SET_DECL_RESTRICT_BASE): Likewise.
	(struct tree_decl_with_vis): Remove based_on_restrict_p flag.

	* config/i386/i386.c (ix86_gimplify_va_arg): Use ref-all pointers
	instead of DECL_POINTER_ALIAS_SET.
	* config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise.
	* config/s390/s390.c (s390_gimplify_va_arg): Likewise.
	* config/spu/spu.c (spu_gimplify_va_arg_expr): Likewise.

	* gcc.c-torture/execute/pr38212.c: New testcase.


Index: trunk/gcc/alias.c
===================================================================
*** trunk.orig/gcc/alias.c	2009-06-23 12:01:41.000000000 +0200
--- trunk/gcc/alias.c	2009-06-23 12:07:08.000000000 +0200
*************** static int base_alias_check (rtx, rtx, e
*** 155,161 ****
  static rtx find_base_value (rtx);
  static int mems_in_disjoint_alias_sets_p (const_rtx, const_rtx);
  static int insert_subset_children (splay_tree_node, void*);
- static tree find_base_decl (tree);
  static alias_set_entry get_alias_set_entry (alias_set_type);
  static const_rtx fixed_scalar_and_varying_struct_p (const_rtx, const_rtx, rtx, rtx,
  						    bool (*) (const_rtx, bool));
--- 155,160 ----
*************** objects_must_conflict_p (tree t1, tree t
*** 422,478 ****
    return alias_sets_must_conflict_p (set1, set2);
  }
  
- /* T is an expression with pointer type.  Find the DECL on which this
-    expression is based.  (For example, in `a[i]' this would be `a'.)
-    If there is no such DECL, or a unique decl cannot be determined,
-    NULL_TREE is returned.  */
- 
- static tree
- find_base_decl (tree t)
- {
-   tree d0, d1;
- 
-   if (t == 0 || t == error_mark_node || ! POINTER_TYPE_P (TREE_TYPE (t)))
-     return 0;
- 
-   if (TREE_CODE (t) == SSA_NAME)
-     t = SSA_NAME_VAR (t);
- 
-   /* If this is a declaration, return it.  If T is based on a restrict
-      qualified decl, return that decl.  */
-   if (DECL_P (t))
-     {
-       if (TREE_CODE (t) == VAR_DECL && DECL_BASED_ON_RESTRICT_P (t))
- 	t = DECL_GET_RESTRICT_BASE (t);
-       return t;
-     }
- 
-   /* Handle general expressions.  It would be nice to deal with
-      COMPONENT_REFs here.  If we could tell that `a' and `b' were the
-      same, then `a->f' and `b->f' are also the same.  */
-   switch (TREE_CODE_CLASS (TREE_CODE (t)))
-     {
-     case tcc_unary:
-       return find_base_decl (TREE_OPERAND (t, 0));
- 
-     case tcc_binary:
-       /* Return 0 if found in neither or both are the same.  */
-       d0 = find_base_decl (TREE_OPERAND (t, 0));
-       d1 = find_base_decl (TREE_OPERAND (t, 1));
-       if (d0 == d1)
- 	return d0;
-       else if (d0 == 0)
- 	return d1;
-       else if (d1 == 0)
- 	return d0;
-       else
- 	return 0;
- 
-     default:
-       return 0;
-     }
- }
- 
  /* Return true if all nested component references handled by
     get_inner_reference in T are such that we should use the alias set
     provided by the object at the heart of T.
--- 421,426 ----
*************** get_deref_alias_set_1 (tree t)
*** 532,587 ****
    if (!flag_strict_aliasing)
      return 0;
  
    if (! TYPE_P (t))
!     {
!       tree decl = find_base_decl (t);
! 
!       if (decl && DECL_POINTER_ALIAS_SET_KNOWN_P (decl))
! 	{
! 	  /* If we haven't computed the actual alias set, do it now.  */
! 	  if (DECL_POINTER_ALIAS_SET (decl) == -2)
! 	    {
! 	      tree pointed_to_type = TREE_TYPE (TREE_TYPE (decl));
! 
! 	      /* No two restricted pointers can point at the same thing.
! 		 However, a restricted pointer can point at the same thing
! 		 as an unrestricted pointer, if that unrestricted pointer
! 		 is based on the restricted pointer.  So, we make the
! 		 alias set for the restricted pointer a subset of the
! 		 alias set for the type pointed to by the type of the
! 		 decl.  */
! 	      alias_set_type pointed_to_alias_set
! 		  = get_alias_set (pointed_to_type);
! 
! 	      if (pointed_to_alias_set == 0)
! 		/* It's not legal to make a subset of alias set zero.  */
! 		DECL_POINTER_ALIAS_SET (decl) = 0;
! 	      else if (AGGREGATE_TYPE_P (pointed_to_type))
! 		/* For an aggregate, we must treat the restricted
! 		   pointer the same as an ordinary pointer.  If we
! 		   were to make the type pointed to by the
! 		   restricted pointer a subset of the pointed-to
! 		   type, then we would believe that other subsets
! 		   of the pointed-to type (such as fields of that
! 		   type) do not conflict with the type pointed to
! 		   by the restricted pointer.  */
! 		DECL_POINTER_ALIAS_SET (decl)
! 		    = pointed_to_alias_set;
! 	      else
! 		{
! 		  DECL_POINTER_ALIAS_SET (decl) = new_alias_set ();
! 		  record_alias_subset (pointed_to_alias_set,
! 				       DECL_POINTER_ALIAS_SET (decl));
! 		}
! 	    }
! 
! 	  /* We use the alias set indicated in the declaration.  */
! 	  return DECL_POINTER_ALIAS_SET (decl);
! 	}
! 
!       /* Now all we care about is the type.  */
!       t = TREE_TYPE (t);
!     }
  
    /* If we have an INDIRECT_REF via a void pointer, we don't
       know anything about what that might alias.  Likewise if the
--- 480,488 ----
    if (!flag_strict_aliasing)
      return 0;
  
+   /* All we care about is the type.  */
    if (! TYPE_P (t))
!     t = TREE_TYPE (t);
  
    /* If we have an INDIRECT_REF via a void pointer, we don't
       know anything about what that might alias.  Likewise if the
Index: trunk/gcc/c-common.c
===================================================================
*** trunk.orig/gcc/c-common.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/c-common.c	2009-06-23 12:07:08.000000000 +0200
*************** c_apply_type_quals_to_decl (int type_qua
*** 4046,4056 ****
  	  || !POINTER_TYPE_P (type)
  	  || !C_TYPE_OBJECT_OR_INCOMPLETE_P (TREE_TYPE (type)))
  	error ("invalid use of %<restrict%>");
-       else if (flag_strict_aliasing && type == TREE_TYPE (decl))
- 	/* Indicate we need to make a unique alias set for this pointer.
- 	   We can't do it here because it might be pointing to an
- 	   incomplete type.  */
- 	DECL_POINTER_ALIAS_SET (decl) = -2;
      }
  }
  
--- 4046,4051 ----
Index: trunk/gcc/config/i386/i386.c
===================================================================
*** trunk.orig/gcc/config/i386/i386.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/config/i386/i386.c	2009-06-23 12:07:08.000000000 +0200
*************** ix86_gimplify_va_arg (tree valist, tree
*** 6928,6934 ****
    /* Pull the value out of the saved registers.  */
  
    addr = create_tmp_var (ptr_type_node, "addr");
-   DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set ();
  
    if (container)
      {
--- 6928,6933 ----
*************** ix86_gimplify_va_arg (tree valist, tree
*** 6983,6991 ****
        else
  	{
  	  int_addr = create_tmp_var (ptr_type_node, "int_addr");
- 	  DECL_POINTER_ALIAS_SET (int_addr) = get_varargs_alias_set ();
  	  sse_addr = create_tmp_var (ptr_type_node, "sse_addr");
- 	  DECL_POINTER_ALIAS_SET (sse_addr) = get_varargs_alias_set ();
  	}
  
        /* First ensure that we fit completely in registers.  */
--- 6982,6988 ----
*************** ix86_gimplify_va_arg (tree valist, tree
*** 7123,7129 ****
    if (container)
      gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over));
  
!   ptrtype = build_pointer_type (type);
    addr = fold_convert (ptrtype, addr);
  
    if (indirect_p)
--- 7120,7126 ----
    if (container)
      gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over));
  
!   ptrtype = build_pointer_type_for_mode (type, ptr_mode, true);
    addr = fold_convert (ptrtype, addr);
  
    if (indirect_p)
Index: trunk/gcc/gimplify.c
===================================================================
*** trunk.orig/gcc/gimplify.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/gimplify.c	2009-06-23 12:07:08.000000000 +0200
*************** remove_suffix (char *name, int len)
*** 430,486 ****
      }
  }
  
- /* Subroutine for find_single_pointer_decl.  */
- 
- static tree
- find_single_pointer_decl_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- 			    void *data)
- {
-   tree *pdecl = (tree *) data;
- 
-   /* We are only looking for pointers at the same level as the
-      original tree; we must not look through any indirections.
-      Returning anything other than NULL_TREE will cause the caller to
-      not find a base.  */
-   if (REFERENCE_CLASS_P (*tp))
-     return *tp;
- 
-   if (DECL_P (*tp) && POINTER_TYPE_P (TREE_TYPE (*tp)))
-     {
-       if (*pdecl)
- 	{
- 	  /* We already found a pointer decl; return anything other
- 	     than NULL_TREE to unwind from walk_tree signalling that
- 	     we have a duplicate.  */
- 	  return *tp;
- 	}
-       *pdecl = *tp;
-     }
- 
-   return NULL_TREE;
- }
- 
- /* Find the single DECL of pointer type in the tree T, used directly
-    rather than via an indirection, and return it.  If there are zero
-    or more than one such DECLs, return NULL.  */
- 
- static tree
- find_single_pointer_decl (tree t)
- {
-   tree decl = NULL_TREE;
- 
-   if (walk_tree (&t, find_single_pointer_decl_1, &decl, NULL))
-     {
-       /* find_single_pointer_decl_1 returns a nonzero value, causing
- 	 walk_tree to return a nonzero value, to indicate that it
- 	 found more than one pointer DECL or that it found an
- 	 indirection.  */
-       return NULL_TREE;
-     }
- 
-   return decl;
- }
- 
  /* Create a new temporary name with PREFIX.  Returns an identifier.  */
  
  static GTY(()) unsigned int tmp_var_id_num;
--- 430,435 ----
*************** internal_get_tmp_var (tree val, gimple_s
*** 653,679 ****
  
    t = lookup_tmp_var (val, is_formal);
  
!   if (is_formal)
!     {
!       tree u = find_single_pointer_decl (val);
! 
!       if (u && TREE_CODE (u) == VAR_DECL && DECL_BASED_ON_RESTRICT_P (u))
! 	u = DECL_GET_RESTRICT_BASE (u);
!       if (u && TYPE_RESTRICT (TREE_TYPE (u)))
! 	{
! 	  if (DECL_BASED_ON_RESTRICT_P (t))
! 	    gcc_assert (u == DECL_GET_RESTRICT_BASE (t));
! 	  else
! 	    {
! 	      DECL_BASED_ON_RESTRICT_P (t) = 1;
! 	      SET_DECL_RESTRICT_BASE (t, u);
! 	    }
! 	}
! 
!       if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE
! 	  || TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
! 	DECL_GIMPLE_REG_P (t) = 1;
!     }
  
    mod = build2 (INIT_EXPR, TREE_TYPE (t), t, unshare_expr (val));
  
--- 602,611 ----
  
    t = lookup_tmp_var (val, is_formal);
  
!   if (is_formal
!       && (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE
! 	  || TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE))
!     DECL_GIMPLE_REG_P (t) = 1;
  
    mod = build2 (INIT_EXPR, TREE_TYPE (t), t, unshare_expr (val));
  
*************** gimple_regimplify_operands (gimple stmt,
*** 7766,7778 ****
  		DECL_GIMPLE_REG_P (temp) = 1;
  	      if (TREE_CODE (orig_lhs) == SSA_NAME)
  		orig_lhs = SSA_NAME_VAR (orig_lhs);
- 	      if (TREE_CODE (orig_lhs) == VAR_DECL
- 		  && DECL_BASED_ON_RESTRICT_P (orig_lhs))
- 		{
- 		  DECL_BASED_ON_RESTRICT_P (temp) = 1;
- 		  SET_DECL_RESTRICT_BASE (temp,
- 					  DECL_GET_RESTRICT_BASE (orig_lhs));
- 		}
  
  	      if (gimple_in_ssa_p (cfun))
  		temp = make_ssa_name (temp, NULL);
--- 7698,7703 ----
Index: trunk/gcc/omp-low.c
===================================================================
*** trunk.orig/gcc/omp-low.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/omp-low.c	2009-06-23 12:07:08.000000000 +0200
*************** expand_omp_atomic_pipeline (basic_block
*** 5016,5029 ****
      {
        tree iaddr_val;
  
!       iaddr = create_tmp_var (build_pointer_type (itype), NULL);
        iaddr_val
  	= force_gimple_operand_gsi (&si,
  				    fold_convert (TREE_TYPE (iaddr), addr),
  				    false, NULL_TREE, true, GSI_SAME_STMT);
        stmt = gimple_build_assign (iaddr, iaddr_val);
        gsi_insert_before (&si, stmt, GSI_SAME_STMT);
-       DECL_POINTER_ALIAS_SET (iaddr) = 0;
        loadedi = create_tmp_var (itype, NULL);
        if (gimple_in_ssa_p (cfun))
  	{
--- 5016,5029 ----
      {
        tree iaddr_val;
  
!       iaddr = create_tmp_var (build_pointer_type_for_mode (itype, ptr_mode,
! 							   true), NULL);
        iaddr_val
  	= force_gimple_operand_gsi (&si,
  				    fold_convert (TREE_TYPE (iaddr), addr),
  				    false, NULL_TREE, true, GSI_SAME_STMT);
        stmt = gimple_build_assign (iaddr, iaddr_val);
        gsi_insert_before (&si, stmt, GSI_SAME_STMT);
        loadedi = create_tmp_var (itype, NULL);
        if (gimple_in_ssa_p (cfun))
  	{
Index: trunk/gcc/print-tree.c
===================================================================
*** trunk.orig/gcc/print-tree.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/print-tree.c	2009-06-23 12:07:08.000000000 +0200
*************** print_node (FILE *file, const char *pref
*** 483,492 ****
  			 built_in_class_names[(int) DECL_BUILT_IN_CLASS (node)],
  			 built_in_names[(int) DECL_FUNCTION_CODE (node)]);
  	    }
- 	  
- 	  if (DECL_POINTER_ALIAS_SET_KNOWN_P (node))
- 	    fprintf (file, " alias set " HOST_WIDE_INT_PRINT_DEC,
- 		     (HOST_WIDE_INT) DECL_POINTER_ALIAS_SET (node));
  	}
        if (code == FIELD_DECL)
  	{
--- 483,488 ----
Index: trunk/gcc/testsuite/gcc.c-torture/execute/pr38212.c
===================================================================
*** /dev/null	1970-01-01 00:00:00.000000000 +0000
--- trunk/gcc/testsuite/gcc.c-torture/execute/pr38212.c	2009-06-23 12:07:08.000000000 +0200
***************
*** 0 ****
--- 1,22 ----
+ int __attribute__((noinline))
+ foo (int *__restrict p, int i)
+ {
+   int *__restrict q;
+   int *__restrict r;
+   int v, w;
+   q = p + 1;
+   r = q - i;
+   v = *r;
+   *p = 1;
+   w = *r;
+   return v + w;
+ }
+ extern void abort (void);
+ int main()
+ {
+   int i = 0;
+   if (foo (&i, 1) != 1)
+     abort ();
+   return 0;
+ }
+ 
Index: trunk/gcc/tree.c
===================================================================
*** trunk.orig/gcc/tree.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/tree.c	2009-06-23 12:07:08.000000000 +0200
*************** static GTY ((if_marked ("tree_priority_m
*** 194,202 ****
  	     param_is (struct tree_priority_map)))
    htab_t init_priority_for_decl;
  
- static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
-   htab_t restrict_base_for_decl;
- 
  static void set_type_quals (tree, int);
  static int type_hash_eq (const void *, const void *);
  static hashval_t type_hash_hash (const void *);
--- 194,199 ----
*************** init_ttree (void)
*** 273,280 ****
  					 tree_map_eq, 0);
    init_priority_for_decl = htab_create_ggc (512, tree_priority_map_hash,
  					    tree_priority_map_eq, 0);
-   restrict_base_for_decl = htab_create_ggc (256, tree_map_hash,
- 					    tree_map_eq, 0);
  
    int_cst_hash_table = htab_create_ggc (1024, int_cst_hash_hash,
  					int_cst_hash_eq, NULL);
--- 270,275 ----
*************** make_node_stat (enum tree_code code MEM_
*** 658,668 ****
  	    }
  	  else
  	    DECL_ALIGN (t) = 1;
- 	  /* We have not yet computed the alias set for this declaration.  */
- 	  DECL_POINTER_ALIAS_SET (t) = -1;
  	}
        DECL_SOURCE_LOCATION (t) = input_location;
        DECL_UID (t) = next_decl_uid++;
  
        break;
  
--- 653,663 ----
  	    }
  	  else
  	    DECL_ALIGN (t) = 1;
  	}
        DECL_SOURCE_LOCATION (t) = input_location;
        DECL_UID (t) = next_decl_uid++;
+       if (TREE_CODE (t) == LABEL_DECL)
+ 	LABEL_DECL_UID (t) = -1;
  
        break;
  
*************** copy_node_stat (tree node MEM_STAT_DECL)
*** 748,758 ****
  	  SET_DECL_INIT_PRIORITY (t, DECL_INIT_PRIORITY (node));
  	  DECL_HAS_INIT_PRIORITY_P (t) = 1;
  	}
-       if (TREE_CODE (node) == VAR_DECL && DECL_BASED_ON_RESTRICT_P (node))
- 	{
- 	  SET_DECL_RESTRICT_BASE (t, DECL_GET_RESTRICT_BASE (node));
- 	  DECL_BASED_ON_RESTRICT_P (t) = 1;
- 	}
      }
    else if (TREE_CODE_CLASS (code) == tcc_type)
      {
--- 743,748 ----
*************** decl_fini_priority_insert (tree decl, pr
*** 4514,4549 ****
    h->fini = priority;
  }  
  
- /* Look up a restrict qualified base decl for FROM.  */
- 
- tree
- decl_restrict_base_lookup (tree from)
- {
-   struct tree_map *h;
-   struct tree_map in;
- 
-   in.base.from = from;
-   h = (struct tree_map *) htab_find_with_hash (restrict_base_for_decl, &in,
- 					       htab_hash_pointer (from));
-   return h ? h->to : NULL_TREE;
- }
- 
- /* Record the restrict qualified base TO for FROM.  */
- 
- void
- decl_restrict_base_insert (tree from, tree to)
- {
-   struct tree_map *h;
-   void **loc;
- 
-   h = GGC_NEW (struct tree_map);
-   h->hash = htab_hash_pointer (from);
-   h->base.from = from;
-   h->to = to;
-   loc = htab_find_slot_with_hash (restrict_base_for_decl, h, h->hash, INSERT);
-   *(struct tree_map **) loc = h;
- }
- 
  /* Print out the statistics for the DECL_DEBUG_EXPR hash table.  */
  
  static void
--- 4504,4509 ----
*************** print_value_expr_statistics (void)
*** 4566,4585 ****
  	   htab_collisions (value_expr_for_decl));
  }
  
- /* Print out statistics for the RESTRICT_BASE_FOR_DECL hash table, but
-    don't print anything if the table is empty.  */
- 
- static void
- print_restrict_base_statistics (void)
- {
-   if (htab_elements (restrict_base_for_decl) != 0)
-     fprintf (stderr,
- 	     "RESTRICT_BASE    hash: size %ld, %ld elements, %f collisions\n",
- 	     (long) htab_size (restrict_base_for_decl),
- 	     (long) htab_elements (restrict_base_for_decl),
- 	     htab_collisions (restrict_base_for_decl));
- }
- 
  /* Lookup a debug expression for FROM, and return it if we find one.  */
  
  tree 
--- 4526,4531 ----
*************** dump_tree_statistics (void)
*** 7091,7097 ****
    print_type_hash_statistics ();
    print_debug_expr_statistics ();
    print_value_expr_statistics ();
-   print_restrict_base_statistics ();
    lang_hooks.print_statistics ();
  }
  
--- 7037,7042 ----
Index: trunk/gcc/tree.h
===================================================================
*** trunk.orig/gcc/tree.h	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/tree.h	2009-06-24 14:16:08.000000000 +0200
*************** struct GTY(()) tree_decl_minimal {
*** 2565,2580 ****
  #define DECL_LANG_FLAG_6(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6)
  #define DECL_LANG_FLAG_7(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7)
  
- /* Used to indicate an alias set for the memory pointed to by this
-    particular FIELD_DECL, PARM_DECL, or VAR_DECL, which must have
-    pointer (or reference) type.  */
- #define DECL_POINTER_ALIAS_SET(NODE) \
-   (DECL_COMMON_CHECK (NODE)->decl_common.pointer_alias_set)
- 
- /* Nonzero if an alias set has been assigned to this declaration.  */
- #define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \
-   (DECL_POINTER_ALIAS_SET (NODE) != - 1)
- 
  /* Nonzero for a decl which is at file scope.  */
  #define DECL_FILE_SCOPE_P(EXP) 					\
    (! DECL_CONTEXT (EXP)						\
--- 2565,2570 ----
*************** struct GTY(()) tree_decl_common {
*** 2646,2652 ****
    /* DECL_ALIGN.  It should have the same size as TYPE_ALIGN.  */
    unsigned int align;
  
!   alias_set_type pointer_alias_set;
    /* Points to a structure whose details depend on the language in use.  */
    struct lang_decl *lang_specific;
  };
--- 2636,2642 ----
    /* DECL_ALIGN.  It should have the same size as TYPE_ALIGN.  */
    unsigned int align;
  
!   int label_decl_uid;
    /* Points to a structure whose details depend on the language in use.  */
    struct lang_decl *lang_specific;
  };
*************** struct GTY(()) tree_field_decl {
*** 2776,2782 ****
     dense, unique within any one function, and may be used to index arrays.
     If the value is -1, then no UID has been assigned.  */
  #define LABEL_DECL_UID(NODE) \
!   (LABEL_DECL_CHECK (NODE)->decl_common.pointer_alias_set)
  
  /* In LABEL_DECL nodes, nonzero means that an error message about
     jumping into such a binding contour has been printed for this label.  */
--- 2766,2772 ----
     dense, unique within any one function, and may be used to index arrays.
     If the value is -1, then no UID has been assigned.  */
  #define LABEL_DECL_UID(NODE) \
!   (LABEL_DECL_CHECK (NODE)->decl_common.label_decl_uid)
  
  /* In LABEL_DECL nodes, nonzero means that an error message about
     jumping into such a binding contour has been printed for this label.  */
*************** struct GTY(()) tree_parm_decl {
*** 2828,2848 ****
  /* Used to indicate that the DECL is a dllimport.  */
  #define DECL_DLLIMPORT_P(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.dllimport_flag)
  
- /* DECL_BASED_ON_RESTRICT_P records whether a VAR_DECL is a temporary
-    based on a variable with a restrict qualified type.  If it is,
-    DECL_RESTRICT_BASE returns the restrict qualified variable on which
-    it is based.  */
- 
- #define DECL_BASED_ON_RESTRICT_P(NODE) \
-   (VAR_DECL_CHECK (NODE)->decl_with_vis.based_on_restrict_p)
- #define DECL_GET_RESTRICT_BASE(NODE) \
-   (decl_restrict_base_lookup (VAR_DECL_CHECK (NODE)))
- #define SET_DECL_RESTRICT_BASE(NODE, VAL) \
-   (decl_restrict_base_insert (VAR_DECL_CHECK (NODE), (VAL)))
- 
- extern tree decl_restrict_base_lookup (tree);
- extern void decl_restrict_base_insert (tree, tree);
- 
  /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need
     not be put out unless it is needed in this translation unit.
     Entities like this are shared across translation units (like weak
--- 2818,2823 ----
*************** struct GTY(()) tree_decl_with_vis {
*** 2933,2960 ****
   tree comdat_group;
  
   /* Belong to VAR_DECL exclusively.  */
!  unsigned defer_output:1;
!  unsigned hard_register:1;
!  unsigned thread_local:1;
!  unsigned common_flag:1;
   unsigned in_text_section : 1;
   unsigned dllimport_flag : 1;
-  unsigned based_on_restrict_p : 1;
   /* Used by C++.  Might become a generic decl flag.  */
   unsigned shadowed_for_var_p : 1;
- 
   /* Don't belong to VAR_DECL exclusively.  */
!  unsigned weak_flag:1;
   unsigned seen_in_bind_expr : 1;
   unsigned comdat_flag : 1;
   ENUM_BITFIELD(symbol_visibility) visibility : 2;
   unsigned visibility_specified : 1;
-  /* Belong to FUNCTION_DECL exclusively.  */
-  unsigned init_priority_p:1;
- 
   /* Belongs to VAR_DECL exclusively.  */
   ENUM_BITFIELD(tls_model) tls_model : 3;
!  /* 14 unused bits. */
  };
  
  /* In a VAR_DECL that's static,
--- 2908,2934 ----
   tree comdat_group;
  
   /* Belong to VAR_DECL exclusively.  */
!  unsigned defer_output : 1;
!  unsigned hard_register : 1;
!  unsigned thread_local : 1;
!  unsigned common_flag : 1;
   unsigned in_text_section : 1;
   unsigned dllimport_flag : 1;
   /* Used by C++.  Might become a generic decl flag.  */
   unsigned shadowed_for_var_p : 1;
   /* Don't belong to VAR_DECL exclusively.  */
!  unsigned weak_flag : 1;
! 
   unsigned seen_in_bind_expr : 1;
   unsigned comdat_flag : 1;
   ENUM_BITFIELD(symbol_visibility) visibility : 2;
   unsigned visibility_specified : 1;
   /* Belongs to VAR_DECL exclusively.  */
   ENUM_BITFIELD(tls_model) tls_model : 3;
! 
!  /* Belong to FUNCTION_DECL exclusively.  */
!  unsigned init_priority_p : 1;
!  /* 15 unused bits. */
  };
  
  /* In a VAR_DECL that's static,
Index: trunk/gcc/config/rs6000/rs6000.c
===================================================================
*** trunk.orig/gcc/config/rs6000/rs6000.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/config/rs6000/rs6000.c	2009-06-23 12:07:08.000000000 +0200
*************** rs6000_gimplify_va_arg (tree valist, tre
*** 6978,6984 ****
    int size, rsize, n_reg, sav_ofs, sav_scale;
    tree lab_false, lab_over, addr;
    int align;
!   tree ptrtype = build_pointer_type (type);
    int regalign = 0;
    gimple stmt;
  
--- 6978,6984 ----
    int size, rsize, n_reg, sav_ofs, sav_scale;
    tree lab_false, lab_over, addr;
    int align;
!   tree ptrtype = build_pointer_type_for_mode (type, ptr_mode, true);
    int regalign = 0;
    gimple stmt;
  
*************** rs6000_gimplify_va_arg (tree valist, tre
*** 7069,7075 ****
  
    lab_over = NULL;
    addr = create_tmp_var (ptr_type_node, "addr");
-   DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set ();
  
    /*  AltiVec vectors never go in registers when -mabi=altivec.  */
    if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (TYPE_MODE (type)))
--- 7069,7074 ----
Index: trunk/gcc/config/s390/s390.c
===================================================================
*** trunk.orig/gcc/config/s390/s390.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/config/s390/s390.c	2009-06-23 12:07:08.000000000 +0200
*************** s390_gimplify_va_arg (tree valist, tree
*** 8624,8630 ****
    lab_false = create_artificial_label (UNKNOWN_LOCATION);
    lab_over = create_artificial_label (UNKNOWN_LOCATION);
    addr = create_tmp_var (ptr_type_node, "addr");
-   DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set ();
  
    t = fold_convert (TREE_TYPE (reg), size_int (max_reg));
    t = build2 (GT_EXPR, boolean_type_node, reg, t);
--- 8624,8629 ----
*************** s390_gimplify_va_arg (tree valist, tree
*** 8671,8683 ****
  
    if (indirect_p)
      {
!       t = build_pointer_type (build_pointer_type (type));
        addr = fold_convert (t, addr);
        addr = build_va_arg_indirect_ref (addr);
      }
    else
      {
!       t = build_pointer_type (type);
        addr = fold_convert (t, addr);
      }
  
--- 8670,8683 ----
  
    if (indirect_p)
      {
!       t = build_pointer_type_for_mode (build_pointer_type (type),
! 				       ptr_mode, true);
        addr = fold_convert (t, addr);
        addr = build_va_arg_indirect_ref (addr);
      }
    else
      {
!       t = build_pointer_type_for_mode (type, ptr_mode, true);
        addr = fold_convert (t, addr);
      }
  
Index: trunk/gcc/config/spu/spu.c
===================================================================
*** trunk.orig/gcc/config/spu/spu.c	2009-06-23 12:01:14.000000000 +0200
--- trunk/gcc/config/spu/spu.c	2009-06-23 12:07:08.000000000 +0200
*************** spu_gimplify_va_arg_expr (tree valist, t
*** 4070,4076 ****
      build3 (COMPONENT_REF, TREE_TYPE (f_skip), valist, f_skip, NULL_TREE);
  
    addr = create_tmp_var (ptr_type_node, "va_arg");
-   DECL_POINTER_ALIAS_SET (addr) = get_varargs_alias_set ();
  
    /* if an object is dynamically sized, a pointer to it is passed
       instead of the object itself. */
--- 4070,4075 ----
*************** spu_gimplify_va_arg_expr (tree valist, t
*** 4100,4106 ****
    tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, paddedsize);
    gimplify_assign (unshare_expr (args), tmp, pre_p);
  
!   addr = fold_convert (build_pointer_type (type), addr);
  
    if (pass_by_reference_p)
      addr = build_va_arg_indirect_ref (addr);
--- 4099,4106 ----
    tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, paddedsize);
    gimplify_assign (unshare_expr (args), tmp, pre_p);
  
!   addr = fold_convert (build_pointer_type_for_mode (type, ptr_mode, true),
! 		       addr);
  
    if (pass_by_reference_p)
      addr = build_va_arg_indirect_ref (addr);


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