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]

Re: Fix PR ada/38127


> 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/targtyps.c: Tweak comment.

The attached follow-up patch is needed to generate the same debug info as 
before the above change.

Tested on i586-suse-linux, applied on the mainline.


	PR ada/38127
	* gcc-interface/decl.c (make_type_from_size) <INTEGER_TYPE>: Propagate
	the name.


-- 
Eric Botcazou
Index: gcc-interface/decl.c
===================================================================
--- gcc-interface/decl.c	(revision 141915)
+++ gcc-interface/decl.c	(working copy)
@@ -7220,6 +7220,14 @@ make_type_from_size (tree type, tree siz
 	= 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;

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