From: Eric Botcazou Date: Tue, 18 Nov 2008 12:10:18 +0000 (+0000) Subject: re PR ada/38127 (ACATS cd1c04e fails on sparc, hppa) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d74b4b00786ae456928033b68ce195794e0bf021;p=platform%2Fupstream%2Fgcc.git re PR ada/38127 (ACATS cd1c04e fails on sparc, hppa) PR ada/38127 * gcc-interface/decl.c (make_type_from_size) : Propagate the name. From-SVN: r141964 --- 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 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) : Do not + special-case boolean types. Propagate the name. * gcc-interface/targtyps.c: Tweak comment. 2008-11-15 Geert Bosch 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;