diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-09-19 08:12:52 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-09-19 08:12:52 +0000 |
commit | 348c3ae62ec5579323defd9179aa6b870e0b744b (patch) | |
tree | 7c87e2612448a5939978a961e177de85ccd66310 /gcc/testsuite/gnat.dg | |
parent | e516702202bcdc26181cf9fab120fcb15ca0c15d (diff) | |
download | gcc-348c3ae62ec5579323defd9179aa6b870e0b744b.zip gcc-348c3ae62ec5579323defd9179aa6b870e0b744b.tar.gz gcc-348c3ae62ec5579323defd9179aa6b870e0b744b.tar.bz2 |
[Ada] Fix fallout of previous change for bit-packed arrays
This fixes a regression introduced by the previous change that improved
the handling of explicit by-reference mechanism. For the very specific
case of a component of a bit-packed array, the front-end still needs to
insert a copy around the call because this is where the rewriting into
the sequence of mask-and-shifts is done for the code generator.
2019-09-19 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* exp_ch6.adb (Add_Simple_Call_By_Copy_Code): Add
Bit_Packed_Array parameter and documet it. Always insert a copy
if it is set True.
(Expand_Actuals): Adjust the calls to
Add_Simple_Call_By_Copy_Code.
gcc/testsuite/
* gnat.dg/pack26.adb: New testcase.
From-SVN: r275933
Diffstat (limited to 'gcc/testsuite/gnat.dg')
-rw-r--r-- | gcc/testsuite/gnat.dg/pack26.adb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/gnat.dg/pack26.adb b/gcc/testsuite/gnat.dg/pack26.adb new file mode 100644 index 0000000..6365296 --- /dev/null +++ b/gcc/testsuite/gnat.dg/pack26.adb @@ -0,0 +1,23 @@ +-- { dg-do run } + +pragma Extend_System (Aux_DEC); + +with System; + +procedure Pack26 is + + type Bool_Array is array (1 .. 8) of Boolean; + pragma pack (Bool_Array); + + All_True : Bool_Array := (others => True); + Old_Value : Boolean := False; + +begin + + System.Clear_Interlocked (All_True (2), Old_Value); + + if not Old_Value then + raise Program_Error; + end if; + +end;
\ No newline at end of file |