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]

Add support for types who references are in alias set 0


This adds support for a language to designate that all references through
a POINTER_TYPE or a REFERENCE_TYPE should be viewed as being in alias set 0.

It also does some minor flag cleanups along the way.

Tested on i386-64-linux.

2004-03-23  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

	* alias.c (get_alias_set): Add support for TYPE_REF_CAN_ALIAS_ALL.
	* c-common.c (handle_mode_attribute): Add extra arg to
	build_pointer_type_for_mode and build_reference_type_for_mode.
	* c-typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
	for INTEGER_CST.
	* tree.c (build_pointer_type_for_mode): Add arg CAN_ALIAS_ALL.
	Chain pointers via TYPE_NEXT_PTR_TO.
	(build_reference_type_for_mode): Similarly.
	(build_type_no_quals): Add extra arg to build_pointer_type_for_mode
	and build_reference_type_for_mode.
	(tree_check4_failed): New function.
	* tree.h (TREE_CHECK4, PTR_OR_REF_CHECK): New macros.
	(TYPE_REF_CAN_ALIAS_ALL, TYPE_NEXT_PTR_TO, TYPE_NEXT_REF_TO): Likewise.
	(TREE_NO_UNSUED_WARNING, TREE_VIA_VIRTUAL, TREE_CONSTANT_OVERFLOW):
	Add check.

	* cp/typeck.c (build_c_cast): Only look at TREE_CONSTANT_OVERFLOW
	for INTEGER_CST.

	* ada/decl.c (gnat_to_gnu_entity, case E_Access_Type): Pass value
	of No_Strict_Aliasing to build_pointer_type_for_mode.
	* ada/utils.c (update_pointer_to): Walk pointer and ref chains.

*** alias.c	21 Mar 2004 18:09:14 -0000	1.221
--- alias.c	22 Mar 2004 17:58:39 -0000
*************** get_alias_set (tree t)
*** 534,539 ****
  
  	  /* If we have an INDIRECT_REF via a void pointer, we don't
! 	     know anything about what that might alias.  */
! 	  else if (TREE_CODE (TREE_TYPE (inner)) == VOID_TYPE)
  	    return 0;
  	}
--- 534,542 ----
  
  	  /* If we have an INDIRECT_REF via a void pointer, we don't
! 	     know anything about what that might alias.  Likewise if the
! 	     pointer is marked that way.  */
! 	  else if (TREE_CODE (TREE_TYPE (inner)) == VOID_TYPE
! 		   || (TYPE_REF_CAN_ALIAS_ALL
! 		       (TREE_TYPE (TREE_OPERAND (inner, 0)))))
  	    return 0;
  	}
*** c-common.c	20 Mar 2004 05:21:40 -0000	1.492
--- c-common.c	22 Mar 2004 17:58:44 -0000
*************** handle_mode_attribute (tree *node, tree 
*** 4630,4634 ****
  	    {
  	      ptr_type = build_pointer_type_for_mode (TREE_TYPE (type),
! 						      mode);
  	      *node = ptr_type;
  	    }
--- 4630,4634 ----
  	    {
  	      ptr_type = build_pointer_type_for_mode (TREE_TYPE (type),
! 						      mode, false);
  	      *node = ptr_type;
  	    }
*************** handle_mode_attribute (tree *node, tree 
*** 4636,4640 ****
  	    {
  	      ptr_type = build_reference_type_for_mode (TREE_TYPE (type),
! 							mode);
  	      *node = ptr_type;
  	    }
--- 4636,4640 ----
  	    {
  	      ptr_type = build_reference_type_for_mode (TREE_TYPE (type),
! 							mode, false);
  	      *node = ptr_type;
  	    }
*** c-typeck.c	20 Mar 2004 20:46:56 -0000	1.291
--- c-typeck.c	22 Mar 2004 17:58:54 -0000
*************** build_c_cast (tree type, tree expr)
*** 3075,3079 ****
  	{
  	  TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue);
! 	  TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue);
  	}
      }
--- 3075,3081 ----
  	{
  	  TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue);
! 
! 	  if (TREE_CODE_CLASS (TREE_CODE (ovalue)) == 'c')
! 	    TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue);
  	}
      }
*** tree.c	21 Mar 2004 18:09:18 -0000	1.360
--- tree.c	22 Mar 2004 17:59:06 -0000
*************** iterative_hash_expr (tree t, hashval_t v
*** 3879,3895 ****
     constructed by language-dependent code, not here.)  */
  
! /* Construct, lay out and return the type of pointers to TO_TYPE
!    with mode MODE. If such a type has already been constructed,
!    reuse it.  */
  
  tree
! build_pointer_type_for_mode (tree to_type, enum machine_mode mode)
  {
!   tree t = TYPE_POINTER_TO (to_type);
  
    /* First, if we already have a type for pointers to TO_TYPE and it's
       the proper mode, use it.  */
!   if (t != 0 && mode == ptr_mode)
!     return t;
  
    t = make_node (POINTER_TYPE);
--- 3879,3910 ----
     constructed by language-dependent code, not here.)  */
  
! /* Construct, lay out and return the type of pointers to TO_TYPE with
!    mode MODE.  If CAN_ALIAS_ALL is TRUE, indicate this type can
!    reference all of memory. If such a type has already been
!    constructed, reuse it.  */
  
  tree
! build_pointer_type_for_mode (tree to_type, enum machine_mode mode,
! 			     bool can_alias_all)
  {
!   tree t;
! 
!   /* In some cases, languages will have things that aren't a POINTER_TYPE
!      (such as a RECORD_TYPE for fat pointers in Ada) as TYPE_POINTER_TO.
!      In that case, return that type without regard to the rest of our
!      operands.
! 
!      ??? This is a kludge, but consistent with the way this function has
!      always operated and there doesn't seem to be a good way to avoid this
!      at the moment.  */
!   if (TYPE_POINTER_TO (to_type) != 0
!       && TREE_CODE (TYPE_POINTER_TO (to_type)) != POINTER_TYPE)
!     return TYPE_POINTER_TO (to_type);
  
    /* First, if we already have a type for pointers to TO_TYPE and it's
       the proper mode, use it.  */
!   for (t = TYPE_POINTER_TO (to_type); t; t = TYPE_NEXT_PTR_TO (t))
!     if (TYPE_MODE (t) == mode && TYPE_REF_CAN_ALIAS_ALL (t) == can_alias_all)
!       return t;
  
    t = make_node (POINTER_TYPE);
*************** build_pointer_type_for_mode (tree to_typ
*** 3897,3905 ****
    TREE_TYPE (t) = to_type;
    TYPE_MODE (t) = mode;
! 
!   /* We can only record one type as "the" pointer to TO_TYPE.  We choose to
!      record the pointer whose mode is ptr_mode.  */
!   if (mode == ptr_mode)
!     TYPE_POINTER_TO (to_type) = t;
  
    /* Lay out the type.  This function has many callers that are concerned
--- 3912,3918 ----
    TREE_TYPE (t) = to_type;
    TYPE_MODE (t) = mode;
!   TYPE_REF_CAN_ALIAS_ALL (t) = can_alias_all;
!   TYPE_NEXT_PTR_TO (t) = TYPE_POINTER_TO (to_type);
!   TYPE_POINTER_TO (to_type) = t;
  
    /* Lay out the type.  This function has many callers that are concerned
*************** tree
*** 3915,3933 ****
  build_pointer_type (tree to_type)
  {
!   return build_pointer_type_for_mode (to_type, ptr_mode);
  }
  
! /* Construct, lay out and return the type of references to TO_TYPE
!    with mode MODE. If such a type has already been constructed,
!    reuse it.  */
  
  tree
! build_reference_type_for_mode (tree to_type, enum machine_mode mode)
  {
!   tree t = TYPE_REFERENCE_TO (to_type);
  
!   /* First, if we already have a type for pointers to TO_TYPE, use it.  */
!   if (t != 0 && mode == ptr_mode)
!     return t;
  
    t = make_node (REFERENCE_TYPE);
--- 3928,3959 ----
  build_pointer_type (tree to_type)
  {
!   return build_pointer_type_for_mode (to_type, ptr_mode, false);
  }
  
! /* Same as build_pointer_type_for_mode, but for REFERENCE_TYPE.  */
  
  tree
! build_reference_type_for_mode (tree to_type, enum machine_mode mode,
! 			       bool can_alias_all)
  {
!   tree t;
  
!   /* In some cases, languages will have things that aren't a REFERENCE_TYPE
!      (such as a RECORD_TYPE for fat pointers in Ada) as TYPE_REFERENCE_TO.
!      In that case, return that type without regard to the rest of our
!      operands.
! 
!      ??? This is a kludge, but consistent with the way this function has
!      always operated and there doesn't seem to be a good way to avoid this
!      at the moment.  */
!   if (TYPE_REFERENCE_TO (to_type) != 0
!       && TREE_CODE (TYPE_REFERENCE_TO (to_type)) != REFERENCE_TYPE)
!     return TYPE_REFERENCE_TO (to_type);
! 
!   /* First, if we already have a type for pointers to TO_TYPE and it's
!      the proper mode, use it.  */
!   for (t = TYPE_REFERENCE_TO (to_type); t; t = TYPE_NEXT_REF_TO (t))
!     if (TYPE_MODE (t) == mode && TYPE_REF_CAN_ALIAS_ALL (t) == can_alias_all)
!       return t;
  
    t = make_node (REFERENCE_TYPE);
*************** build_reference_type_for_mode (tree to_t
*** 3935,3941 ****
    TREE_TYPE (t) = to_type;
    TYPE_MODE (t) = mode;
! 
!   /* Record this type as the pointer to TO_TYPE.  */
!   if (mode == ptr_mode)
    TYPE_REFERENCE_TO (to_type) = t;
  
--- 3961,3966 ----
    TREE_TYPE (t) = to_type;
    TYPE_MODE (t) = mode;
!   TYPE_REF_CAN_ALIAS_ALL (t) = can_alias_all;
!   TYPE_NEXT_REF_TO (t) = TYPE_REFERENCE_TO (to_type);
    TYPE_REFERENCE_TO (to_type) = t;
  
*************** tree
*** 3952,3956 ****
  build_reference_type (tree to_type)
  {
!   return build_reference_type_for_mode (to_type, ptr_mode);
  }
  
--- 3977,3981 ----
  build_reference_type (tree to_type)
  {
!   return build_reference_type_for_mode (to_type, ptr_mode, false);
  }
  
*************** build_type_no_quals (tree t)
*** 3967,3975 ****
      case POINTER_TYPE:
        return build_pointer_type_for_mode (build_type_no_quals (TREE_TYPE (t)),
! 					  TYPE_MODE (t));
      case REFERENCE_TYPE:
        return
  	build_reference_type_for_mode (build_type_no_quals (TREE_TYPE (t)),
! 				       TYPE_MODE (t));
      default:
        return TYPE_MAIN_VARIANT (t);
--- 3992,4002 ----
      case POINTER_TYPE:
        return build_pointer_type_for_mode (build_type_no_quals (TREE_TYPE (t)),
! 					  TYPE_MODE (t),
! 					  TYPE_REF_CAN_ALIAS_ALL (t));
      case REFERENCE_TYPE:
        return
  	build_reference_type_for_mode (build_type_no_quals (TREE_TYPE (t)),
! 				       TYPE_MODE (t),
! 				       TYPE_REF_CAN_ALIAS_ALL (t));
      default:
        return TYPE_MAIN_VARIANT (t);
*************** tree_check3_failed (const tree node, enu
*** 5021,5024 ****
--- 5048,5066 ----
  		  tree_code_name[code3], tree_code_name[TREE_CODE (node)],
  		  function, trim_filename (file), line);
+ }
+ 
+ /* ... and for four different codes.  */
+ 
+ void
+ tree_check4_failed (const tree node, enum tree_code code1,
+ 		    enum tree_code code2, enum tree_code code3,
+ 		    enum tree_code code4, const char *file, int line,
+ 		    const char *function)
+ {
+   internal_error
+     ("tree check: expected %s, %s, %s or %s; have %s in %s, at %s:%d",
+      tree_code_name[code1], tree_code_name[code2], tree_code_name[code3],
+      tree_code_name[code4], tree_code_name[TREE_CODE (node)], function,
+      trim_filename (file), line);
  }
  
*** tree.h	21 Mar 2004 18:09:18 -0000	1.482
--- tree.h	22 Mar 2004 17:59:18 -0000
*************** struct tree_common GTY(())
*** 198,202 ****
             VAR_DECL, FUNCTION_DECL, CONSTRUCTOR, ADDR_EXPR
         TREE_NO_UNUSED_WARNING in
!            CONVERT_EXPR, NOP_EXPR, COMPOUND_EXPR
         TREE_VIA_VIRTUAL in
             TREE_LIST or TREE_VEC
--- 198,203 ----
             VAR_DECL, FUNCTION_DECL, CONSTRUCTOR, ADDR_EXPR
         TREE_NO_UNUSED_WARNING in
!            CONVERT_EXPR, NOP_EXPR, COMPOUND_EXPR, NON_LVALUE_EXPR
! 	   ??? plus other expressions, apparently (e.g. MODIFY_EXPR).
         TREE_VIA_VIRTUAL in
             TREE_LIST or TREE_VEC
*************** struct tree_common GTY(())
*** 208,211 ****
--- 209,214 ----
             TARGET_EXPR, WITH_CLEANUP_EXPR, CLEANUP_STMT,
  	   TREE_LIST elements of a block's cleanup list.
+        TYPE_REF_CAN_ALIAS_ALL in
+            POINTER_TYPE, REFERENCE_TYPE
  
     public_flag:
*************** struct tree_common GTY(())
*** 213,216 ****
--- 216,220 ----
         TREE_OVERFLOW in
             INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST
+ 	   ??? and other expressions?
         TREE_PUBLIC in
             VAR_DECL or FUNCTION_DECL or IDENTIFIER_NODE
*************** struct tree_common GTY(())
*** 325,328 ****
--- 329,342 ----
      __t; })
  
+ #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) __extension__	\
+ ({  const tree __t = (T);						\
+     if (TREE_CODE (__t) != (CODE1)					\
+ 	&& TREE_CODE (__t) != (CODE2)					\
+ 	&& TREE_CODE (__t) != (CODE3)					\
+ 	&& TREE_CODE (__t) != (CODE4))					\
+       tree_check4_failed (__t, (CODE1), (CODE2), (CODE3), (CODE4),	\
+ 			   __FILE__, __LINE__, __FUNCTION__);		\
+     __t; })
+ 
  #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) __extension__	\
  ({  const tree __t = (T);						\
*************** extern void tree_check3_failed (const tr
*** 403,406 ****
--- 417,424 ----
  				const char *)
      ATTRIBUTE_NORETURN;
+ extern void tree_check4_failed (const tree, enum tree_code, enum tree_code,
+ 				enum tree_code, enum tree_code,
+ 				const char *, int, const char *)
+     ATTRIBUTE_NORETURN;
  extern void tree_check5_failed (const tree, enum tree_code, enum tree_code,
  				enum tree_code, enum tree_code, enum tree_code,
*************** extern void tree_operand_check_failed (i
*** 423,426 ****
--- 441,445 ----
  #define TREE_CHECK2(T, CODE1, CODE2)		(T)
  #define TREE_CHECK3(T, CODE1, CODE2, CODE3)	(T)
+ #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
  #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
  #define TREE_CLASS_CHECK(T, CODE)		(T)
*************** extern void tree_operand_check_failed (i
*** 440,443 ****
--- 459,463 ----
  #define STMT_CHECK(T)		TREE_CLASS_CHECK (T, 's')
  #define FUNC_OR_METHOD_CHECK(T)	TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
+ #define PTR_OR_REF_CHECK(T)	TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)
  
  #define SET_ARRAY_OR_VECTOR_CHECK(T) \
*************** extern void tree_operand_check_failed (i
*** 598,602 ****
  /* In a VAR_DECL, nonzero means allocate static storage.
     In a FUNCTION_DECL, nonzero if function has been defined.
!    In a CONSTRUCTOR, nonzero means allocate static storage.  */
  #define TREE_STATIC(NODE) ((NODE)->common.static_flag)
  
--- 618,625 ----
  /* In a VAR_DECL, nonzero means allocate static storage.
     In a FUNCTION_DECL, nonzero if function has been defined.
!    In a CONSTRUCTOR, nonzero means allocate static storage.
! 
!    ??? This is also used in lots of other nodes in unclear ways which
!    should be cleaned up some day.  */
  #define TREE_STATIC(NODE) ((NODE)->common.static_flag)
  
*************** extern void tree_operand_check_failed (i
*** 606,616 ****
  #define CLEANUP_EH_ONLY(NODE) ((NODE)->common.static_flag)
  
! /* In a CONVERT_EXPR, NOP_EXPR or COMPOUND_EXPR, this means the node was
!    made implicitly and should not lead to an "unused value" warning.  */
! #define TREE_NO_UNUSED_WARNING(NODE) ((NODE)->common.static_flag)
  
  /* Nonzero for a TREE_LIST or TREE_VEC node means that the derivation
     chain is via a `virtual' declaration.  */
! #define TREE_VIA_VIRTUAL(NODE) ((NODE)->common.static_flag)
  
  /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST this means
--- 629,644 ----
  #define CLEANUP_EH_ONLY(NODE) ((NODE)->common.static_flag)
  
! /* In a CONVERT_EXPR, NOP_EXPR, NON_LVALUE_EXPR or COMPOUND_EXPR, this means
!    the node was made implicitly and should not lead to an "unused value"
!    warning. 
! 
!    ??? Apparently this is also used on other expression types (such as
!    MODIFY_EXPR.  This needs to be cleaned up sometime.  */
! #define TREE_NO_UNUSED_WARNING(NODE) (EXPR_CHECK (NODE)->common.static_flag)
  
  /* Nonzero for a TREE_LIST or TREE_VEC node means that the derivation
     chain is via a `virtual' declaration.  */
! #define TREE_VIA_VIRTUAL(NODE) \
!   (TREE_CHECK2 (NODE, TREE_LIST, TREE_VEC)->common.static_flag)
  
  /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST this means
*************** extern void tree_operand_check_failed (i
*** 618,622 ****
     TREE_OVERFLOW because ANSI C requires a diagnostic when overflows
     occur in constant expressions.  */
! #define TREE_CONSTANT_OVERFLOW(NODE) ((NODE)->common.static_flag)
  
  /* In an IDENTIFIER_NODE, this means that assemble_name was called with
--- 646,650 ----
     TREE_OVERFLOW because ANSI C requires a diagnostic when overflows
     occur in constant expressions.  */
! #define TREE_CONSTANT_OVERFLOW(NODE) (CST_CHECK (NODE)->common.static_flag)
  
  /* In an IDENTIFIER_NODE, this means that assemble_name was called with
*************** extern void tree_operand_check_failed (i
*** 625,632 ****
    (IDENTIFIER_NODE_CHECK (NODE)->common.static_flag)
  
  /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
     there was an overflow in folding, and no warning has been issued
!    for this subexpression.  TREE_OVERFLOW implies
!    TREE_CONSTANT_OVERFLOW, but not vice versa.  */
  #define TREE_OVERFLOW(NODE) ((NODE)->common.public_flag)
  
--- 653,668 ----
    (IDENTIFIER_NODE_CHECK (NODE)->common.static_flag)
  
+ /* Nonzero in a pointer or reference type means the data pointed to
+    by this type can alias anything.  */
+ #define TYPE_REF_CAN_ALIAS_ALL(NODE) \
+   (PTR_OR_REF_CHECK (NODE)->common.static_flag)
+ 
  /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
     there was an overflow in folding, and no warning has been issued
!    for this subexpression.  TREE_OVERFLOW implies TREE_CONSTANT_OVERFLOW,
!    but not vice versa. 
! 
!    ??? Apparently, lots of code assumes this is defined in all
!    expressions.  */
  #define TREE_OVERFLOW(NODE) ((NODE)->common.public_flag)
  
*************** struct tree_block GTY(())
*** 1022,1025 ****
--- 1058,1063 ----
  #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type.pointer_to)
  #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type.reference_to)
+ #define TYPE_NEXT_PTR_TO(NODE) (POINTER_TYPE_CHECK (NODE)->type.minval)
+ #define TYPE_NEXT_REF_TO(NODE) (REFERENCE_TYPE_CHECK (NODE)->type.minval)
  #define TYPE_MIN_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.minval)
  #define TYPE_MAX_VALUE(NODE) (NUMERICAL_TYPE_CHECK (NODE)->type.maxval)
*************** extern void initialize_sizetypes (void);
*** 2191,2197 ****
  extern void set_sizetype (tree);
  extern void fixup_unsigned_type (tree);
! extern tree build_pointer_type_for_mode (tree, enum machine_mode);
  extern tree build_pointer_type (tree);
! extern tree build_reference_type_for_mode (tree, enum machine_mode);
  extern tree build_reference_type (tree);
  extern tree build_vector_type_for_mode (tree, enum machine_mode);
--- 2229,2235 ----
  extern void set_sizetype (tree);
  extern void fixup_unsigned_type (tree);
! extern tree build_pointer_type_for_mode (tree, enum machine_mode, bool);
  extern tree build_pointer_type (tree);
! extern tree build_reference_type_for_mode (tree, enum machine_mode, bool);
  extern tree build_reference_type (tree);
  extern tree build_vector_type_for_mode (tree, enum machine_mode);
*** cp/typeck.c	20 Mar 2004 00:18:19 -0000	1.536
--- cp/typeck.c	22 Mar 2004 18:00:56 -0000
*************** build_c_cast (tree type, tree expr)
*** 4920,4924 ****
  	{
  	  TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue);
! 	  TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue);
  	}
      }
--- 4920,4926 ----
  	{
  	  TREE_OVERFLOW (value) = TREE_OVERFLOW (ovalue);
! 
! 	  if (TREE_CODE_CLASS (TREE_CODE (ovalue)) == 'c')
! 	    TREE_CONSTANT_OVERFLOW (value) = TREE_CONSTANT_OVERFLOW (ovalue);
  	}
      }
  
*** ada/decl.c	21 Mar 2004 18:22:36 -0000	1.63.2.45
--- ada/decl.c	23 Mar 2004 19:54:01 -0000
*************** gnat_to_gnu_entity (Entity_Id gnat_entit
*** 2930,2935 ****
  	else if (gnat_desig_type == gnat_entity)
  	  {
! 	    gnu_type = build_pointer_type_for_mode (make_node (VOID_TYPE),
! 						    p_mode);
  	    TREE_TYPE (gnu_type) = TYPE_POINTER_TO (gnu_type) = gnu_type;
  	  }
--- 2930,2937 ----
  	else if (gnat_desig_type == gnat_entity)
  	  {
! 	    gnu_type
! 	      = build_pointer_type_for_mode (make_node (VOID_TYPE),
! 					     p_mode,
! 					     No_Strict_Aliasing (gnat_entity));
  	    TREE_TYPE (gnu_type) = TYPE_POINTER_TO (gnu_type) = gnu_type;
  	  }
*************** gnat_to_gnu_entity (Entity_Id gnat_entit
*** 2983,2987 ****
  	      }
  
! 	    gnu_type = build_pointer_type_for_mode (gnu_desig_type, p_mode);
  	  }
  
--- 2985,2991 ----
  	      }
  
! 	    gnu_type
! 	      = build_pointer_type_for_mode (gnu_desig_type, p_mode,
! 					     No_Strict_Aliasing (gnat_entity));
  	  }
  
*** ada/utils.c	21 Mar 2004 18:25:06 -0000	1.48.2.33
--- ada/utils.c	23 Mar 2004 19:54:18 -0000
*************** update_pointer_to (tree old_type, tree n
*** 2666,2687 ****
    if (TREE_CODE (new_type) != UNCONSTRAINED_ARRAY_TYPE)
      {
-       if (ptr != 0)
- 	TREE_TYPE (ptr) = new_type;
        TYPE_POINTER_TO (new_type) = ptr;
- 
-       if (ref != 0)
- 	TREE_TYPE (ref) = new_type;
        TYPE_REFERENCE_TO (new_type) = ref;
  
!       if (ptr != 0 && TYPE_NAME (ptr) != 0
! 	  && TREE_CODE (TYPE_NAME (ptr)) == TYPE_DECL
! 	  && TREE_CODE (new_type) != ENUMERAL_TYPE)
! 	rest_of_decl_compilation (TYPE_NAME (ptr), NULL,
! 				  global_bindings_p (), 0);
!       if (ref != 0 && TYPE_NAME (ref) != 0
! 	  && TREE_CODE (TYPE_NAME (ref)) == TYPE_DECL
! 	  && TREE_CODE (new_type) != ENUMERAL_TYPE)
! 	rest_of_decl_compilation (TYPE_NAME (ref), NULL,
! 				  global_bindings_p (), 0);
      }
  
--- 2666,2693 ----
    if (TREE_CODE (new_type) != UNCONSTRAINED_ARRAY_TYPE)
      {
        TYPE_POINTER_TO (new_type) = ptr;
        TYPE_REFERENCE_TO (new_type) = ref;
  
!       for (; ptr; ptr = TYPE_NEXT_PTR_TO (ptr))
! 	{
! 	  TREE_TYPE (ptr) = new_type;
! 
! 	  if (TYPE_NAME (ptr) != 0
! 	      && TREE_CODE (TYPE_NAME (ptr)) == TYPE_DECL
! 	      && TREE_CODE (new_type) != ENUMERAL_TYPE)
! 	    rest_of_decl_compilation (TYPE_NAME (ptr), NULL,
! 				      global_bindings_p (), 0);
! 	}
! 
!       for (; ref; ref = TYPE_NEXT_PTR_TO (ref))
! 	{
! 	  TREE_TYPE (ref) = new_type;
! 
! 	  if (TYPE_NAME (ref) != 0
! 	      && TREE_CODE (TYPE_NAME (ref)) == TYPE_DECL
! 	      && TREE_CODE (new_type) != ENUMERAL_TYPE)
! 	    rest_of_decl_compilation (TYPE_NAME (ref), NULL,
! 				      global_bindings_p (), 0);
! 	}
      }
  


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