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: Ada: fix wrong code generated for small strings passed by reference


Arnaud Charlet <charlet@ACT-Europe.FR> writes:

> Tested on x86-linux
> 
> The compiler generated wrong code for
>   Blank_8_Str : aliased constant String := (1 .. 8 => <space>);
>   S : aliased String := Blank_8_Str;
>   subtype Small_String is String (1 .. 8);
> when S is passed by reference as an (in-)out parameter of type Small_String.
> Objects like S are a bit special: they are formally constrained, yet gigi
> builds a template type for them because they are aliased.  When the function
> call is built, the argument must be converted back to the constrained form of
> the type before its address can be taken, as prescribed by the signature of
> the function.

 Do you have a complete test case for this?


-- 
Thanks,
Jim

http://www.student.cs.uwaterloo.ca/~ja2morri/
http://phython.blogspot.com
http://open.nit.ca/wiki/?page=jim


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