This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Fix bogus conversion and comment
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 7 Apr 2009 12:26:46 +0200
- Subject: [Ada] Fix bogus conversion and comment
Tested on i586-suse-linux, applied on the mainline.
2009-04-07 Eric Botcazou <ebotcazou@adacore.com>
* 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);
break;
case Attr_Alignment: