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: [PATCH] Get rid of awkward semantics for subtypes


> 	(gnat_get_subrange_bounds): New function.

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


2009-05-23  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/misc.c (gnat_get_subrange_bounds): Fix thinko.


-- 
Eric Botcazou
Index: gcc-interface/misc.c
===================================================================
--- gcc-interface/misc.c	(revision 147814)
+++ gcc-interface/misc.c	(working copy)
@@ -661,8 +661,12 @@ gnat_get_subrange_bounds (const_tree gnu
 {
   tree min = TYPE_MIN_VALUE (gnu_type);
   tree max = TYPE_MAX_VALUE (gnu_type);
-  *lowval = TREE_CONSTANT (min) ? min : TYPE_GCC_MIN_VALUE (gnu_type);
-  *highval = TREE_CONSTANT (max) ? max : TYPE_GCC_MAX_VALUE (gnu_type);
+  /* If the bounds aren't constant, use non-representable constant values
+     to get the same effect on debug info without tree sharing issues.  */
+  *lowval
+    = TREE_CONSTANT (min) ? min : build_int_cstu (integer_type_node, -1);
+  *highval
+    = TREE_CONSTANT (max) ? max : build_int_cstu (integer_type_node, -1);
 }
 
 /* GNU_TYPE is a type. Determine if it should be passed by reference by

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