Revert
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 29 Jan 2006 22:23:10 +0000 (22:23 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 29 Jan 2006 22:23:10 +0000 (22:23 +0000)
2005-11-09  Eric Botcazou  <ebotcazou@adacore.com>
* tree.c (build_qualified_type): Chain the new type to the original
type's TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO linked lists if it is
a POINTER_TYPE or a REFERENCE_TYPE respectively.
(build_pointer_type_for_mode): Only return unqualified types.
(build_reference_type_for_mode): Likewise.

From-SVN: r110382

gcc/ChangeLog
gcc/tree.c

index 37fa3545df4576cffb6a4480b68845c48f950f8a..de75a3b5c7b931568f485f88e663ea15b698938f 100644 (file)
@@ -1,3 +1,14 @@
+2006-01-29  Eric Botcazou  <ebotcazou@adacore.com>
+
+       Revert
+
+       2005-11-09  Eric Botcazou  <ebotcazou@adacore.com>
+       * tree.c (build_qualified_type): Chain the new type to the original
+       type's TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO linked lists if it is
+       a POINTER_TYPE or a REFERENCE_TYPE respectively.
+       (build_pointer_type_for_mode): Only return unqualified types.
+       (build_reference_type_for_mode): Likewise.
+
 2006-01-29  Gabriel Dos Reis  <gdr@integgrable-solutions.net>
 
        * configure.ac (cxx_compat_warn): Set if -Wc++-compat is supported.
index a4c8822446b337b2e2bf478d6bf1262ae524ffdc..456b3e1d2d5508e720c4052b79f749695f495a2c 100644 (file)
@@ -3738,20 +3738,6 @@ build_qualified_type (tree type, int type_quals)
     {
       t = build_variant_type_copy (type);
       set_type_quals (t, type_quals);
-
-      /* If it's a pointer type, the new variant points to the same type.  */
-      if (TREE_CODE (type) == POINTER_TYPE)
-       {
-         TYPE_NEXT_PTR_TO (t) = TYPE_NEXT_PTR_TO (type);
-         TYPE_NEXT_PTR_TO (type) = t;
-       }
-
-      /* Same for a reference type.  */
-      else if (TREE_CODE (type) == REFERENCE_TYPE)
-       {
-         TYPE_NEXT_REF_TO (t) = TYPE_NEXT_REF_TO (type);
-         TYPE_NEXT_REF_TO (type) = t;
-       }
     }
 
   return t;
@@ -4867,12 +4853,10 @@ build_pointer_type_for_mode (tree to_type, enum machine_mode mode,
       && TREE_CODE (TYPE_POINTER_TO (to_type)) != POINTER_TYPE)
     return TYPE_POINTER_TO (to_type);
 
-  /* First, if we already have an unqualified type for pointers to TO_TYPE
-     and it's the proper mode, use it.  */
+  /* 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_QUALS (t)
-       && TYPE_REF_CAN_ALIAS_ALL (t) == can_alias_all)
+    if (TYPE_MODE (t) == mode && TYPE_REF_CAN_ALIAS_ALL (t) == can_alias_all)
       return t;
 
   t = make_node (POINTER_TYPE);
@@ -4918,12 +4902,10 @@ build_reference_type_for_mode (tree to_type, enum machine_mode mode,
       && TREE_CODE (TYPE_REFERENCE_TO (to_type)) != REFERENCE_TYPE)
     return TYPE_REFERENCE_TO (to_type);
 
-  /* First, if we already have an unqualified type for references to TO_TYPE
-     and it's the proper mode, use it.  */
+  /* 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_QUALS (t)
-       && TYPE_REF_CAN_ALIAS_ALL (t) == can_alias_all)
+    if (TYPE_MODE (t) == mode && TYPE_REF_CAN_ALIAS_ALL (t) == can_alias_all)
       return t;
 
   t = make_node (REFERENCE_TYPE);