[Ada] Fix internal error on packed array In/Out actual parameter

Pierre-Marie de Rodat derodat@adacore.com
Fri Jul 5 07:08:00 GMT 2019


This fixes an issue introduced in Ada 2012 for calls to functions taking
an In/Out parameter and for which the actual is the component of a
packed array.  In this case, the front-end needs to create a temporary
for the actual, initialize it before the call and assign it back after
it, because operations on bit-packed arrays are converted into
mask-and-shift sequences.

Tested on x86_64-pc-linux-gnu, committed on trunk

2019-07-05  Eric Botcazou  <ebotcazou@adacore.com>

gcc/ada/

	* exp_ch4.adb (Expand_N_Indexed_Component): Do not expand actual
	parameters of function calls here either.

gcc/testsuite/

	* gnat.dg/pack23.adb, gnat.dg/pack23_pkg.ads: New testcase.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1701 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190705/27aa38e1/attachment.bin>


More information about the Gcc-patches mailing list