This is the mail archive of the 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]

[Ada] Fix bogus conversion and comment

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

2009-04-07  Eric Botcazou  <>

	* gcc-interface/trans.c (Attribute_to_gnu) <Max_Size_In_Storage_Elmts>:
	Do not convert the result.  Remove obsolete comment.

Eric Botcazou
Index: gcc-interface/trans.c
--- gcc-interface/trans.c	(revision 145661)
+++ gcc-interface/trans.c	(working copy)
@@ -1390,16 +1390,9 @@ Attribute_to_gnu (Node_Id gnat_node, tre
       gnu_result_type = get_unpadded_type (Etype (gnat_node));
-      /* Always perform division using unsigned arithmetic as the size cannot
-	 be negative, but may be an overflowed positive value. This provides
-	 correct results for sizes up to 512 MB.
-	 ??? Size should be calculated in storage elements directly.  */
       if (attribute == Attr_Max_Size_In_Storage_Elements)
-	gnu_result = convert (sizetype,
-			      fold_build2 (CEIL_DIV_EXPR, bitsizetype,
-					   gnu_result, bitsize_unit_node));
+	gnu_result = fold_build2 (CEIL_DIV_EXPR, bitsizetype,
+				  gnu_result, bitsize_unit_node);
     case Attr_Alignment:

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