aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-11-18 12:10:18 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-11-18 12:10:18 +0000
commitd74b4b00786ae456928033b68ce195794e0bf021 (patch)
tree506689d1d9d196cb68f8a58f5d6927b14a9f7e30 /gcc
parent3dae586db9c297814116be9b3d741e9e25498903 (diff)
downloadgcc-d74b4b00786ae456928033b68ce195794e0bf021.zip
gcc-d74b4b00786ae456928033b68ce195794e0bf021.tar.gz
gcc-d74b4b00786ae456928033b68ce195794e0bf021.tar.bz2
re PR ada/38127 (ACATS cd1c04e fails on sparc, hppa)
PR ada/38127 * gcc-interface/decl.c (make_type_from_size) <INTEGER_TYPE>: Propagate the name. From-SVN: r141964
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/gcc-interface/decl.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0125eb8..5596c1b 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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>
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 35fdb0c..be30b85 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -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;