http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53766
--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-12-15 18:16:33 UTC --- Author: ebotcazou Date: Sat Dec 15 18:16:28 2012 New Revision: 194522 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194522 Log: PR ada/53766 Backport from mainline 2012-07-17 Hristian Kirtchev <kirtc...@adacore.com> * exp_attr.adb (Expand_N_Attribute_Reference): Add local variables Attr and Conversion_Added. Add local constant Typ. Retrieve the original attribute after the arithmetic check machinery has modified the node. Add a conversion to the target type when the prefix of attribute Max_Size_In_Storage_Elements is a controlled type. Added: branches/gcc-4_7-branch/gcc/testsuite/gnat.dg/controlled7.adb - copied unchanged from r194521, trunk/gcc/testsuite/gnat.dg/controlled7.adb branches/gcc-4_7-branch/gcc/testsuite/gnat.dg/controlled7.ads - copied unchanged from r194521, trunk/gcc/testsuite/gnat.dg/controlled7.ads Modified: branches/gcc-4_7-branch/gcc/ada/ChangeLog branches/gcc-4_7-branch/gcc/ada/exp_attr.adb branches/gcc-4_7-branch/gcc/testsuite/ChangeLog