OSDN Git Service

PR ada/38127
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Nov 2008 12:10:18 +0000 (12:10 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 18 Nov 2008 12:10:18 +0000 (12:10 +0000)
* gcc-interface/decl.c (make_type_from_size) <INTEGER_TYPE>: Propagate
the name.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141964 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index 0125eb8..5596c1b 100644 (file)
@@ -1,8 +1,8 @@
 2008-11-16  Eric Botcazou  <ebotcazou@adacore.com>
 
        PR ada/38127
-       * gcc-interface/decl.c (make_type_from_size): Do not special-case
-       boolean types.
+       * gcc-interface/decl.c (make_type_from_size) <INTEGER_TYPE>: Do not
+       special-case boolean types.  Propagate  the name.
        * gcc-interface/targtyps.c: Tweak comment.
 
 2008-11-15  Geert Bosch  <bosch@adacore.com>
index 35fdb0c..be30b85 100644 (file)
@@ -7220,6 +7220,14 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
        = convert (TREE_TYPE (new_type), TYPE_MIN_VALUE (type));
       TYPE_MAX_VALUE (new_type)
        = convert (TREE_TYPE (new_type), TYPE_MAX_VALUE (type));
+      /* Propagate the name to avoid creating a fake subrange type.  */
+      if (TYPE_NAME (type))
+       {
+         if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL)
+           TYPE_NAME (new_type) = DECL_NAME (TYPE_NAME (type));
+         else
+           TYPE_NAME (new_type) = TYPE_NAME (type);
+       }
       TYPE_BIASED_REPRESENTATION_P (new_type) = biased_p;
       TYPE_RM_SIZE_NUM (new_type) = bitsize_int (size);
       return new_type;